X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=board%2Fdavinci%2Fda8xxevm%2Fda850evm.c;h=37d2f54d3bdd9bbed85ed82622c2a7d24b8b7541;hb=1d2c0506d31a9997e5ffc22e90942902f673b107;hp=0c7aabb13492843a25d6f52260fb0f2b3217e1dc;hpb=5675b509165b67465a20e5cf71e07f40b449ef0c;p=oweals%2Fu-boot.git diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c index 0c7aabb134..37d2f54d3b 100644 --- a/board/davinci/da8xxevm/da850evm.c +++ b/board/davinci/da8xxevm/da850evm.c @@ -6,19 +6,7 @@ * Copyright (C) 2009 Nick Thompson, GE Fanuc, Ltd. * Copyright (C) 2007 Sergey Kubushyn * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -28,15 +16,15 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include #include -#ifdef CONFIG_DAVINCI_MMC +#ifdef CONFIG_MMC_DAVINCI #include #include #endif @@ -157,7 +145,7 @@ int misc_init_r(void) */ if (!enetaddr_found) { if (!spi_mac_read) { - if (is_valid_ether_addr(buff)) { + if (is_valid_ethaddr(buff)) { if (eth_setenv_enetaddr("ethaddr", buff)) { printf("Warning: Failed to " "set MAC address from SPI flash\n"); @@ -172,11 +160,11 @@ int misc_init_r(void) * MAC address present in environment compare it with * the MAC address in SPI flash and warn on mismatch */ - if (!spi_mac_read && is_valid_ether_addr(buff) && - memcmp(env_enetaddr, buff, 6)) + if (!spi_mac_read && is_valid_ethaddr(buff) && + memcmp(env_enetaddr, buff, 6)) printf("Warning: MAC address in SPI flash don't match " "with the MAC address in the environment\n"); - printf("Default using MAC address from environment\n"); + printf("Default using MAC address from environment\n"); } #endif uint8_t enetaddr[8]; @@ -202,14 +190,14 @@ int misc_init_r(void) if (eeprom_mac_read && memcmp(enetaddr, env_enetaddr, 6)) printf("Warning: MAC address in EEPROM don't match " "with the MAC address in the environment\n"); - printf("Default using MAC address from environment\n"); + printf("Default using MAC address from environment\n"); } #endif return 0; } -#ifdef CONFIG_DAVINCI_MMC +#ifdef CONFIG_MMC_DAVINCI static struct davinci_mmc mmc_sd0 = { .reg_base = (struct davinci_mmc_regs *)DAVINCI_MMC_SD0_BASE, .host_caps = MMC_MODE_4BIT, /* DA850 supports only 4-bit SD/MMC */ @@ -231,7 +219,7 @@ static const struct pinmux_config gpio_pins[] = { /* GP0[11] is required for NOR to work on Rev 3 EVMs */ { pinmux(0), 8, 4 }, /* GP0[11] */ #endif -#ifdef CONFIG_DAVINCI_MMC +#ifdef CONFIG_MMC_DAVINCI /* GP0[11] is required for SD to work on Rev 3 EVMs */ { pinmux(0), 8, 4 }, /* GP0[11] */ #endif @@ -262,7 +250,7 @@ const struct pinmux_resource pinmuxes[] = { PINMUX_ITEM(emifa_pins_nor), #endif PINMUX_ITEM(gpio_pins), -#ifdef CONFIG_DAVINCI_MMC +#ifdef CONFIG_MMC_DAVINCI PINMUX_ITEM(mmc0_pins), #endif }; @@ -275,7 +263,7 @@ const struct lpsc_resource lpsc[] = { { DAVINCI_LPSC_EMAC }, /* image download */ { DAVINCI_LPSC_UART2 }, /* console */ { DAVINCI_LPSC_GPIO }, -#ifdef CONFIG_DAVINCI_MMC +#ifdef CONFIG_MMC_DAVINCI { DAVINCI_LPSC_MMC_SD }, #endif }; @@ -335,10 +323,6 @@ int board_early_init_f(void) int board_init(void) { -#if defined(CONFIG_USE_NOR) || defined(CONFIG_DAVINCI_MMC) - u32 val; -#endif - #ifndef CONFIG_USE_IRQ irq_init(); #endif @@ -378,22 +362,18 @@ int board_init(void) #ifdef CONFIG_USE_NOR /* Set the GPIO direction as output */ - clrbits_be32((u32 *)GPIO_BANK0_REG_DIR_ADDR, (0x01 << 11)); + clrbits_le32((u32 *)GPIO_BANK0_REG_DIR_ADDR, (0x01 << 11)); /* Set the output as low */ - val = readl(GPIO_BANK0_REG_SET_ADDR); - val |= (0x01 << 11); - writel(val, GPIO_BANK0_REG_CLR_ADDR); + writel(0x01 << 11, GPIO_BANK0_REG_CLR_ADDR); #endif -#ifdef CONFIG_DAVINCI_MMC +#ifdef CONFIG_MMC_DAVINCI /* Set the GPIO direction as output */ clrbits_le32((u32 *)GPIO_BANK0_REG_DIR_ADDR, (0x01 << 11)); /* Set the output as high */ - val = readl(GPIO_BANK0_REG_SET_ADDR); - val |= (0x01 << 11); - writel(val, GPIO_BANK0_REG_SET_ADDR); + writel(0x01 << 11, GPIO_BANK0_REG_SET_ADDR); #endif #ifdef CONFIG_DRIVER_TI_EMAC