From c7cd4afb923bd54f18bee71993127aca550f2737 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 5 Feb 2019 01:38:41 +0100 Subject: [PATCH 01/25] tpm: simplify: tpm_set_global_lock() When in pack_byte_string() memcpy() is called for size 0 the source buffer address has no relevance. So we can use NULL here. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- lib/tpm-v1.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/tpm-v1.c b/lib/tpm-v1.c index 3e89f845441..b4498e6afc7 100644 --- a/lib/tpm-v1.c +++ b/lib/tpm-v1.c @@ -211,9 +211,7 @@ u32 tpm_nv_write_value(struct udevice *dev, u32 index, const void *data, uint32_t tpm_set_global_lock(struct udevice *dev) { - u32 x; - - return tpm_nv_write_value(dev, TPM_NV_INDEX_0, (uint8_t *)&x, 0); + return tpm_nv_write_value(dev, TPM_NV_INDEX_0, NULL, 0); } u32 tpm_extend(struct udevice *dev, u32 index, const void *in_digest, From 90037d4c73ed704d85485d4fa68a618d4db2b12a Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 5 Feb 2019 18:06:24 +0100 Subject: [PATCH 02/25] dm: scsi: report correct device number Before the patch scsi would report the same device number for all SCSI devices, e.g. Device 0: (1:0) Vendor: ATA Prod.: Crucial_CT128M55 Rev: MU01 Type: Hard Disk Capacity: 122104.3 MB = 119.2 GB (250069680 x 512) Device 0: (1:0) Vendor: ATA Prod.: Rev: Type: Hard Disk Capacity: not available With the patch the same device number is reported as is used in scsi_read(): Device 0: (1:0) Vendor: ATA Prod.: Crucial_CT128M55 Rev: MU01 Type: Hard Disk Capacity: 122104.3 MB = 119.2 GB (250069680 x 512) Device 1: (1:0) Vendor: ATA Prod.: Rev: Type: Hard Disk Capacity: not available Signed-off-by: Heinrich Schuchardt --- drivers/scsi/scsi.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index df47e2fc78b..75900d82283 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -594,7 +594,7 @@ static int do_scsi_scan_one(struct udevice *dev, int id, int lun, bool verbose) memcpy(&bdesc->revision, &bd.revision, sizeof(bd.revision)); if (verbose) { - printf(" Device %d: ", 0); + printf(" Device %d: ", bdesc->devnum); dev_print(bdesc); } return 0; @@ -659,15 +659,16 @@ int scsi_scan(bool verbose) scsi_max_devs = 0; for (i = 0; i < CONFIG_SYS_SCSI_MAX_SCSI_ID; i++) { for (lun = 0; lun < CONFIG_SYS_SCSI_MAX_LUN; lun++) { - ret = scsi_detect_dev(NULL, i, lun, - &scsi_dev_desc[scsi_max_devs]); + struct blk_desc *bdesc = &scsi_dev_desc[scsi_max_devs]; + + ret = scsi_detect_dev(NULL, i, lun, bdesc); if (ret) continue; - part_init(&scsi_dev_desc[scsi_max_devs]); + part_init(bdesc); if (verbose) { - printf(" Device %d: ", 0); - dev_print(&scsi_dev_desc[scsi_max_devs]); + printf(" Device %d: ", bdesc->devnum); + dev_print(bdesc); } scsi_max_devs++; } /* next LUN */ From eaba7df7041ebdd6cff3702d87d6bdb6870ec5e3 Mon Sep 17 00:00:00 2001 From: Hannes Schmelzer Date: Wed, 6 Feb 2019 13:25:59 +0100 Subject: [PATCH 03/25] board/BuR/brxre1: convert do DM This commit converts the brxre1 board to DM, for this we have todo following things: - add a devicetree-file for this board - drop all obsolete settings from board header-file - use dm_i2c_xxx calls for read/write to the resetcontroller - request gpios before operate them Serues-cc: trini@konsulko.com Signed-off-by: Hannes Schmelzer --- arch/arm/dts/am335x-brxre1.dts | 371 +++++++++++++++++++++++++++++++++ board/BuR/brxre1/MAINTAINERS | 1 + board/BuR/brxre1/board.c | 77 ++++--- board/BuR/common/common.c | 7 + configs/brxre1_defconfig | 52 +++-- include/configs/brxre1.h | 16 +- 6 files changed, 463 insertions(+), 61 deletions(-) create mode 100644 arch/arm/dts/am335x-brxre1.dts diff --git a/arch/arm/dts/am335x-brxre1.dts b/arch/arm/dts/am335x-brxre1.dts new file mode 100644 index 00000000000..708407daf2e --- /dev/null +++ b/arch/arm/dts/am335x-brxre1.dts @@ -0,0 +1,371 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 B&R Industrial Automation GmbH + * http://www.br-automation.com + * + */ +/dts-v1/; + +#include "am33xx.dtsi" + +/ { + model = "BRXRE1 Panel"; + compatible = "ti,am33xx"; + + fset: factory-settings { + bl-version = " "; + order-no = " "; + cpu-order-no = " "; + hw-revision = " "; + serial-no = <0>; + device-id = <0xE681>; + parent-id = <0xE681>; + hw-variant = <0x3>; + hw-platform = <0x0>; + fram-offset = <0x1000>; + fram-size = <0x3000>; + cache-disable = <0x0>; + cpu-clock = <0x0>; + }; + chosen { + #address-cells = <1>; + #size-cells = <1>; + + bootargs = "console=ttyO0,115200 earlyprintk"; + stdout-path = &uart0; + + framebuffer: framebuffer@8fbe0000 { + display = <&lcdscreen0>; + compatible = "simple-framebuffer"; + status = "okay"; + reg = <0x8fbef000 (1024 * 600 * 4)>; + width = <1024>; + height = <600>; + stride = <(1024 * 4)>; + format = "a8r8g8b8"; + clocks = <&dpll_disp_m2_ck>, <&dpll_per_m2_ck>; + }; + }; + + aliases { + fset = &fset; + mmc = &mmc2; + spi0 = &spi0; + spi1 = &spi1; + touch0 = &burtouch0; + screen0 = &lcdscreen0; + }; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; /* 256 MB */ + }; + + panel { + compatible = "ti,tilcdc,panel"; + status = "okay"; + }; + + vmmcsd_fixed: fixedregulator@0 { + compatible = "regulator-fixed"; + regulator-name = "vmmcsd_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + lcdscreen0: lcdscreen@0 { + status = "okay"; + compatible = "ti,tilcdc,panel"; + + backlight = <&tps_bl>; + + panel-info { + ac-bias = <255>; + ac-bias-intrpt = <0>; + dma-burst-sz = <16>; + bpp = <32>; + fdd = <0x80>; + sync-edge = <0>; + sync-ctrl = <1>; + raster-order = <0>; + fifo-th = <0>; + }; + + display-timings { + native-mode = <&timing0>; + timing0: lcd { + clock-frequency = <9142857>; + hactive = <480>; + vactive = <272>; + hfront-porch = <8>; + hback-porch = <43>; + hsync-len = <2>; + vfront-porch = <4>; + vback-porch = <2>; + vsync-len = <10>; + hsync-active = <1>; + vsync-active = <1>; + pupdelay = <10>; + pondelay = <10>; + }; + }; + }; +}; + +&uart0 { /* console uart */ + u-boot,dm-spl; + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&uart3 { + status = "okay"; +}; + +&uart4 { + status = "okay"; +}; + +&i2c0 { + u-boot,dm-spl; + status = "okay"; + clock-frequency = <100000>; + + tps: tps@24 { /* PMIC controller */ + u-boot,dm-spl; + reg = <0x24>; + compatible = "ti,tps65217"; + + tps_bl: backlight { + compatible = "ti,tps65217-bl"; + isel = <1>; /* 1 - ISET1, 2 ISET2 */ + fdim = <1000>; /* TPS65217_BL_FDIM_1kHZ */ + default-brightness = <50>; + }; + }; + resetc: rstpsc@75 { /* reset controller */ + compatible = "bur,rstpsc"; + reg = <0x75>; + + cooling-min-state = <0>; + cooling-max-state = <1>; /* reset gets fired */ + #cooling-cells = <2>; /* min followed by max */ + }; + rtc0: rv3029c2@56 { + status = "okay"; + #thermal-sensor-cells = <0>; + compatible = "rv3029c2"; + reg = <0x56>; + }; +}; + +&spi0 { + status = "okay"; +}; + +&spi1 { + status = "okay"; +}; + +&edma { + status = "okay"; +}; + +&cppi41dma { + status = "okay"; +}; + +&usb { + status = "okay"; +}; + +&usb_ctrl_mod { + status = "okay"; +}; + +&usb0_phy { + status = "okay"; +}; + +&usb1_phy { + status = "okay"; +}; + +&usb0 { + status = "okay"; + dr_mode = "host"; +}; + +&usb1 { + status = "okay"; + dr_mode = "host"; +}; + +&davinci_mdio { + status = "okay"; +}; + +&mac { + status = "okay"; +}; + +&cpsw_emac0 { + phy_id = <&davinci_mdio>, <1>; + phy-mode = "mii"; +}; + +&cpsw_emac1 { + phy_id = <&davinci_mdio>, <2>; + phy-mode = "mii"; +}; + +&mmc1 { + u-boot,dm-pre-reloc; + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <0x4>; + ti,non-removable; + ti,needs-special-hs-handling; + ti,vcc-aux-disable-is-sleep; + status = "okay"; +}; + +&mmc2 { + u-boot,dm-pre-reloc; + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <0x8>; + ti,non-removable; + ti,needs-special-hs-handling; + ti,vcc-aux-disable-is-sleep; + status = "okay"; +}; + +&lcdc { + status = "okay"; + ti,no-reset-on-init; + ti,no-idle-on-init; +}; + +&elm { + status = "okay"; +}; + +&sham { + status = "okay"; +}; + +&aes { + status = "okay"; +}; + +&gpio0 { + u-boot,dm-spl; + ti,no-reset-on-init; +}; + +&gpio1 { + u-boot,dm-spl; + ti,no-reset-on-init; +}; + +&gpio2 { + u-boot,dm-spl; + ti,no-reset-on-init; +}; + +&gpio3 { + u-boot,dm-spl; + ti,no-reset-on-init; +}; + +&timer1 { /* today unused */ + status = "okay"; + ti,no-reset-on-init; + ti,no-idle-on-init; +}; + +&timer2 { /* used for vxworks primary timer device */ + status = "okay"; + ti,no-reset-on-init; + ti,no-idle-on-init; +}; + +&timer3 { /* used sysdelay and hal tsc counter*/ + status = "okay"; + ti,no-reset-on-init; + ti,no-idle-on-init; +}; + +&timer4 { /* used for PWM beeper */ + status = "okay"; + ti,no-reset-on-init; + ti,no-idle-on-init; +}; + +&timer5 { /* used for PWM backlight */ + status = "okay"; + ti,no-reset-on-init; + ti,no-idle-on-init; +}; + +&timer6 { /* used for cpsw end device */ + status = "okay"; + ti,no-reset-on-init; + ti,no-idle-on-init; +}; + +&timer7 { /* used for cpsw end device */ + status = "okay"; + ti,no-reset-on-init; + ti,no-idle-on-init; +}; + +&wdt2 { + status = "okay"; + ti,no-reset-on-init; + ti,no-idle-on-init; +}; + +&epwmss0 { + status = "okay"; +}; + +&tscadc { + status = "okay"; + + tsc { + burtouch0: burtouch@0 { + status = "okay"; + compatible = "bur,DdVxSfTouchXXX"; + bur,hwtree = "IF7"; + bur,KX0 = <0x0>; + bur,KX1 = <0x0>; + bur,KX2 = <0x0>; + bur,KY0 = <0x0>; + bur,KY1 = <0x0>; + bur,KY2 = <0x0>; + }; + }; +}; + +&dcan0 { + status = "okay"; +}; + +&dcan1 { + status = "okay"; +}; + +&sham { + status = "disabled"; +}; + +&aes { + status = "disabled"; +}; + +&rng { + status = "disabled"; +}; diff --git a/board/BuR/brxre1/MAINTAINERS b/board/BuR/brxre1/MAINTAINERS index a10d9c1d714..eb0fe8b2838 100644 --- a/board/BuR/brxre1/MAINTAINERS +++ b/board/BuR/brxre1/MAINTAINERS @@ -4,3 +4,4 @@ S: Maintained F: board/BuR/brxre1/ F: include/configs/brxre1.h F: configs/brxre1_defconfig +F: arch/arm/dts/am335x-brxre1.dts diff --git a/board/BuR/brxre1/board.c b/board/BuR/brxre1/board.c index 82c53d5bc2b..2d0ed41ddee 100644 --- a/board/BuR/brxre1/board.c +++ b/board/BuR/brxre1/board.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include "../common/bur_common.h" @@ -48,6 +49,25 @@ DECLARE_GLOBAL_DATA_PTR; +static int rstctrl_rw(u8 reg, unsigned char rnw, void *pdat, int size) +{ + struct udevice *i2cdev; + int rc; + + rc = i2c_get_chip_for_busnum(0, RSTCTRL_ADDR, 1, &i2cdev); + if (rc >= 0) { + if (rnw) + rc = dm_i2c_read(i2cdev, reg, pdat, size); + else + rc = dm_i2c_write(i2cdev, reg, pdat, size); + } else { + printf("%s: cannot get udevice for chip 0x%02x!\n", + __func__, RSTCTRL_ADDR); + } + + return rc; +} + #if defined(CONFIG_SPL_BUILD) /* TODO: check ram-timing ! */ static const struct ddr_data ddr3_data = { @@ -89,8 +109,8 @@ const struct dpll_params dpll_ddr3 = { 400, OSC-1, 1, -1, -1, -1, -1}; void am33xx_spl_board_init(void) { - unsigned int oldspeed; unsigned short buf; + int rc; struct cm_perpll *const cmper = (struct cm_perpll *)CM_PER; struct cm_wkuppll *const cmwkup = (struct cm_wkuppll *)CM_WKUP; @@ -114,23 +134,19 @@ void am33xx_spl_board_init(void) }; do_enable_clocks(clk_domains, clk_modules_xre1specific, 1); /* power-OFF LCD-Display */ - gpio_direction_output(LCD_PWR, 0); + if (gpio_request(LCD_PWR, "LCD_PWR") != 0) + printf("cannot request gpio for LCD_PWR!\n"); + else if (gpio_direction_output(LCD_PWR, 0) != 0) + printf("cannot set direction output on LCD_PWR!\n"); /* setup I2C */ enable_i2c_pin_mux(); - i2c_set_bus_num(0); - i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); - /* power-ON 3V3 via Resetcontroller */ - oldspeed = i2c_get_bus_speed(); - if (i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC) >= 0) { - buf = RSTCTRL_FORCE_PWR_NEN | RSTCTRL_CAN_STB; - i2c_write(RSTCTRL_ADDR, RSTCTRL_CTRLREG, 1, - (uint8_t *)&buf, sizeof(buf)); - i2c_set_bus_speed(oldspeed); - } else { - puts("ERROR: i2c_set_bus_speed failed! (turn on PWR_nEN)\n"); - } + /* power-ON 3V3 via Resetcontroller */ + buf = RSTCTRL_FORCE_PWR_NEN | RSTCTRL_CAN_STB; + rc = rstctrl_rw(RSTCTRL_CTRLREG, 0, (uint8_t *)&buf, sizeof(buf)); + if (rc != 0) + printf("ERROR: cannot write to resetc (turn on PWR_nEN)\n"); pmicsetup(0, 0); } @@ -153,7 +169,9 @@ void sdram_init(void) */ int board_init(void) { - gpmc_init(); + if (power_tps65217_init(0)) + printf("WARN: cannot setup PMIC 0x24 @ bus #0, not found!.\n"); + return 0; } @@ -164,19 +182,16 @@ int board_late_init(void) unsigned int cnt = 3; unsigned short buf = 0xAAAA; unsigned char scratchreg = 0; - unsigned int oldspeed; + int rc; /* try to read out some boot-instruction from resetcontroller */ - oldspeed = i2c_get_bus_speed(); - if (i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC) >= 0) { - i2c_read(RSTCTRL_ADDR, RSTCTRL_SCRATCHREG, 1, - &scratchreg, sizeof(scratchreg)); - i2c_set_bus_speed(oldspeed); - } else { - puts("ERROR: i2c_set_bus_speed failed! (scratchregister)\n"); - } + rc = rstctrl_rw(RSTCTRL_SCRATCHREG, 1, &scratchreg, sizeof(scratchreg)); + if (rc != 0) + printf("ERROR: read scratchregister (resetc) failed!\n"); - if (gpio_get_value(ESC_KEY)) { + if (gpio_request(ESC_KEY, "boot-key") != 0) { + printf("cannot request boot-key!\n"); + } else if (gpio_get_value(ESC_KEY)) { do { lcd_position_cursor(1, 8); switch (cnt) { @@ -266,14 +281,10 @@ int board_late_init(void) break; } /* write bootinfo into scratchregister of resetcontroller */ - oldspeed = i2c_get_bus_speed(); - if (i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC) >= 0) { - i2c_write(RSTCTRL_ADDR, RSTCTRL_SCRATCHREG, 1, - (uint8_t *)&buf, sizeof(buf)); - i2c_set_bus_speed(oldspeed); - } else { - puts("ERROR: i2c_set_bus_speed failed! (scratchregister)\n"); - } + rc = rstctrl_rw(RSTCTRL_SCRATCHREG, 0, (uint8_t *)&buf, sizeof(buf)); + if (rc != 0) + printf("ERROR: write scratchregister (resetc) failed!\n"); + /* setup othbootargs for bootvx-command (vxWorks bootline) */ char othbootargs[128]; snprintf(othbootargs, sizeof(othbootargs), diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index a1f7c44abfe..602c571f9ce 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -181,6 +181,7 @@ void br_summaryscreen(void) void lcdpower(int on) { u32 pin, swval, i; + char buf[16] = { 0 }; pin = env_get_ulong("ds1_pwr", 16, ~0UL); @@ -191,6 +192,12 @@ void lcdpower(int on) for (i = 0; i < 3; i++) { if (pin != 0) { + snprintf(buf, sizeof(buf), "ds1_pwr#%d", i); + if (gpio_request(pin & 0x7F, buf) != 0) { + printf("%s: not able to request gpio %s", + __func__, buf); + continue; + } swval = pin & 0x80 ? 0 : 1; if (on) gpio_direction_output(pin & 0x7F, swval); diff --git a/configs/brxre1_defconfig b/configs/brxre1_defconfig index c56a633292d..120f2873876 100644 --- a/configs/brxre1_defconfig +++ b/configs/brxre1_defconfig @@ -3,64 +3,88 @@ CONFIG_ARCH_OMAP2PLUS=y CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_AM33XX=y +CONFIG_SYS_MPUCLK=1000 CONFIG_TARGET_BRXRE1=y CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_SPL_SYS_MALLOC_F_LEN=0x4000 CONFIG_SPL=y -CONFIG_NR_DRAM_BANKS=1 -CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=1" -CONFIG_BOOTDELAY=-2 -# CONFIG_CONSOLE_MUX is not set -CONFIG_SYS_CONSOLE_IS_IN_ENV=y +CONFIG_TPL_SYS_MALLOC_F_LEN=0x0 +# CONFIG_EXPERT is not set +# CONFIG_FIT is not set +CONFIG_OF_BOARD_SETUP=y +CONFIG_BOOTDELAY=0 +CONFIG_USE_BOOTCOMMAND=y +CONFIG_BOOTCOMMAND="mmc dev 1; run b_default" CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_ARCH_MISC_INIT=y +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_SEPARATE_BSS=y +# CONFIG_TPL_BANNER_PRINT is not set CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_NAND_SUPPORT is not set CONFIG_SPL_POWER_SUPPORT=y CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_HUSH_PARSER=y # CONFIG_CMD_BOOTD is not set -# CONFIG_CMD_BOOTM is not set CONFIG_CMD_BOOTZ=y -# CONFIG_CMD_GO is not set # CONFIG_CMD_IMI is not set # CONFIG_CMD_XIMG is not set # CONFIG_CMD_EDITENV is not set # CONFIG_CMD_CRC32 is not set -CONFIG_CMD_UNZIP=y +CONFIG_CMD_DM=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y -# CONFIG_CMD_LOADB is not set # CONFIG_CMD_LOADS is not set CONFIG_CMD_MMC=y +CONFIG_CMD_PART=y CONFIG_CMD_USB=y # CONFIG_CMD_ITEST is not set -# CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=y # CONFIG_CMD_NFS is not set +CONFIG_CMD_MII=y CONFIG_CMD_PING=y -CONFIG_CMD_BMP=y CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y +# CONFIG_SPL_DOS_PARTITION is not set +CONFIG_OF_CONTROL=y +CONFIG_SPL_OF_CONTROL=y +CONFIG_DEFAULT_DEVICE_TREE="am335x-brxre1" +CONFIG_OF_SPL_REMOVE_PROPS="" CONFIG_ENV_IS_IN_MMC=y +CONFIG_NET_RANDOM_ETHADDR=y CONFIG_NETCONSOLE=y +CONFIG_DM=y +CONFIG_SPL_DM=y +CONFIG_SPL_DM_SEQ_ALIAS=y +# CONFIG_OF_TRANSLATE is not set +CONFIG_DM_GPIO=y +CONFIG_DM_I2C=y +CONFIG_MISC=y +CONFIG_DM_MMC=y CONFIG_MMC_OMAP_HS=y +CONFIG_DM_ETH=y CONFIG_DRIVER_TI_CPSW=y -CONFIG_SYS_NS16550=y +CONFIG_DM_SERIAL=y CONFIG_USB=y +CONFIG_DM_USB=y CONFIG_USB_MUSB_HOST=y +CONFIG_USB_MUSB_GADGET=y +CONFIG_USB_MUSB_TI=y CONFIG_USB_MUSB_DSPS=y CONFIG_USB_STORAGE=y +CONFIG_USB_GADGET=y CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_LCD=y # CONFIG_OMAP_WATCHDOG is not set -CONFIG_FAT_WRITE=y -CONFIG_OF_LIBFDT=y +CONFIG_SPL_TINY_MEMSET=y +# CONFIG_OF_LIBFDT_OVERLAY is not set # CONFIG_EFI_LOADER is not set diff --git a/include/configs/brxre1.h b/include/configs/brxre1.h index f78a4e10a99..601b30dffd5 100644 --- a/include/configs/brxre1.h +++ b/include/configs/brxre1.h @@ -24,17 +24,7 @@ #define V_OSCK 26000000 /* Clock output from T2 */ #define V_SCLK (V_OSCK) -#define CONFIG_POWER_TPS65217 - #define CONFIG_MACH_TYPE 3589 -/* I2C IP block */ -#define CONFIG_SYS_OMAP24_I2C_SPEED_PSOC 20000 - -/* MMC/SD IP block */ -#define CONFIG_SUPPORT_EMMC_BOOT - -/* Always 64 KiB env size */ -#define CONFIG_ENV_SIZE (64 << 10) #ifndef CONFIG_SPL_BUILD @@ -80,13 +70,11 @@ BUR_COMMON_ENV \ /* USB configuration */ #define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT -#define CONFIG_AM335X_USB0 -#define CONFIG_AM335X_USB0_MODE MUSB_HOST -#define CONFIG_AM335X_USB1 -#define CONFIG_AM335X_USB1_MODE MUSB_HOST +/* Environment */ #define CONFIG_SYS_MMC_ENV_DEV 1 #define CONFIG_SYS_MMC_ENV_PART 2 +#define CONFIG_ENV_SIZE 0x10000 #define CONFIG_ENV_OFFSET 0x40000 /* TODO: Adresse definieren */ #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) #define CONFIG_SYS_REDUNDAND_ENVIRONMENT From 957f51e86367e14be9e40cfe5cc3a494fc17abcf Mon Sep 17 00:00:00 2001 From: Kurban Mallachiev Date: Thu, 7 Feb 2019 14:19:45 +0300 Subject: [PATCH 04/25] elf: fix cache flushing in 'bootelf -p' command Currently there are two problems in 'bootelf -p' (load elf by segments) command: - bss section is not flushed, so booted elf can have non zero values in bss; - at least on ARM there are 'CACHE: Misaligned operation at range...' warnings Use p_memsz instead of p_filesz during cache flushing for elf segment. p_filesz doesn't include zero initialized memory (e.g. bss section), which also should be flushed. Align these cache flushes to line boundaries. Signed-off-by: Kurban Mallachiev --- cmd/elf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/elf.c b/cmd/elf.c index 7bad1f80d42..d883be41931 100644 --- a/cmd/elf.c +++ b/cmd/elf.c @@ -53,7 +53,8 @@ static unsigned long load_elf64_image_phdr(unsigned long addr) if (phdr->p_filesz != phdr->p_memsz) memset(dst + phdr->p_filesz, 0x00, phdr->p_memsz - phdr->p_filesz); - flush_cache((unsigned long)dst, phdr->p_filesz); + flush_cache(rounddown((unsigned long)dst, ARCH_DMA_MINALIGN), + roundup(phdr->p_memsz, ARCH_DMA_MINALIGN)); ++phdr; } @@ -167,7 +168,8 @@ static unsigned long load_elf_image_phdr(unsigned long addr) if (phdr->p_filesz != phdr->p_memsz) memset(dst + phdr->p_filesz, 0x00, phdr->p_memsz - phdr->p_filesz); - flush_cache((unsigned long)dst, phdr->p_filesz); + flush_cache(rounddown((unsigned long)dst, ARCH_DMA_MINALIGN), + roundup(phdr->p_memsz, ARCH_DMA_MINALIGN)); ++phdr; } From 44ac80e7e90ff1c6630b64b3babe03cc6bdef46a Mon Sep 17 00:00:00 2001 From: Roman Kapl Date: Fri, 8 Feb 2019 10:01:02 +0100 Subject: [PATCH 05/25] cmd: date: Do not overwrite arguments Arguments are const and belong to the caller. Calling date in a hush loop will yield different results from the second invocation. Signed-off-by: Roman Kapl --- cmd/date.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/date.c b/cmd/date.c index 1115b6c8d67..7fa950a9026 100644 --- a/cmd/date.c +++ b/cmd/date.c @@ -159,18 +159,18 @@ int mk_date (const char *datestr, struct rtc_time *tmp) int len, val; char *ptr; - ptr = strchr (datestr,'.'); - len = strlen (datestr); + ptr = strchr(datestr, '.'); + len = strlen(datestr); /* Set seconds */ if (ptr) { int sec; - *ptr++ = '\0'; + ptr++; if ((len - (ptr - datestr)) != 2) return (-1); - len = strlen (datestr); + len -= 3; if (cnvrt2 (ptr, &sec)) return (-1); From 8502fe84a4fc1eb5610b1dbb102ff11b02aee25f Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Fri, 8 Feb 2019 11:01:37 -0600 Subject: [PATCH 06/25] configs: am57xx_evm: define CONFIG_SPL_LOAD_FIT_ADDRESS for SPL-DFU Define CONFIG_SPL_LOAD_FIT_ADDRESS to enable SPL-DFU for am57x platform. Signed-off-by: Bin Liu --- include/configs/am57xx_evm.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h index d61fdf9f7a3..70aa4250605 100644 --- a/include/configs/am57xx_evm.h +++ b/include/configs/am57xx_evm.h @@ -35,11 +35,22 @@ #define CONFIG_SYS_OMAP_ABE_SYSCK +#ifdef CONFIG_SPL_DFU +#ifndef CONFIG_SPL_BUILD #define DFUARGS \ "dfu_bufsiz=0x10000\0" \ DFU_ALT_INFO_MMC \ DFU_ALT_INFO_EMMC \ DFU_ALT_INFO_RAM \ + DFU_ALT_INFO_QSPI +#else +#undef CONFIG_CMD_BOOTD +#define CONFIG_SPL_LOAD_FIT_ADDRESS 0x80200000 +#define DFUARGS \ + "dfu_bufsiz=0x10000\0" \ + DFU_ALT_INFO_RAM +#endif +#endif #include From dae5c2dcdc2bc826a4ee0a58b08fd004b6259373 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Sun, 10 Feb 2019 21:34:37 +0100 Subject: [PATCH 07/25] spl: implement CRC check on U-Boot uImage SPL currently does not check uImage CRCs when loading U-Boot. This patch adds checking the uImage CRC when SPL loads U-Boot. It does this by reusing the existing config option SPL_CRC32_SUPPORT to allow leaving out the CRC check on boards where the additional code size or boot time is a problem (adding the CRC check currently adds ~1.4 kByte to flash). The SPL_CRC32_SUPPORT config option now gets enabled by default if SPL support for legacy images is enabled to check the CRC on all boards that don't actively take countermeasures. Signed-off-by: Simon Goldschmidt Reviewed-by: Simon Glass --- common/spl/Kconfig | 22 ++++++++++++++++------ common/spl/spl.c | 30 +++++++++++++++++++++++++++++- include/spl.h | 5 +++++ 3 files changed, 50 insertions(+), 7 deletions(-) diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 85edd5a61f8..206c24076da 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -100,6 +100,16 @@ config SPL_LEGACY_IMAGE_SUPPORT is y. If this is not set, SPL will move on to other available boot media to find a suitable image. +config SPL_LEGACY_IMAGE_CRC_CHECK + bool "Check CRC of Legacy images" + depends on SPL_LEGACY_IMAGE_SUPPORT + select SPL_CRC32_SUPPORT + help + Enable this to check the CRC of Legacy images. While this increases + reliability, it affects both code size and boot duration. + If disabled, Legacy images are booted if the image magic and size + are correct, without further integrity checks. + config SPL_SYS_MALLOC_SIMPLE bool prompt "Only use malloc_simple functions in the SPL" @@ -236,13 +246,13 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE config SPL_CRC32_SUPPORT bool "Support CRC32" - depends on SPL_FIT + default y if SPL_LEGACY_IMAGE_SUPPORT help - Enable this to support CRC32 in FIT images within SPL. This is a - 32-bit checksum value that can be used to verify images. This is - the least secure type of checksum, suitable for detected - accidental image corruption. For secure applications you should - consider SHA1 or SHA256. + Enable this to support CRC32 in uImages or FIT images within SPL. + This is a 32-bit checksum value that can be used to verify images. + For FIT images, this is the least secure type of checksum, suitable + for detected accidental image corruption. For secure applications you + should consider SHA1 or SHA256. config SPL_MD5_SUPPORT bool "Support MD5" diff --git a/common/spl/spl.c b/common/spl/spl.c index 35120b6efd1..2e2af1b28ee 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -239,6 +239,14 @@ int spl_parse_image_header(struct spl_image_info *spl_image, #ifdef CONFIG_SPL_LEGACY_IMAGE_SUPPORT u32 header_size = sizeof(struct image_header); +#ifdef CONFIG_SPL_LEGACY_IMAGE_CRC_CHECK + /* check uImage header CRC */ + if (!image_check_hcrc(header)) { + puts("SPL: Image header CRC check failed!\n"); + return -EINVAL; + } +#endif + if (spl_image->flags & SPL_COPY_PAYLOAD_ONLY) { /* * On some system (e.g. powerpc), the load-address and @@ -256,6 +264,13 @@ int spl_parse_image_header(struct spl_image_info *spl_image, spl_image->size = image_get_data_size(header) + header_size; } +#ifdef CONFIG_SPL_LEGACY_IMAGE_CRC_CHECK + /* store uImage data length and CRC to check later */ + spl_image->dcrc_data = image_get_load(header); + spl_image->dcrc_length = image_get_data_size(header); + spl_image->dcrc = image_get_dcrc(header); +#endif + spl_image->os = image_get_os(header); spl_image->name = image_get_name(header); debug(SPL_TPL_PROMPT @@ -495,12 +510,25 @@ static struct spl_image_loader *spl_ll_find_loader(uint boot_device) static int spl_load_image(struct spl_image_info *spl_image, struct spl_image_loader *loader) { + int ret; struct spl_boot_device bootdev; bootdev.boot_device = loader->boot_device; bootdev.boot_device_name = NULL; - return loader->load_image(spl_image, &bootdev); + ret = loader->load_image(spl_image, &bootdev); +#ifdef CONFIG_SPL_LEGACY_IMAGE_CRC_CHECK + if (!ret && spl_image->dcrc_length) { + /* check data crc */ + ulong dcrc = crc32_wd(0, (unsigned char *)spl_image->dcrc_data, + spl_image->dcrc_length, CHUNKSZ_CRC32); + if (dcrc != spl_image->dcrc) { + puts("SPL: Image data CRC check failed!\n"); + ret = -EINVAL; + } + } +#endif + return ret; } /** diff --git a/include/spl.h b/include/spl.h index c82f2fd0336..f09909e189b 100644 --- a/include/spl.h +++ b/include/spl.h @@ -74,6 +74,11 @@ struct spl_image_info { u32 size; u32 flags; void *arg; +#ifdef CONFIG_SPL_LEGACY_IMAGE_CRC_CHECK + ulong dcrc_data; + ulong dcrc_length; + ulong dcrc; +#endif }; /* From 8537874a6585251843f462c16b1684d38c887996 Mon Sep 17 00:00:00 2001 From: Tien Fong Chee Date: Mon, 11 Feb 2019 14:56:19 +0800 Subject: [PATCH 08/25] fs: fat: dynamically allocate memory for temporary buffer Drop the statically allocated get_contents_vfatname_block and dynamically allocate a buffer only if required. This saves 64KiB of memory. Signed-off-by: Stefan Agner Signed-off-by: Tien Fong Chee --- fs/fat/fat.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/fs/fat/fat.c b/fs/fat/fat.c index dac86ea5163..f593e989ff0 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -306,9 +306,6 @@ get_cluster(fsdata *mydata, __u32 clustnum, __u8 *buffer, unsigned long size) * into 'buffer'. * Update the number of bytes read in *gotsize or return -1 on fatal errors. */ -__u8 get_contents_vfatname_block[MAX_CLUSTSIZE] - __aligned(ARCH_DMA_MINALIGN); - static int get_contents(fsdata *mydata, dir_entry *dentptr, loff_t pos, __u8 *buffer, loff_t maxsize, loff_t *gotsize) { @@ -351,15 +348,24 @@ static int get_contents(fsdata *mydata, dir_entry *dentptr, loff_t pos, /* align to beginning of next cluster if any */ if (pos) { + __u8 *tmp_buffer; + actsize = min(filesize, (loff_t)bytesperclust); - if (get_cluster(mydata, curclust, get_contents_vfatname_block, - (int)actsize) != 0) { + tmp_buffer = malloc_cache_aligned(actsize); + if (!tmp_buffer) { + debug("Error: allocating buffer\n"); + return -ENOMEM; + } + + if (get_cluster(mydata, curclust, tmp_buffer, actsize) != 0) { printf("Error reading cluster\n"); + free(tmp_buffer); return -1; } filesize -= actsize; actsize -= pos; - memcpy(buffer, get_contents_vfatname_block + pos, actsize); + memcpy(buffer, tmp_buffer + pos, actsize); + free(tmp_buffer); *gotsize += actsize; if (!filesize) return 0; From e48485f5e4f99811ba41e89f782a3f282f3c5a2e Mon Sep 17 00:00:00 2001 From: Tien Fong Chee Date: Mon, 11 Feb 2019 14:56:20 +0800 Subject: [PATCH 09/25] fs: fat: Reduce default max clustersize 64KiB from malloc pool Release cluster block immediately when no longer use would help to reduce 64KiB memory allocated to the memory pool. Signed-off-by: Tien Fong Chee --- fs/fat/fat.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/fat/fat.c b/fs/fat/fat.c index f593e989ff0..6ade4ea54ec 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -1148,7 +1148,15 @@ int file_fat_read_at(const char *filename, loff_t pos, void *buffer, goto out_free_both; debug("reading %s at pos %llu\n", filename, pos); - ret = get_contents(&fsdata, itr->dent, pos, buffer, maxsize, actread); + + /* For saving default max clustersize memory allocated to malloc pool */ + dir_entry *dentptr = itr->dent; + + free(itr); + + itr = NULL; + + ret = get_contents(&fsdata, dentptr, pos, buffer, maxsize, actread); out_free_both: free(fsdata.fatbuf); From 1e7883f6325ae1cba2a92fcdf06d892f475fc5d2 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 11 Feb 2019 14:51:02 +0100 Subject: [PATCH 10/25] dtbo: Fix dtbo generation rules Take the first prerequisite (dts overlay file) instead of standard input. Signed-off-by: Michal Simek --- scripts/Makefile.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 66e5015d8d7..704d644f6fa 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -317,7 +317,7 @@ quiet_cmd_dtco = DTCO $@ # No generation of assembly file either # Modified for U-Boot cmd_dtco = mkdir -p $(dir ${dtc-tmp}) ; \ - $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ + $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ $(DTC) -@ -O dtb -o $@ -b 0 \ -i $(dir $<) $(DTC_FLAGS) \ -d $(depfile).dtc.tmp $(dtc-tmp) ; \ From 4ebcb16b51589f6eb88d698f81a314f064db6487 Mon Sep 17 00:00:00 2001 From: Philippe Reynes Date: Mon, 11 Feb 2019 15:56:14 +0100 Subject: [PATCH 11/25] bcm963158: use TARGET_BCM963158 instead of ARCH_BCM63158 We use TARGET_BCM63158 in the Kconfig instead of ARCH_BCM63158, so we could add other board that use a bcm63158. Signed-off-by: Philippe Reynes --- board/broadcom/bcm963158/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/broadcom/bcm963158/Kconfig b/board/broadcom/bcm963158/Kconfig index 41b6adbb802..08a8bc1c14d 100644 --- a/board/broadcom/bcm963158/Kconfig +++ b/board/broadcom/bcm963158/Kconfig @@ -1,4 +1,4 @@ -if ARCH_BCM63158 +if TARGET_BCM963158 config SYS_VENDOR default "broadcom" From 7374b15522b94d39108da6233b60ffbf30632678 Mon Sep 17 00:00:00 2001 From: Igor Opaniuk Date: Tue, 12 Feb 2019 16:18:14 +0200 Subject: [PATCH 12/25] test: let use gdbserver for all sandbox targets Enable usage of gdbserver for all sandbox targets (sandbox, sandbox_flattree etc.). Signed-off-by: Igor Opaniuk Reviewed-by: Tom Rini Reviewed-by: Simon Glass --- test/py/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/py/conftest.py b/test/py/conftest.py index 5c658b8c484..e40cbf0ba12 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -117,8 +117,8 @@ def pytest_configure(config): mkdir_p(persistent_data_dir) gdbserver = config.getoption('gdbserver') - if gdbserver and board_type != 'sandbox': - raise Exception('--gdbserver only supported with sandbox') + if gdbserver and not board_type.startswith('sandbox'): + raise Exception('--gdbserver only supported with sandbox targets') import multiplexed_log log = multiplexed_log.Logfile(result_dir + '/test-log.html') From 362d00dfff049603ada5e0257943f0d74aeb8854 Mon Sep 17 00:00:00 2001 From: Manivannan Sadhasivam Date: Wed, 13 Feb 2019 14:28:54 +0530 Subject: [PATCH 13/25] hikey: Allow environment to store in eMMC and increase bootdelay Current Hikey configuration allows us to store u-boot environment on uSD card. But this will be useless if uSD card is not inserted, hence use the onboard eMMC memory for storing environment at Boot1 partition. While we are at it, let's increase the boot delay to 10s also. Signed-off-by: Manivannan Sadhasivam --- configs/hikey_defconfig | 5 ++--- include/configs/hikey.h | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configs/hikey_defconfig b/configs/hikey_defconfig index e9a9857322b..659c0e3f8ae 100644 --- a/configs/hikey_defconfig +++ b/configs/hikey_defconfig @@ -15,9 +15,8 @@ CONFIG_CMD_MMC=y CONFIG_CMD_USB=y CONFIG_CMD_CACHE=y CONFIG_DEFAULT_DEVICE_TREE="hi6220-hikey" -CONFIG_ENV_IS_IN_FAT=y -CONFIG_ENV_FAT_INTERFACE="mmc" -CONFIG_ENV_FAT_DEVICE_AND_PART="1:1" +CONFIG_ENV_IS_IN_MMC=y +CONFIG_BOOTDELAY=10 CONFIG_DM_MMC=y CONFIG_MMC_DW=y CONFIG_MMC_DW_K3=y diff --git a/include/configs/hikey.h b/include/configs/hikey.h index 003cd75baf8..60c6bde16ea 100644 --- a/include/configs/hikey.h +++ b/include/configs/hikey.h @@ -81,8 +81,10 @@ "initrd_high=0xffffffffffffffff\0" \ BOOTENV -/* Preserve environment on sd card */ +/* Preserve environment on eMMC */ #define CONFIG_ENV_SIZE 0x1000 +#define CONFIG_SYS_MMC_ENV_DEV 0 /* Use eMMC */ +#define CONFIG_SYS_MMC_ENV_PART 2 /* Use Boot1 partition */ /* Monitor Command Prompt */ #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */ From 591353d011b5ff6dbc8511b7a839cddf5b610495 Mon Sep 17 00:00:00 2001 From: Adam Ford Date: Wed, 13 Feb 2019 13:06:37 -0600 Subject: [PATCH 14/25] ARM: da850evm: Increase Malloc Size The SPI NOR frameware was recently updated, but they require a little more memory that we had previosly allocated, so it stopped booting. This patch doubles the size of CONFIG_SPL_SYS_MALLOC_F_LEN to 0x800. Fixes: c4e8862308d4 ("mtd: spi: Switch to new SPI NOR framework") Signed-off-by: Adam Ford --- configs/da850_am18xxevm_defconfig | 1 + configs/da850evm_defconfig | 1 + configs/da850evm_direct_nor_defconfig | 1 + configs/da850evm_nand_defconfig | 1 + 4 files changed, 4 insertions(+) diff --git a/configs/da850_am18xxevm_defconfig b/configs/da850_am18xxevm_defconfig index 58745fec826..419224104af 100644 --- a/configs/da850_am18xxevm_defconfig +++ b/configs/da850_am18xxevm_defconfig @@ -6,6 +6,7 @@ CONFIG_MAC_ADDR_IN_EEPROM=y CONFIG_TI_COMMON_CMD_OPTIONS=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x800 CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL=y CONFIG_SPL_SPI_FLASH_SUPPORT=y diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig index 5100ee7b0eb..41dae05fb90 100644 --- a/configs/da850evm_defconfig +++ b/configs/da850evm_defconfig @@ -5,6 +5,7 @@ CONFIG_TARGET_DA850EVM=y CONFIG_TI_COMMON_CMD_OPTIONS=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x800 CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL=y CONFIG_SPL_SPI_FLASH_SUPPORT=y diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig index be818dff552..166e77b8e3a 100644 --- a/configs/da850evm_direct_nor_defconfig +++ b/configs/da850evm_direct_nor_defconfig @@ -4,6 +4,7 @@ CONFIG_SYS_TEXT_BASE=0x60000000 CONFIG_TARGET_DA850EVM=y CONFIG_DA850_LOWLEVEL=y CONFIG_TI_COMMON_CMD_OPTIONS=y +CONFIG_SYS_MALLOC_F_LEN=0x800 CONFIG_NR_DRAM_BANKS=1 CONFIG_SYS_EXTRA_OPTIONS="USE_NOR,DIRECT_NOR_BOOT" CONFIG_BOOTDELAY=3 diff --git a/configs/da850evm_nand_defconfig b/configs/da850evm_nand_defconfig index 1cdde484dde..48b7c2a97a1 100644 --- a/configs/da850evm_nand_defconfig +++ b/configs/da850evm_nand_defconfig @@ -5,6 +5,7 @@ CONFIG_TARGET_DA850EVM=y CONFIG_TI_COMMON_CMD_OPTIONS=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x800 CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL=y CONFIG_SPL_SPI_FLASH_SUPPORT=y From 1c6b6f383a411a8d3ad3b80970a4be19377f3a85 Mon Sep 17 00:00:00 2001 From: Adam Ford Date: Thu, 14 Feb 2019 14:06:35 -0600 Subject: [PATCH 15/25] ARM: am3517_evm: Enable Falcon Mode The other OMAP3 based Logic PD boards have Falcon Mode enabled, so this patch makes it possible on the AM3517-evm as well. Signed-off-by: Adam Ford --- configs/am3517_evm_defconfig | 1 + include/configs/am3517_evm.h | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig index 7a74e9e90d7..9ba518f3d2a 100644 --- a/configs/am3517_evm_defconfig +++ b/configs/am3517_evm_defconfig @@ -15,6 +15,7 @@ CONFIG_VERSION_VARIABLE=y CONFIG_SPL_SYS_MALLOC_SIMPLE=y # CONFIG_SPL_FS_EXT4 is not set CONFIG_SPL_MTD_SUPPORT=y +CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="AM3517_EVM # " # CONFIG_CMD_IMI is not set CONFIG_CMD_SPL=y diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h index eb50012ff77..300f56541ed 100644 --- a/include/configs/am3517_evm.h +++ b/include/configs/am3517_evm.h @@ -71,6 +71,7 @@ #define CONFIG_SYS_NAND_MAX_ECCPOS 56 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000 +#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x2a0000 /* NAND block size is 128 KiB. Synchronize these values with * corresponding Device Tree entries in Linux: * MLO(SPL) 4 * NAND_BLOCK_SIZE = 512 KiB @ 0x000000 From 57ade0792c2806cb60b6d730860d0df1697b5413 Mon Sep 17 00:00:00 2001 From: Adam Ford Date: Thu, 14 Feb 2019 20:13:53 -0600 Subject: [PATCH 16/25] ARM: da8xxevm: Add NAND instructions for da850-evm to README The README.da850 file continues information on how to burn NAND for the LCDK, but not the DA850-EVM. This patch adds both the commands and dip switch instructions for burning and booting NAND. Signed-off-by: Adam Ford --- board/davinci/da8xxevm/README.da850 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/board/davinci/da8xxevm/README.da850 b/board/davinci/da8xxevm/README.da850 index f24e8b53429..5775b7d80fd 100644 --- a/board/davinci/da8xxevm/README.da850 +++ b/board/davinci/da8xxevm/README.da850 @@ -88,6 +88,14 @@ In this case the commands would be simplified to: U-Boot > nand erase.part bootloader U-Boot > nand write 0xc0700000 bootloader +On the DA850-EVM, NAND can also be written with SW7:7-8 ON and + + sudo mono sfh_OMAP-L138.exe -targetType AM1808 -p /dev/ttyUSB0 \ + -flash_noubl -flashType NAND ~/src/u-boot/u-boot.ais + +To boot the DA850-EVM from NAND, SW7:5 should be switched on and all others +off. + Flashing the images to MMC ========================== If the boot pins are set to boot from mmc, the RBL will try to load the From ed59a76db0e9909fbdcf93146b115081b9d44c49 Mon Sep 17 00:00:00 2001 From: Adam Ford Date: Sat, 16 Feb 2019 13:31:23 -0600 Subject: [PATCH 17/25] ARM: DTS: omap3-u-boot.dtsi Create generic omap3-u-boot.dtsi file that omap3 based boards can include to generate device tree in SPL for booting MLO. Credit should go to Tom Rini. Signed-off-by: Adam Ford Signed-off-by: Tom Rini Tested-by: Derald D. Woods --- arch/arm/dts/omap3-u-boot.dtsi | 81 ++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 arch/arm/dts/omap3-u-boot.dtsi diff --git a/arch/arm/dts/omap3-u-boot.dtsi b/arch/arm/dts/omap3-u-boot.dtsi new file mode 100644 index 00000000000..32bea6b6d9b --- /dev/null +++ b/arch/arm/dts/omap3-u-boot.dtsi @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * Based on "omap5-u-boot.dtsi" + */ + +/{ + ocp@68000000 { + u-boot,dm-spl; + + bandgap@48002524 { + u-boot,dm-spl; + }; + }; +}; + +&uart1 { + u-boot,dm-spl; + reg-shift = <2>; +}; + +&uart2 { + u-boot,dm-spl; + reg-shift = <2>; +}; + +&uart3 { + u-boot,dm-spl; + reg-shift = <2>; +}; + +&mmc1 { + u-boot,dm-spl; +}; + +&mmc2 { + u-boot,dm-spl; +}; + +&l4_core { + u-boot,dm-spl; +}; + +&scm { + u-boot,dm-spl; +}; + +&scm_conf { + u-boot,dm-spl; +}; + +&gpio1 { + u-boot,dm-spl; +}; + +&gpio2 { + u-boot,dm-spl; +}; + +&gpio3 { + u-boot,dm-spl; +}; + +&gpio4 { + u-boot,dm-spl; +}; + +&gpio5 { + u-boot,dm-spl; +}; + +&gpio6 { + u-boot,dm-spl; +}; + +&i2c1 { + u-boot,dm-spl; +}; From 0cd9465c0bf41b75ebd58b72c3bcf888486521e9 Mon Sep 17 00:00:00 2001 From: Adam Ford Date: Sat, 16 Feb 2019 13:31:24 -0600 Subject: [PATCH 18/25] ARM: omap3_logic: Enable SPL booting device tree With the generic omap3-u-boot.dtsi file available, this patch increased the memory of the various incarnations of the omap3_logic board, and points their respective u-boot.dtsi files to the newly created generic one, and removes the PLATDATA from the board file. These are all done at once because the're all utilizing the same omap3logic.c board file. Signed-off-by: Adam Ford --- .../logicpd-som-lv-35xx-devkit-u-boot.dtsi | 2 ++ .../logicpd-som-lv-37xx-devkit-u-boot.dtsi | 6 ++-- .../logicpd-torpedo-35xx-devkit-u-boot.dtsi | 2 ++ .../logicpd-torpedo-37xx-devkit-u-boot.dtsi | 2 ++ board/logicpd/omap3som/omap3logic.c | 30 ------------------- configs/omap35_logic_defconfig | 10 ++++++- configs/omap35_logic_somlv_defconfig | 11 +++++-- configs/omap3_logic_defconfig | 7 ++++- configs/omap3_logic_somlv_defconfig | 10 +++++-- 9 files changed, 39 insertions(+), 41 deletions(-) diff --git a/arch/arm/dts/logicpd-som-lv-35xx-devkit-u-boot.dtsi b/arch/arm/dts/logicpd-som-lv-35xx-devkit-u-boot.dtsi index 6445048fe00..b3da8b1a732 100644 --- a/arch/arm/dts/logicpd-som-lv-35xx-devkit-u-boot.dtsi +++ b/arch/arm/dts/logicpd-som-lv-35xx-devkit-u-boot.dtsi @@ -4,6 +4,8 @@ * Logic PD - http://www.logicpd.com */ +#include "omap3-u-boot.dtsi" + / { chosen { stdout-path = &uart1; diff --git a/arch/arm/dts/logicpd-som-lv-37xx-devkit-u-boot.dtsi b/arch/arm/dts/logicpd-som-lv-37xx-devkit-u-boot.dtsi index 6445048fe00..956199a2b42 100644 --- a/arch/arm/dts/logicpd-som-lv-37xx-devkit-u-boot.dtsi +++ b/arch/arm/dts/logicpd-som-lv-37xx-devkit-u-boot.dtsi @@ -4,6 +4,8 @@ * Logic PD - http://www.logicpd.com */ +#include "omap3-u-boot.dtsi" + / { chosen { stdout-path = &uart1; @@ -18,10 +20,6 @@ clock-frequency = <400000>; }; -&mmc1 { - cd-gpios = <&gpio4 14 GPIO_ACTIVE_LOW>; /* gpio_110 */ -}; - &mmc2 { status = "disabled"; }; diff --git a/arch/arm/dts/logicpd-torpedo-35xx-devkit-u-boot.dtsi b/arch/arm/dts/logicpd-torpedo-35xx-devkit-u-boot.dtsi index 41ed5d7e179..2c599f1c51b 100644 --- a/arch/arm/dts/logicpd-torpedo-35xx-devkit-u-boot.dtsi +++ b/arch/arm/dts/logicpd-torpedo-35xx-devkit-u-boot.dtsi @@ -4,6 +4,8 @@ * Logic PD - http://www.logicpd.com */ +#include "omap3-u-boot.dtsi" + &i2c1 { clock-frequency = <400000>; }; diff --git a/arch/arm/dts/logicpd-torpedo-37xx-devkit-u-boot.dtsi b/arch/arm/dts/logicpd-torpedo-37xx-devkit-u-boot.dtsi index 41ed5d7e179..2c599f1c51b 100644 --- a/arch/arm/dts/logicpd-torpedo-37xx-devkit-u-boot.dtsi +++ b/arch/arm/dts/logicpd-torpedo-37xx-devkit-u-boot.dtsi @@ -4,6 +4,8 @@ * Logic PD - http://www.logicpd.com */ +#include "omap3-u-boot.dtsi" + &i2c1 { clock-frequency = <400000>; }; diff --git a/board/logicpd/omap3som/omap3logic.c b/board/logicpd/omap3som/omap3logic.c index 144e6f68a48..ee77ce077c1 100644 --- a/board/logicpd/omap3som/omap3logic.c +++ b/board/logicpd/omap3som/omap3logic.c @@ -56,36 +56,6 @@ DECLARE_GLOBAL_DATA_PTR; #define LOGIC_MT28_OMAP35_ASYNC_GPMC_CONFIG6 0x09030000 #define LOGIC_MT28_OMAP35_ASYNC_GPMC_CONFIG7 0x00000C50 -/* This is only needed until SPL gets OF support */ -#ifdef CONFIG_SPL_BUILD -static const struct ns16550_platdata omap3logic_serial = { - .base = OMAP34XX_UART1, - .reg_shift = 2, - .clock = V_NS16550_CLK, - .fcr = UART_FCR_DEFVAL, -}; - -U_BOOT_DEVICE(omap3logic_uart) = { - "omap_serial", - &omap3logic_serial -}; - -static const struct omap_hsmmc_plat omap3_logic_mmc0_platdata = { - .base_addr = (struct hsmmc *)OMAP_HSMMC1_BASE, - .cfg.host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_4BIT, - .cfg.f_min = 400000, - .cfg.f_max = 52000000, - .cfg.voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195, - .cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT, -}; - -U_BOOT_DEVICE(omap3_logic_mmc0) = { - .name = "omap_hsmmc", - .platdata = &omap3_logic_mmc0_platdata, -}; - -#endif - #ifdef CONFIG_SPL_OS_BOOT int spl_start_uboot(void) { diff --git a/configs/omap35_logic_defconfig b/configs/omap35_logic_defconfig index d2821b8ceb8..5b5f3eb7b47 100644 --- a/configs/omap35_logic_defconfig +++ b/configs/omap35_logic_defconfig @@ -1,9 +1,11 @@ CONFIG_ARM=y +# CONFIG_SPL_USE_ARCH_MEMCPY is not set +# CONFIG_SPL_USE_ARCH_MEMSET is not set CONFIG_ARCH_OMAP2PLUS=y CONFIG_SYS_TEXT_BASE=0x80100000 CONFIG_TI_COMMON_CMD_OPTIONS=y # CONFIG_SPL_GPIO_SUPPORT is not set -CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_SYS_MALLOC_F_LEN=0x4000 CONFIG_TARGET_OMAP3_LOGIC=y # CONFIG_SPL_OMAP3_ID_NAND is not set CONFIG_SPL=y @@ -12,8 +14,11 @@ CONFIG_NR_DRAM_BANKS=2 CONFIG_ANDROID_BOOT_IMAGE=y # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_INFO_QUIET=y +CONFIG_DEFAULT_FDT_FILE="logicpd-torpedo-35xx-devkit.dtb" CONFIG_VERSION_VARIABLE=y CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_SEPARATE_BSS=y +# CONFIG_SPL_FS_EXT4 is not set CONFIG_SPL_MTD_SUPPORT=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="OMAP Logic # " @@ -30,10 +35,13 @@ CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0" CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(MLO),1792k(u-boot),128k(spl-os),128k(u-boot-env),6m(kernel),-(fs)" CONFIG_CMD_UBI=y CONFIG_OF_CONTROL=y +CONFIG_SPL_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="logicpd-torpedo-35xx-devkit" # CONFIG_ENV_IS_IN_FAT is not set CONFIG_ENV_IS_IN_NAND=y CONFIG_SPL_DM=y +CONFIG_SPL_DM_SEQ_ALIAS=y +CONFIG_SPL_OF_TRANSLATE=y CONFIG_DM_I2C=y CONFIG_DM_MMC=y CONFIG_MMC_OMAP_HS=y diff --git a/configs/omap35_logic_somlv_defconfig b/configs/omap35_logic_somlv_defconfig index 28b35ac80d6..396f3216995 100644 --- a/configs/omap35_logic_somlv_defconfig +++ b/configs/omap35_logic_somlv_defconfig @@ -1,9 +1,10 @@ CONFIG_ARM=y +# CONFIG_SPL_USE_ARCH_MEMCPY is not set +# CONFIG_SPL_USE_ARCH_MEMSET is not set CONFIG_ARCH_OMAP2PLUS=y CONFIG_SYS_TEXT_BASE=0x80100000 CONFIG_TI_COMMON_CMD_OPTIONS=y -# CONFIG_SPL_GPIO_SUPPORT is not set -CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_SYS_MALLOC_F_LEN=0x4000 CONFIG_TARGET_OMAP3_LOGIC=y # CONFIG_SPL_OMAP3_ID_NAND is not set CONFIG_SPL=y @@ -12,16 +13,19 @@ CONFIG_NR_DRAM_BANKS=2 CONFIG_ANDROID_BOOT_IMAGE=y # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_INFO_QUIET=y +CONFIG_DEFAULT_FDT_FILE="logicpd-som-lv-35xx-devkit.dtb" CONFIG_VERSION_VARIABLE=y CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_SEPARATE_BSS=y +# CONFIG_SPL_FS_EXT4 is not set CONFIG_SPL_MTD_SUPPORT=y CONFIG_SPL_OS_BOOT=y +# CONFIG_SPL_POWER_SUPPORT is not set CONFIG_SYS_PROMPT="OMAP Logic # " # CONFIG_CMD_IMI is not set CONFIG_CMD_SPL=y CONFIG_CMD_SPL_NAND_OFS=0x240000 CONFIG_CMD_SPL_WRITE_SIZE=0x20000 -# CONFIG_CMD_FLASH is not set CONFIG_CMD_NAND=y CONFIG_CMD_NAND_LOCK_UNLOCK=y CONFIG_CMD_CACHE=y @@ -30,6 +34,7 @@ CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0,nor0=physmap-flash.0" CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(MLO),1792k(u-boot),128k(spl-os),128k(u-boot-env),6m(kernel),-(fs);physmap-flash.0:-(nor)" CONFIG_CMD_UBI=y CONFIG_OF_CONTROL=y +CONFIG_SPL_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="logicpd-som-lv-35xx-devkit" # CONFIG_ENV_IS_IN_FAT is not set CONFIG_ENV_IS_IN_NAND=y diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig index 9c6f442b647..b38b6fd75a8 100644 --- a/configs/omap3_logic_defconfig +++ b/configs/omap3_logic_defconfig @@ -1,9 +1,11 @@ CONFIG_ARM=y +# CONFIG_SPL_USE_ARCH_MEMCPY is not set +# CONFIG_SPL_USE_ARCH_MEMSET is not set CONFIG_ARCH_OMAP2PLUS=y CONFIG_SYS_TEXT_BASE=0x80100000 CONFIG_TI_COMMON_CMD_OPTIONS=y # CONFIG_SPL_GPIO_SUPPORT is not set -CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_SYS_MALLOC_F_LEN=0x4000 CONFIG_TARGET_OMAP3_LOGIC=y # CONFIG_SPL_OMAP3_ID_NAND is not set CONFIG_SPL=y @@ -14,6 +16,8 @@ CONFIG_ANDROID_BOOT_IMAGE=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_VERSION_VARIABLE=y CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_SEPARATE_BSS=y +# CONFIG_SPL_FS_EXT4 is not set CONFIG_SPL_MTD_SUPPORT=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="OMAP Logic # " @@ -30,6 +34,7 @@ CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0" CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(MLO),1792k(u-boot),128k(spl-os),128k(u-boot-env),6m(kernel),-(fs)" CONFIG_CMD_UBI=y CONFIG_OF_CONTROL=y +CONFIG_SPL_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="logicpd-torpedo-37xx-devkit" # CONFIG_ENV_IS_IN_FAT is not set CONFIG_ENV_IS_IN_NAND=y diff --git a/configs/omap3_logic_somlv_defconfig b/configs/omap3_logic_somlv_defconfig index 6602af6abe8..c6106c5d23a 100644 --- a/configs/omap3_logic_somlv_defconfig +++ b/configs/omap3_logic_somlv_defconfig @@ -1,9 +1,10 @@ CONFIG_ARM=y +# CONFIG_SPL_USE_ARCH_MEMCPY is not set +# CONFIG_SPL_USE_ARCH_MEMSET is not set CONFIG_ARCH_OMAP2PLUS=y CONFIG_SYS_TEXT_BASE=0x80100000 CONFIG_TI_COMMON_CMD_OPTIONS=y -# CONFIG_SPL_GPIO_SUPPORT is not set -CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_SYS_MALLOC_F_LEN=0x4000 CONFIG_TARGET_OMAP3_LOGIC=y # CONFIG_SPL_OMAP3_ID_NAND is not set CONFIG_SPL=y @@ -12,10 +13,14 @@ CONFIG_NR_DRAM_BANKS=2 CONFIG_ANDROID_BOOT_IMAGE=y # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_INFO_QUIET=y +CONFIG_DEFAULT_FDT_FILE="logicpd-som-lv-37xx-devkit.dtb" CONFIG_VERSION_VARIABLE=y CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_SEPARATE_BSS=y +# CONFIG_SPL_FS_EXT4 is not set CONFIG_SPL_MTD_SUPPORT=y CONFIG_SPL_OS_BOOT=y +# CONFIG_SPL_POWER_SUPPORT is not set CONFIG_SYS_PROMPT="OMAP Logic # " # CONFIG_CMD_IMI is not set CONFIG_CMD_SPL=y @@ -29,6 +34,7 @@ CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0,nor0=physmap-flash.0" CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(MLO),1792k(u-boot),128k(spl-os),128k(u-boot-env),6m(kernel),-(fs);physmap-flash.0:-(nor)" CONFIG_CMD_UBI=y CONFIG_OF_CONTROL=y +CONFIG_SPL_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="logicpd-som-lv-37xx-devkit" # CONFIG_ENV_IS_IN_FAT is not set CONFIG_ENV_IS_IN_NAND=y From 84c7a1398f73d88e8e96dfee137e45e0c85a5d7a Mon Sep 17 00:00:00 2001 From: "Gervais, Francois" Date: Sat, 16 Feb 2019 21:10:32 +0000 Subject: [PATCH 19/25] cmd/fs: fix build if CMD_BOOTEFI is not set Fixes: cmd/fs.c:29: undefined reference to `efi_set_bootdev' Signed-off-by: Francois Gervais --- cmd/fs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/fs.c b/cmd/fs.c index 8064a1c84df..94467671be8 100644 --- a/cmd/fs.c +++ b/cmd/fs.c @@ -26,8 +26,10 @@ U_BOOT_CMD( static int do_load_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { +#ifdef CONFIG_CMD_BOOTEFI efi_set_bootdev(argv[1], (argc > 2) ? argv[2] : "", (argc > 4) ? argv[4] : ""); +#endif return do_load(cmdtp, flag, argc, argv, FS_TYPE_ANY); } From e0cc7df9fdf283fd4db9526151ff224281e460e8 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Sat, 16 Feb 2019 16:36:29 -0500 Subject: [PATCH 20/25] omap3_beagle: Update for DM SPL support - Switch to using the omap3-u-boot.dtsi file for needed properties. - Remove a few SPL features to free up more SRAM space. - Switch CONFIG_SYS_TEXT_BASE to the normal default, we don't need to worry about X-Loader at this point anymore. - A few related updates to SPL options as part of switching to DM SPL. Signed-off-by: Tom Rini Tested-by: Derald D. Woods --- arch/arm/dts/omap3-beagle-u-boot.dtsi | 14 ++------------ arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi | 14 ++------------ arch/arm/dts/omap3-beagle-xm-u-boot.dtsi | 14 ++------------ board/ti/beagle/beagle.c | 12 ------------ configs/omap3_beagle_defconfig | 17 ++++++++++++++--- 5 files changed, 20 insertions(+), 51 deletions(-) diff --git a/arch/arm/dts/omap3-beagle-u-boot.dtsi b/arch/arm/dts/omap3-beagle-u-boot.dtsi index 41beaf0900c..2c03701c896 100644 --- a/arch/arm/dts/omap3-beagle-u-boot.dtsi +++ b/arch/arm/dts/omap3-beagle-u-boot.dtsi @@ -5,20 +5,10 @@ * (C) Copyright 2017 Derald D. Woods */ +#include "omap3-u-boot.dtsi" + / { chosen { stdout-path = &uart3; }; }; - -&uart1 { - reg-shift = <2>; -}; - -&uart2 { - reg-shift = <2>; -}; - -&uart3 { - reg-shift = <2>; -}; diff --git a/arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi b/arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi index 41beaf0900c..2c03701c896 100644 --- a/arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi +++ b/arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi @@ -5,20 +5,10 @@ * (C) Copyright 2017 Derald D. Woods */ +#include "omap3-u-boot.dtsi" + / { chosen { stdout-path = &uart3; }; }; - -&uart1 { - reg-shift = <2>; -}; - -&uart2 { - reg-shift = <2>; -}; - -&uart3 { - reg-shift = <2>; -}; diff --git a/arch/arm/dts/omap3-beagle-xm-u-boot.dtsi b/arch/arm/dts/omap3-beagle-xm-u-boot.dtsi index 41beaf0900c..2c03701c896 100644 --- a/arch/arm/dts/omap3-beagle-xm-u-boot.dtsi +++ b/arch/arm/dts/omap3-beagle-xm-u-boot.dtsi @@ -5,20 +5,10 @@ * (C) Copyright 2017 Derald D. Woods */ +#include "omap3-u-boot.dtsi" + / { chosen { stdout-path = &uart3; }; }; - -&uart1 { - reg-shift = <2>; -}; - -&uart2 { - reg-shift = <2>; -}; - -&uart3 { - reg-shift = <2>; -}; diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index 826aace3fba..91e0a4c026d 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -71,18 +71,6 @@ static struct { char env_setting[64]; } expansion_config; -static const struct ns16550_platdata beagle_serial = { - .base = OMAP34XX_UART3, - .reg_shift = 2, - .clock = V_NS16550_CLK, - .fcr = UART_FCR_DEFVAL, -}; - -U_BOOT_DEVICE(beagle_uart) = { - "ns16550_serial", - &beagle_serial -}; - /* * Routine: board_init * Description: Early hardware init. diff --git a/configs/omap3_beagle_defconfig b/configs/omap3_beagle_defconfig index e199673207a..f6d522a5f10 100644 --- a/configs/omap3_beagle_defconfig +++ b/configs/omap3_beagle_defconfig @@ -1,17 +1,22 @@ CONFIG_ARM=y +# CONFIG_SPL_USE_ARCH_MEMCPY is not set +# CONFIG_SPL_USE_ARCH_MEMSET is not set CONFIG_ARCH_OMAP2PLUS=y -CONFIG_SYS_TEXT_BASE=0x80100000 +CONFIG_SYS_MALLOC_F_LEN=0x4000 CONFIG_TARGET_OMAP3_BEAGLE=y +CONFIG_SPL_SYS_MALLOC_F_LEN=0x400 CONFIG_SPL=y CONFIG_DISTRO_DEFAULTS=y CONFIG_NR_DRAM_BANKS=2 +CONFIG_TPL_SYS_MALLOC_F_LEN=0x400 CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd" CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DEFAULT_FDT_FILE="omap3-beagle.dtb" CONFIG_VERSION_VARIABLE=y +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_SEPARATE_BSS=y # CONFIG_SPL_FS_EXT4 is not set CONFIG_SPL_MTD_SUPPORT=y -CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="BeagleBoard # " CONFIG_CMD_SPL=y CONFIG_CMD_SPL_NAND_OFS=0x280000 @@ -33,10 +38,16 @@ CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0" CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(spl),1920k(u-boot),128k(u-boot-env),128k(dtb),6m(kernel),-(rootfs)" CONFIG_CMD_UBI=y # CONFIG_ISO_PARTITION is not set +# CONFIG_SPL_EFI_PARTITION is not set +CONFIG_SPL_PARTITION_UUIDS=y CONFIG_OF_CONTROL=y +CONFIG_SPL_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="omap3-beagle" +CONFIG_OF_SPL_REMOVE_PROPS="clocks clock-names interrupt-parent" CONFIG_ENV_IS_IN_NAND=y CONFIG_SPL_DM=y +CONFIG_SPL_DM_SEQ_ALIAS=y +CONFIG_SPL_OF_TRANSLATE=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_BUF_ADDR=0x82000000 CONFIG_LED_STATUS=y @@ -52,6 +63,7 @@ CONFIG_LED_STATUS_GREEN_ENABLE=y CONFIG_LED_STATUS_GREEN=2 CONFIG_LED_STATUS_CMD=y CONFIG_TWL4030_LED=y +CONFIG_DM_MMC=y CONFIG_MMC_OMAP_HS=y CONFIG_NAND=y CONFIG_SYS_NAND_BUSWIDTH_16BIT=y @@ -78,4 +90,3 @@ CONFIG_USB_ETHER_SMSC95XX=y CONFIG_VIDEO_OMAP3=y CONFIG_FAT_WRITE=y CONFIG_BCH=y -CONFIG_SPL_OF_LIBFDT=y From 6dd18bb1112901fd72a5da914565462998adff7a Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Sat, 16 Feb 2019 16:36:30 -0500 Subject: [PATCH 21/25] omap3_beagle: Enable DM_SPI Switch to DM_SPI support now. Signed-off-by: Tom Rini --- configs/omap3_beagle_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/omap3_beagle_defconfig b/configs/omap3_beagle_defconfig index f6d522a5f10..73ffa83d0c5 100644 --- a/configs/omap3_beagle_defconfig +++ b/configs/omap3_beagle_defconfig @@ -71,6 +71,7 @@ CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y CONFIG_SYS_NAND_U_BOOT_OFFS=0x80000 CONFIG_SPL_NAND_SIMPLE=y CONFIG_SPI=y +CONFIG_DM_SPI=y CONFIG_OMAP3_SPI=y CONFIG_USB=y CONFIG_USB_EHCI_HCD=y From 36a75344d7c7d7add3df0e562ca5e920632ea18b Mon Sep 17 00:00:00 2001 From: "Derald D. Woods" Date: Sat, 16 Feb 2019 16:56:50 -0600 Subject: [PATCH 22/25] ARM: omap3: evm: Update DM SPL support - Switch to using the omap3-u-boot.dtsi file for needed properties - Enable SPL_OF_CONTROL This commit is based on the following series: https://patchwork.ozlabs.org/project/uboot/list/?series=92472 https://patchwork.ozlabs.org/project/uboot/list/?series=92462 Signed-off-by: Derald D. Woods Reviewed-by: Tom Rini --- arch/arm/dts/omap3-evm-37xx-u-boot.dtsi | 14 ++------------ arch/arm/dts/omap3-evm-u-boot.dtsi | 14 ++------------ board/ti/evm/evm.c | 12 ------------ configs/omap3_evm_defconfig | 14 +++++++++++--- 4 files changed, 15 insertions(+), 39 deletions(-) diff --git a/arch/arm/dts/omap3-evm-37xx-u-boot.dtsi b/arch/arm/dts/omap3-evm-37xx-u-boot.dtsi index de411316d83..b9e433f873b 100644 --- a/arch/arm/dts/omap3-evm-37xx-u-boot.dtsi +++ b/arch/arm/dts/omap3-evm-37xx-u-boot.dtsi @@ -5,20 +5,10 @@ * (C) Copyright 2017 Derald D. Woods */ +#include "omap3-u-boot.dtsi" + / { chosen { stdout-path = &uart1; }; }; - -&uart1 { - reg-shift = <2>; -}; - -&uart2 { - reg-shift = <2>; -}; - -&uart3 { - reg-shift = <2>; -}; diff --git a/arch/arm/dts/omap3-evm-u-boot.dtsi b/arch/arm/dts/omap3-evm-u-boot.dtsi index de411316d83..b9e433f873b 100644 --- a/arch/arm/dts/omap3-evm-u-boot.dtsi +++ b/arch/arm/dts/omap3-evm-u-boot.dtsi @@ -5,20 +5,10 @@ * (C) Copyright 2017 Derald D. Woods */ +#include "omap3-u-boot.dtsi" + / { chosen { stdout-path = &uart1; }; }; - -&uart1 { - reg-shift = <2>; -}; - -&uart2 { - reg-shift = <2>; -}; - -&uart3 { - reg-shift = <2>; -}; diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index c59aff595ad..daecb4af3e8 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -40,18 +40,6 @@ DECLARE_GLOBAL_DATA_PTR; -static const struct ns16550_platdata omap3_evm_serial = { - .base = OMAP34XX_UART1, - .reg_shift = 2, - .clock = V_NS16550_CLK, - .fcr = UART_FCR_DEFVAL, -}; - -U_BOOT_DEVICE(omap3_evm_uart) = { - "ns16550_serial", - &omap3_evm_serial -}; - static u32 omap3_evm_version; u32 get_omap3_evm_rev(void) diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig index 22e623381fe..aa9928e2085 100644 --- a/configs/omap3_evm_defconfig +++ b/configs/omap3_evm_defconfig @@ -1,17 +1,21 @@ CONFIG_ARM=y +# CONFIG_SPL_USE_ARCH_MEMCPY is not set +# CONFIG_SPL_USE_ARCH_MEMSET is not set CONFIG_ARCH_OMAP2PLUS=y -CONFIG_SYS_TEXT_BASE=0x80100000 -CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_SYS_MALLOC_F_LEN=0x4000 CONFIG_TARGET_OMAP3_EVM=y +CONFIG_SPL_SYS_MALLOC_F_LEN=0x400 CONFIG_SPL=y CONFIG_DISTRO_DEFAULTS=y CONFIG_NR_DRAM_BANKS=2 +CONFIG_TPL_SYS_MALLOC_F_LEN=0x400 CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb" CONFIG_VERSION_VARIABLE=y +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_SEPARATE_BSS=y # CONFIG_SPL_FS_EXT4 is not set CONFIG_SPL_MTD_SUPPORT=y -CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="OMAP3_EVM # " CONFIG_CMD_SPL=y CONFIG_CMD_SPL_NAND_OFS=0x280000 @@ -36,9 +40,13 @@ CONFIG_CMD_UBI=y # CONFIG_EFI_PARTITION is not set CONFIG_SPL_PARTITION_UUIDS=y CONFIG_OF_CONTROL=y +CONFIG_SPL_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="omap3-evm" +CONFIG_OF_SPL_REMOVE_PROPS="clocks clock-names interrupt-parent" CONFIG_ENV_IS_IN_NAND=y CONFIG_SPL_DM=y +CONFIG_SPL_DM_SEQ_ALIAS=y +CONFIG_SPL_OF_TRANSLATE=y # CONFIG_SPL_BLK is not set CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_BUF_ADDR=0x82000000 From 72384ff2e95bc54380f1015eb087211cc199844a Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Mon, 18 Feb 2019 08:48:04 +1300 Subject: [PATCH 23/25] dm: Fix typo 'Watchdot' -> 'Watchdog' Signed-off-by: Chris Packham --- include/dm/uclass-id.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h index f3bafb3c635..86e59781b05 100644 --- a/include/dm/uclass-id.h +++ b/include/dm/uclass-id.h @@ -106,7 +106,7 @@ enum uclass_id { UCLASS_VIRTIO, /* VirtIO transport device */ UCLASS_W1, /* Dallas 1-Wire bus */ UCLASS_W1_EEPROM, /* one-wire EEPROMs */ - UCLASS_WDT, /* Watchdot Timer driver */ + UCLASS_WDT, /* Watchdog Timer driver */ UCLASS_COUNT, UCLASS_INVALID = -1, From 2d3beff2d297d278b3944289be285a59fa7904e0 Mon Sep 17 00:00:00 2001 From: Ismael Luceno Cortes Date: Mon, 18 Feb 2019 09:17:04 +0000 Subject: [PATCH 24/25] cmd: pcmcia: Build only if CONFIG_CMD_PCMCIA=y Signed-off-by: Ismael Luceno --- cmd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/Makefile b/cmd/Makefile index 15ae4d250f5..a127a995394 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -104,7 +104,7 @@ obj-$(CONFIG_CMD_PART) += part.o ifdef CONFIG_PCI obj-$(CONFIG_CMD_PCI) += pci.o endif -obj-y += pcmcia.o +obj-$(CONFIG_CMD_PCMCIA) += pcmcia.o obj-$(CONFIG_CMD_PINMUX) += pinmux.o obj-$(CONFIG_CMD_PXE) += pxe.o obj-$(CONFIG_CMD_WOL) += wol.o From 06d01e6601203644b403cc8d909fe2a1990e5468 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Tue, 19 Feb 2019 16:58:56 -0500 Subject: [PATCH 25/25] travis: Exclude omap from the arm926ejs job We build the platform here that matches with "omap" in its own job, don't need to have it here as well. Signed-off-by: Tom Rini --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 49a7fa94f3a..834502fc8c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -166,7 +166,7 @@ matrix: - name: "buildman arm926ejs (non-NXP,siemens,atmel,kirkwood,spear)" env: - JOB="arm926ejs" - BUILDMAN="arm926ejs -x freescale,siemens,atmel,kirkwood,spear" + BUILDMAN="arm926ejs -x freescale,siemens,atmel,kirkwood,spear,omap" - name: "buildman atmel" env: - BUILDMAN="atmel"