]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/emk/top9000/top9000.c
Merge branch 'master' of git://git.denx.de/u-boot-mips
[karo-tx-uboot.git] / board / emk / top9000 / top9000.c
index 6f5662a96d506f5b195f92dd17bb1ed7e380b5c3..6e2ffddb0a434ad570538924263d69bf4c803947 100644 (file)
@@ -6,29 +6,14 @@
  * (C) Copyright 2010
  * Reinhard Meyer, EMK Elektronik, reinhard.meyer@emk-elektronik.de
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <net.h>
 #include <netdev.h>
 #include <mmc.h>
+#include <atmel_mci.h>
 #include <i2c.h>
 #include <spi.h>
 #include <asm/io.h>
@@ -108,17 +93,9 @@ int board_mmc_init(bd_t *bd)
 }
 
 /* this is a weak define that we are overriding */
-int board_mmc_getcd(u8 *cd, struct mmc *mmc)
+int board_mmc_getcd(struct mmc *mmc)
 {
-       /*
-        * the only currently existing use of this function
-        * (fsl_esdhc.c) suggests this function must return
-        * *cs = TRUE if a card is NOT detected -> in most
-        * cases the value of the pin when the detect switch
-        * closes to GND
-        */
-       *cd = at91_get_gpio_value(CONFIG_SYS_MMC_CD_PIN) ? 1 : 0;
-       return 0;
+       return !at91_get_gpio_value(CONFIG_SYS_MMC_CD_PIN);
 }
 
 #endif
@@ -252,7 +229,7 @@ int board_eth_init(bd_t *bis)
  * However i2c_get_bus_num() cannot be called before
  * relocation.
  */
-#ifdef CONFIG_SOFT_I2C
+#ifdef CONFIG_SYS_I2C_SOFT
 void iic_init(void)
 {
        /* ports are now initialized in board_early_init_f() */
@@ -260,7 +237,7 @@ void iic_init(void)
 
 int iic_read(void)
 {
-       switch ((gd->flags & GD_FLG_RELOC) ? i2c_get_bus_num() : 0) {
+       switch (I2C_ADAP_HWNR) {
        case 0:
                return at91_get_pio_value(I2C0_PORT, SDA0_PIN);
        case 1:
@@ -271,7 +248,7 @@ int iic_read(void)
 
 void iic_sda(int bit)
 {
-       switch ((gd->flags & GD_FLG_RELOC) ? i2c_get_bus_num() : 0) {
+       switch (I2C_ADAP_HWNR) {
        case 0:
                at91_set_pio_value(I2C0_PORT, SDA0_PIN, bit);
                break;
@@ -283,7 +260,7 @@ void iic_sda(int bit)
 
 void iic_scl(int bit)
 {
-       switch ((gd->flags & GD_FLG_RELOC) ? i2c_get_bus_num() : 0) {
+       switch (I2C_ADAP_HWNR) {
        case 0:
                at91_set_pio_value(I2C0_PORT, SCL0_PIN, bit);
                break;