diff options
author | Tom Rini <trini@konsulko.com> | 2019-04-27 10:42:36 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-04-27 10:42:36 -0400 |
commit | 6b8e57338f3c5b65fa5b883fa3f87124f11a9e19 (patch) | |
tree | 222892e528eed7e9785a444e765014fa320bba2b /board/BuR/common/common.c | |
parent | 07b68b7843ad1fa15d63dcd26b5ca5a053fcc27f (diff) | |
parent | fc1fe01b08cedd77a194bb82fa81af4fe1e39031 (diff) |
Merge branch '2019-04-27-master-imports'
- Various vexpress, taurus, da850evm, lpc32xx, brxre1 fixes/updates
- btrfs fixes
- Add AM65x HS EVM
- Other small fixes
Diffstat (limited to 'board/BuR/common/common.c')
-rw-r--r-- | board/BuR/common/common.c | 73 |
1 files changed, 53 insertions, 20 deletions
diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 602c571f9c..89087d7dba 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -10,28 +10,22 @@ */ #include <version.h> #include <common.h> -#include <environment.h> -#include <errno.h> -#include <asm/arch/cpu.h> -#include <asm/arch/hardware.h> -#include <asm/arch/omap.h> -#include <asm/arch/clock.h> -#include <asm/arch/gpio.h> -#include <asm/arch/sys_proto.h> -#include <asm/arch/mmc_host_def.h> -#include <asm/io.h> -#include <asm/gpio.h> +#include <fdtdec.h> #include <i2c.h> -#include <power/tps65217.h> #include <lcd.h> #include "bur_common.h" -#include "../../../drivers/video/am335x-fb.h" DECLARE_GLOBAL_DATA_PTR; /* --------------------------------------------------------------------------*/ #if defined(CONFIG_LCD) && defined(CONFIG_AM335X_LCD) && \ !defined(CONFIG_SPL_BUILD) +#include <asm/arch/hardware.h> +#include <asm/arch/cpu.h> +#include <asm/gpio.h> +#include <power/tps65217.h> +#include "../../../drivers/video/am335x-fb.h" + void lcdbacklight(int on) { unsigned int driver = env_get_ulong("ds1_bright_drv", 16, 0UL); @@ -272,7 +266,51 @@ int ft_board_setup(void *blob, bd_t *bd) return 0; } -#ifdef CONFIG_SPL_BUILD +int brdefaultip_setup(int bus, int chip) +{ + int rc; + struct udevice *i2cdev; + u8 u8buf = 0; + char defip[256] = { 0 }; + + rc = i2c_get_chip_for_busnum(bus, chip, 2, &i2cdev); + if (rc != 0) { + printf("WARN: cannot probe baseboard EEPROM!\n"); + return -1; + } + + rc = dm_i2c_read(i2cdev, 0, &u8buf, 1); + if (rc != 0) { + printf("WARN: cannot read baseboard EEPROM!\n"); + return -1; + } + + if (u8buf != 0xFF) + snprintf(defip, sizeof(defip), + "if test -r ${ipaddr}; then; else setenv ipaddr 192.168.60.%d; setenv serverip 192.168.60.254; setenv gatewayip 192.168.60.254; setenv netmask 255.255.255.0; fi;", + u8buf); + else + strncpy(defip, + "if test -r ${ipaddr}; then; else setenv ipaddr 192.168.60.1; setenv serverip 192.168.60.254; setenv gatewayip 192.168.60.254; setenv netmask 255.255.255.0; fi;", + sizeof(defip)); + + env_set("brdefaultip", defip); + env_set_hex("board_id", u8buf); + + return 0; +} + +int overwrite_console(void) +{ + return 1; +} + +#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_AM33XX) +#include <asm/arch/hardware.h> +#include <asm/arch/omap.h> +#include <asm/arch/clock.h> +#include <asm/arch/sys_proto.h> +#include <power/tps65217.h> static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE; @@ -359,9 +397,4 @@ void set_mux_conf_regs(void) enable_board_pin_mux(); } -#endif /* CONFIG_SPL_BUILD */ - -int overwrite_console(void) -{ - return 1; -} +#endif /* CONFIG_SPL_BUILD && CONFIG_AM33XX */ |