diff options
Diffstat (limited to 'board')
42 files changed, 819 insertions, 111 deletions
diff --git a/board/AndesTech/adp-ae3xx/adp-ae3xx.c b/board/AndesTech/adp-ae3xx/adp-ae3xx.c index 98ed4d9589..8cffb6ba8b 100644 --- a/board/AndesTech/adp-ae3xx/adp-ae3xx.c +++ b/board/AndesTech/adp-ae3xx/adp-ae3xx.c @@ -6,6 +6,7 @@ * SPDX-License-Identifier: GPL-2.0+ */ +#include <asm/mach-types.h> #include <common.h> #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH) #include <netdev.h> diff --git a/board/amarula/vyasa-rk3288/Kconfig b/board/amarula/vyasa-rk3288/Kconfig new file mode 100644 index 0000000000..8b8c30835e --- /dev/null +++ b/board/amarula/vyasa-rk3288/Kconfig @@ -0,0 +1,12 @@ +if TARGET_VYASA_RK3288 + +config SYS_BOARD + default "vyasa-rk3288" + +config SYS_VENDOR + default "amarula" + +config SYS_CONFIG_NAME + default "vyasa-rk3288" + +endif diff --git a/board/amarula/vyasa-rk3288/MAINTAINERS b/board/amarula/vyasa-rk3288/MAINTAINERS new file mode 100644 index 0000000000..10397fcb4b --- /dev/null +++ b/board/amarula/vyasa-rk3288/MAINTAINERS @@ -0,0 +1,6 @@ +VYASA RK3288 +M: Jagan Teki <jagan@amarulasolutions.com> +S: Maintained +F: board/amarula/vyasa-rk3288 +F: include/configs/vyasa-rk3288.h +F: configs/vyasa-rk3288_defconfig diff --git a/board/amarula/vyasa-rk3288/Makefile b/board/amarula/vyasa-rk3288/Makefile new file mode 100644 index 0000000000..7c0d5c0316 --- /dev/null +++ b/board/amarula/vyasa-rk3288/Makefile @@ -0,0 +1,7 @@ +# +# Copyright (C) 2017 Amarula Solutions +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += vyasa-rk3288.o diff --git a/board/amarula/vyasa-rk3288/vyasa-rk3288.c b/board/amarula/vyasa-rk3288/vyasa-rk3288.c new file mode 100644 index 0000000000..ceee42c16e --- /dev/null +++ b/board/amarula/vyasa-rk3288/vyasa-rk3288.c @@ -0,0 +1,7 @@ +/* + * Copyright (C) 2017 Amarula Solutions + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> diff --git a/board/bachmann/ot1200/ot1200_spl.c b/board/bachmann/ot1200/ot1200_spl.c index 9d28da4ba4..f3dff95710 100644 --- a/board/bachmann/ot1200/ot1200_spl.c +++ b/board/bachmann/ot1200/ot1200_spl.c @@ -151,10 +151,4 @@ void board_init_f(ulong dummy) /* configure MMDC for SDRAM width/size and per-model calibration */ ot1200_spl_dram_init(); - - /* Clear the BSS. */ - memset(__bss_start, 0, __bss_end - __bss_start); - - /* load/boot image from boot device */ - board_init_r(NULL, 0); } diff --git a/board/compulab/cm_fx6/spl.c b/board/compulab/cm_fx6/spl.c index bba977ff8e..56aac60239 100644 --- a/board/compulab/cm_fx6/spl.c +++ b/board/compulab/cm_fx6/spl.c @@ -336,9 +336,6 @@ void board_init_f(ulong dummy) puts("!!!ERROR!!! DRAM detection failed!!!\n"); hang(); } - - memset(__bss_start, 0, __bss_end - __bss_start); - board_init_r(NULL, 0); } void board_boot_order(u32 *spl_boot_list) diff --git a/board/davinci/da8xxevm/Kconfig b/board/davinci/da8xxevm/Kconfig index bb1188b4ea..e0df97ca0e 100644 --- a/board/davinci/da8xxevm/Kconfig +++ b/board/davinci/da8xxevm/Kconfig @@ -33,6 +33,8 @@ config MAC_ADDR_IN_EEPROM endif +source "board/ti/common/Kconfig" + endif if TARGET_OMAPL138_LCDK diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c index 516d86df50..83c9f2940f 100644 --- a/board/davinci/da8xxevm/da850evm.c +++ b/board/davinci/da8xxevm/da850evm.c @@ -60,7 +60,7 @@ static int get_mac_addr(u8 *addr) return -1; } - ret = spi_flash_read(flash, CFG_MAC_ADDR_OFFSET, 6, addr); + ret = spi_flash_read(flash, (CFG_MAC_ADDR_OFFSET) + 1, 7, addr); if (ret) { printf("Error - unable to read MAC address from SPI flash.\n"); return -1; @@ -140,6 +140,7 @@ int misc_init_r(void) uchar buff[6]; spi_mac_read = get_mac_addr(buff); + buff[0] = 0; /* * MAC address not present in the environment diff --git a/board/engicam/common/spl.c b/board/engicam/common/spl.c index 6964c131d9..8711418fb4 100644 --- a/board/engicam/common/spl.c +++ b/board/engicam/common/spl.c @@ -384,10 +384,4 @@ void board_init_f(ulong dummy) /* DDR initialization */ spl_dram_init(); - - /* Clear the BSS. */ - memset(__bss_start, 0, __bss_end - __bss_start); - - /* load/boot image from boot device */ - board_init_r(NULL, 0); } diff --git a/board/freescale/ls2080ardb/ls2080ardb.c b/board/freescale/ls2080ardb/ls2080ardb.c index 666562d106..827bfad521 100644 --- a/board/freescale/ls2080ardb/ls2080ardb.c +++ b/board/freescale/ls2080ardb/ls2080ardb.c @@ -251,6 +251,8 @@ int misc_init_r(void) char *env_hwconfig; u32 __iomem *dcfg_ccsr = (u32 __iomem *)DCFG_BASE; u32 val; + struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); + u32 svr = gur_in32(&gur->svr); val = in_le32(dcfg_ccsr + DCFG_RCWSR13 / 4); @@ -278,6 +280,16 @@ int misc_init_r(void) if (adjust_vdd(0)) printf("Warning: Adjusting core voltage failed.\n"); + /* + * Default value of board env is based on filename which is + * ls2080ardb. Modify board env for other supported SoCs + */ + if ((SVR_SOC_VER(svr) == SVR_LS2088A) || + (SVR_SOC_VER(svr) == SVR_LS2048A)) + env_set("board", "ls2088ardb"); + else if ((SVR_SOC_VER(svr) == SVR_LS2081A) || + (SVR_SOC_VER(svr) == SVR_LS2041A)) + env_set("board", "ls2081ardb"); return 0; } diff --git a/board/freescale/mx7dsabresd/mx7dsabresd.c b/board/freescale/mx7dsabresd/mx7dsabresd.c index a681ecef3a..5819b1825d 100644 --- a/board/freescale/mx7dsabresd/mx7dsabresd.c +++ b/board/freescale/mx7dsabresd/mx7dsabresd.c @@ -260,7 +260,7 @@ static int setup_fec(void) (IOMUXC_GPR_GPR1_GPR_ENET1_TX_CLK_SEL_MASK | IOMUXC_GPR_GPR1_GPR_ENET1_CLK_DIR_MASK), 0); - return set_clk_enet(ENET_125MHz); + return set_clk_enet(ENET_125MHZ); } diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c b/board/gateworks/gw_ventana/gw_ventana_spl.c index c2e370ba0b..bdbe5e7027 100644 --- a/board/gateworks/gw_ventana/gw_ventana_spl.c +++ b/board/gateworks/gw_ventana/gw_ventana_spl.c @@ -626,9 +626,6 @@ void board_init_f(ulong dummy) spl_dram_init(8 << ventana_info.sdram_width, 16 << ventana_info.sdram_size, board_model); - - /* Clear the BSS. */ - memset(__bss_start, 0, __bss_end - __bss_start); } void board_boot_order(u32 *spl_boot_list) diff --git a/board/ge/bx50v3/Makefile b/board/ge/bx50v3/Makefile index bcd149f5b0..2fff27bc77 100644 --- a/board/ge/bx50v3/Makefile +++ b/board/ge/bx50v3/Makefile @@ -5,4 +5,4 @@ # SPDX-License-Identifier: GPL-2.0+ # -obj-y := bx50v3.o +obj-y := bx50v3.o vpd_reader.o diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c index b25c634bb5..c7df4ce847 100644 --- a/board/ge/bx50v3/bx50v3.c +++ b/board/ge/bx50v3/bx50v3.c @@ -26,8 +26,19 @@ #include <asm/arch/sys_proto.h> #include <i2c.h> #include <pwm.h> +#include <stdlib.h> +#include "vpd_reader.h" DECLARE_GLOBAL_DATA_PTR; +#ifndef CONFIG_SYS_I2C_EEPROM_ADDR +# define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 +# define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 +#endif + +#ifndef CONFIG_SYS_I2C_EEPROM_BUS +#define CONFIG_SYS_I2C_EEPROM_BUS 2 +#endif + #define NC_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \ PAD_CTL_HYS) @@ -528,6 +539,102 @@ int overwrite_console(void) return 1; } +#define VPD_TYPE_INVALID 0x00 +#define VPD_BLOCK_NETWORK 0x20 +#define VPD_BLOCK_HWID 0x44 +#define VPD_PRODUCT_B850 1 +#define VPD_PRODUCT_B650 2 +#define VPD_PRODUCT_B450 3 + +struct vpd_cache { + uint8_t product_id; + uint8_t macbits; + unsigned char mac1[6]; +}; + +/* + * Extracts MAC and product information from the VPD. + */ +static int vpd_callback( + void *userdata, + uint8_t id, + uint8_t version, + uint8_t type, + size_t size, + uint8_t const *data) +{ + struct vpd_cache *vpd = (struct vpd_cache *)userdata; + + if ( id == VPD_BLOCK_HWID + && version == 1 + && type != VPD_TYPE_INVALID + && size >= 1) { + vpd->product_id = data[0]; + + } else if ( id == VPD_BLOCK_NETWORK + && version == 1 + && type != VPD_TYPE_INVALID + && size >= 6) { + vpd->macbits |= 1; + memcpy(vpd->mac1, data, 6); + } + + return 0; +} + +static void set_eth0_mac_address(unsigned char * mac) +{ + uint32_t *ENET_TCR = (uint32_t*)0x21880c4; + uint32_t *ENET_PALR = (uint32_t*)0x21880e4; + uint32_t *ENET_PAUR = (uint32_t*)0x21880e8; + + *ENET_TCR |= 0x100; /* ADDINS */ + *ENET_PALR |= (mac[0] << 24) | (mac[1] << 16) | (mac[2] << 8) | mac[3]; + *ENET_PAUR |= (mac[4] << 24) | (mac[5] << 16); +} + +static void process_vpd(struct vpd_cache *vpd) +{ + if ( vpd->product_id == VPD_PRODUCT_B850 + || vpd->product_id == VPD_PRODUCT_B650 + || vpd->product_id == VPD_PRODUCT_B450) { + if (vpd->macbits & 1) { + set_eth0_mac_address(vpd->mac1); + } + } +} + +static int read_vpd(uint eeprom_bus) +{ + struct vpd_cache vpd; + int res; + int size = 1024; + uint8_t *data; + unsigned int current_i2c_bus = i2c_get_bus_num(); + + res = i2c_set_bus_num(eeprom_bus); + if (res < 0) + return res; + + data = (uint8_t *)malloc(size); + if (!data) + return -ENOMEM; + + res = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, data, size); + + if (res == 0) { + memset(&vpd, 0, sizeof(vpd)); + vpd_reader(size, data, &vpd, vpd_callback); + process_vpd(&vpd); + } + + free(data); + + i2c_set_bus_num(current_i2c_bus); + return res; +} + int board_eth_init(bd_t *bis) { setup_iomux_enet(); @@ -586,6 +693,8 @@ int board_init(void) setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2); setup_i2c(3, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info3); + read_vpd(CONFIG_SYS_I2C_EEPROM_BUS); + return 0; } diff --git a/board/ge/bx50v3/vpd_reader.c b/board/ge/bx50v3/vpd_reader.c new file mode 100644 index 0000000000..98da893d2c --- /dev/null +++ b/board/ge/bx50v3/vpd_reader.c @@ -0,0 +1,228 @@ +/* + * Copyright 2016 General Electric Company + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include "vpd_reader.h" + +#include <linux/bch.h> +#include <stdlib.h> + + +/* BCH configuration */ + +const struct { + int header_ecc_capability_bits; + int data_ecc_capability_bits; + unsigned int prim_poly; + struct { + int min; + int max; + } galois_field_order; +} bch_configuration = { + .header_ecc_capability_bits = 4, + .data_ecc_capability_bits = 16, + .prim_poly = 0, + .galois_field_order = { + .min = 5, + .max = 15, + }, +}; + +static int calculate_galois_field_order(size_t source_length) +{ + int gfo = bch_configuration.galois_field_order.min; + + for (; gfo < bch_configuration.galois_field_order.max && + ((((1 << gfo) - 1) - ((int)source_length * 8)) < 0); + gfo++) { + } + + if (gfo == bch_configuration.galois_field_order.max) { + return -1; + } + + return gfo + 1; +} + +static int verify_bch(int ecc_bits, unsigned int prim_poly, + uint8_t * data, size_t data_length, + const uint8_t * ecc, size_t ecc_length) +{ + int gfo = calculate_galois_field_order(data_length); + if (gfo < 0) { + return -1; + } + + struct bch_control * bch = init_bch(gfo, ecc_bits, prim_poly); + if (!bch) { + return -1; + } + + if (bch->ecc_bytes != ecc_length) { + free_bch(bch); + return -1; + } + + unsigned * errloc = (unsigned *)calloc(data_length, sizeof(unsigned)); + int errors = decode_bch( + bch, data, data_length, ecc, NULL, NULL, errloc); + free_bch(bch); + if (errors < 0) { + free(errloc); + return -1; + } + + if (errors > 0) { + for (int n = 0; n < errors; n++) { + if (errloc[n] >= 8 * data_length) { + /* n-th error located in ecc (no need for data correction) */ + } else { + /* n-th error located in data */ + data[errloc[n] / 8] ^= 1 << (errloc[n] % 8); + } + } + } + + free(errloc); + return 0; +} + + +static const int ID = 0; +static const int LEN = 1; +static const int VER = 2; +static const int TYP = 3; +static const int BLOCK_SIZE = 4; + +static const uint8_t HEADER_BLOCK_ID = 0x00; +static const uint8_t HEADER_BLOCK_LEN = 18; +static const uint32_t HEADER_BLOCK_MAGIC = 0xca53ca53; +static const size_t HEADER_BLOCK_VERIFY_LEN = 14; +static const size_t HEADER_BLOCK_ECC_OFF = 14; +static const size_t HEADER_BLOCK_ECC_LEN = 4; + +static const uint8_t ECC_BLOCK_ID = 0xFF; + +int vpd_reader( + size_t size, + uint8_t * data, + void * userdata, + int (*fn)( + void * userdata, + uint8_t id, + uint8_t version, + uint8_t type, + size_t size, + uint8_t const * data)) +{ + if ( size < HEADER_BLOCK_LEN + || data == NULL + || fn == NULL) { + return -EINVAL; + } + + /* + * +--------------------+--------------------+--//--+--------------------+ + * | header block | data block | ... | ecc block | + * +--------------------+--------------------+--//--+--------------------+ + * : : : + * +------+-------+-----+ +------+-------------+ + * | id | magic | ecc | | ... | ecc | + * | len | off | | +------+-------------+ + * | ver | size | | : + * | type | | | : + * +------+-------+-----+ : + * : : : : + * <----- [1] ----> <----------- [2] -----------> + * + * Repair (if necessary) the contents of header block [1] by using a + * 4 byte ECC located at the end of the header block. A successful + * return value means that we can trust the header. + */ + int ret = verify_bch( + bch_configuration.header_ecc_capability_bits, + bch_configuration.prim_poly, + data, + HEADER_BLOCK_VERIFY_LEN, + &data[HEADER_BLOCK_ECC_OFF], + HEADER_BLOCK_ECC_LEN); + if (ret < 0) { + return ret; + } + + /* Validate header block { id, length, version, type }. */ + if ( data[ID] != HEADER_BLOCK_ID + || data[LEN] != HEADER_BLOCK_LEN + || data[VER] != 0 + || data[TYP] != 0 + || ntohl(*(uint32_t *)(&data[4])) != HEADER_BLOCK_MAGIC) { + return -EINVAL; + } + + uint32_t offset = ntohl(*(uint32_t *)(&data[8])); + uint16_t size_bits = ntohs(*(uint16_t *)(&data[12])); + + /* Check that ECC header fits. */ + if (offset + 3 >= size) { + return -EINVAL; + } + + /* Validate ECC block. */ + uint8_t * ecc = &data[offset]; + if ( ecc[ID] != ECC_BLOCK_ID + || ecc[LEN] < BLOCK_SIZE + || ecc[LEN] + offset > size + || ecc[LEN] - BLOCK_SIZE != size_bits / 8 + || ecc[VER] != 1 + || ecc[TYP] != 1) { + return -EINVAL; + } + + /* + * Use the header block to locate the ECC block and verify the data + * blocks [2] against the ecc block ECC. + */ + ret = verify_bch( + bch_configuration.data_ecc_capability_bits, + bch_configuration.prim_poly, + &data[data[LEN]], + offset - data[LEN], + &data[offset + BLOCK_SIZE], + ecc[LEN] - BLOCK_SIZE); + if (ret < 0) { + return ret; + } + + /* Stop after ECC. Ignore possible zero padding. */ + size = offset; + + for (;;) { + /* Move to next block. */ + size -= data[LEN]; + data += data[LEN]; + + if (size == 0) { + /* Finished iterating through blocks. */ + return 0; + } + + if ( size < BLOCK_SIZE + || data[LEN] < BLOCK_SIZE) { + /* Not enough data for a header, or short header. */ + return -EINVAL; + } + + ret = fn( + userdata, + data[ID], + data[VER], + data[TYP], + data[LEN] - BLOCK_SIZE, + &data[BLOCK_SIZE]); + if (ret) { + return ret; + } + } +} diff --git a/board/ge/bx50v3/vpd_reader.h b/board/ge/bx50v3/vpd_reader.h new file mode 100644 index 0000000000..efa172a915 --- /dev/null +++ b/board/ge/bx50v3/vpd_reader.h @@ -0,0 +1,25 @@ +/* + * Copyright 2016 General Electric Company + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include "common.h" + +/* + * Read VPD from given data, verify content, and call callback + * for each vital product data block. + * + * Returns Non-zero on error. Negative numbers encode errno. + */ +int vpd_reader( + size_t size, + uint8_t * data, + void * userdata, + int (*fn)( + void * userdata, + uint8_t id, + uint8_t version, + uint8_t type, + size_t size, + uint8_t const * data)); diff --git a/board/kosagi/novena/novena_spl.c b/board/kosagi/novena/novena_spl.c index 512f06da76..b4a68da88f 100644 --- a/board/kosagi/novena/novena_spl.c +++ b/board/kosagi/novena/novena_spl.c @@ -596,10 +596,4 @@ void board_init_f(ulong dummy) udelay(100); mmdc_do_write_level_calibration(&novena_ddr_info); mmdc_do_dqs_calibration(&novena_ddr_info); - - /* Clear the BSS. */ - memset(__bss_start, 0, __bss_end - __bss_start); - - /* load/boot image from boot device */ - board_init_r(NULL, 0); } diff --git a/board/liebherr/mccmon6/spl.c b/board/liebherr/mccmon6/spl.c index a2f804db8f..196da46df9 100644 --- a/board/liebherr/mccmon6/spl.c +++ b/board/liebherr/mccmon6/spl.c @@ -296,11 +296,5 @@ void board_init_f(ulong dummy) /* DDR initialization */ spl_dram_init(); - - /* Clear the BSS. */ - memset(__bss_start, 0, __bss_end - __bss_start); - - /* load/boot image from boot device */ - board_init_r(NULL, 0); } #endif diff --git a/board/logicpd/am3517evm/am3517evm.c b/board/logicpd/am3517evm/am3517evm.c index c18a5a3140..29f136a530 100644 --- a/board/logicpd/am3517evm/am3517evm.c +++ b/board/logicpd/am3517evm/am3517evm.c @@ -12,6 +12,8 @@ */ #include <common.h> +#include <dm.h> +#include <ns16550.h> #include <asm/io.h> #include <asm/omap_musb.h> #include <asm/arch/am35x_def.h> @@ -34,6 +36,22 @@ DECLARE_GLOBAL_DATA_PTR; #define AM3517_IP_SW_RESET 0x48002598 #define CPGMACSS_SW_RST (1 << 1) +#define PHY_GPIO 30 + +/* This is only needed until SPL gets OF support */ +#ifdef CONFIG_SPL_BUILD +static const struct ns16550_platdata am3517_serial = { + .base = OMAP34XX_UART3, + .reg_shift = 2, + .clock = V_NS16550_CLK, + .fcr = UART_FCR_DEFVAL, +}; + +U_BOOT_DEVICE(am3517_uart) = { + "ns16550_serial", + &am3517_serial +}; +#endif /* * Routine: board_init @@ -113,30 +131,35 @@ int misc_init_r(void) am3517_evm_musb_init(); - /* activate PHY reset */ - gpio_direction_output(30, 0); - gpio_set_value(30, 0); - - ctr = 0; - do { - udelay(1000); - ctr++; - } while (ctr < 300); - - /* deactivate PHY reset */ - gpio_set_value(30, 1); - - /* allow the PHY to stabilize and settle down */ - ctr = 0; - do { - udelay(1000); - ctr++; - } while (ctr < 300); - - /* ensure that the module is out of reset */ - reset = readl(AM3517_IP_SW_RESET); - reset &= (~CPGMACSS_SW_RST); - writel(reset,AM3517_IP_SW_RESET); + if (gpio_request(PHY_GPIO, "gpio_30") == 0) { + /* activate PHY reset */ + gpio_direction_output(PHY_GPIO, 0); + gpio_set_value(PHY_GPIO, 0); + + ctr = 0; + do { + udelay(1000); + ctr++; + } while (ctr < 300); + + /* deactivate PHY reset */ + gpio_set_value(PHY_GPIO, 1); + + /* allow the PHY to stabilize and settle down */ + ctr = 0; + do { + udelay(1000); + ctr++; + } while (ctr < 300); + + /* ensure that the module is out of reset */ + reset = readl(AM3517_IP_SW_RESET); + reset &= (~CPGMACSS_SW_RST); + writel(reset, AM3517_IP_SW_RESET); + + /* Free requested GPIO */ + gpio_free(PHY_GPIO); + } return 0; } diff --git a/board/solidrun/clearfog/README b/board/solidrun/clearfog/README index 2cfa5bfc86..ef1e3bf426 100644 --- a/board/solidrun/clearfog/README +++ b/board/solidrun/clearfog/README @@ -16,3 +16,23 @@ $ sudo dd if=u-boot-spl.kwb of=/dev/sdX bs=512 seek=1 Please use the correct device node for your setup instead of "/dev/sdX" here! + +Boot from UART: +--------------- + +Connect the on-board micro-USB (CF Pro: CON11, CF Base: CON5) +to your host. + +Set the SW1 DIP switches to UART boot (0: OFF, 1: ON): + + ClearFog Base: 01001 + ClearFog Pro: 11110 + +Run the following command to initiate U-Boot download: + + ./tools/kwboot -b u-boot-spl.kwb /dev/ttyUSBX + +Use the correct UART device node for /dev/ttyUSBX. + +When download finishes start your favorite terminal emulator +on /dev/ttyUSBX. diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c index 986abc5772..1e4da4a6b1 100644 --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c @@ -349,6 +349,7 @@ static bool is_hummingboard(void) * Machine selection - * Machine val1, val2 * ------------------------- + * HB2 x x * HB rev 3.x x 0 * CBi 0 1 * HB 1 1 @@ -362,9 +363,37 @@ static bool is_hummingboard(void) return true; } +static bool is_hummingboard2(void) +{ + int val1; + + SETUP_IOMUX_PADS(hb_cbi_sense); + + gpio_direction_input(IMX_GPIO_NR(2, 8)); + + val1 = gpio_get_value(IMX_GPIO_NR(2, 8)); + + /* + * Machine selection - + * Machine val1 + * ------------------- + * HB2 0 + * HB rev 3.x x + * CBi x + * HB x + */ + + if (val1 == 0) + return true; + else + return false; +} + int checkboard(void) { - if (is_hummingboard()) + if (is_hummingboard2()) + puts("Board: MX6 Hummingboard2\n"); + else if (is_hummingboard()) puts("Board: MX6 Hummingboard\n"); else puts("Board: MX6 Cubox-i\n"); @@ -375,7 +404,9 @@ int checkboard(void) int board_late_init(void) { #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG - if (is_hummingboard()) + if (is_hummingboard2()) + env_set("board_name", "HUMMINGBOARD2"); + else if (is_hummingboard()) env_set("board_name", "HUMMINGBOARD"); else env_set("board_name", "CUBOXI"); diff --git a/board/st/stih410-b2260/board.c b/board/st/stih410-b2260/board.c index 92b0695593..d6cbbb866a 100644 --- a/board/st/stih410-b2260/board.c +++ b/board/st/stih410-b2260/board.c @@ -7,6 +7,10 @@ */ #include <common.h> +#include <linux/usb/otg.h> +#include <dwc3-sti-glue.h> +#include <dwc3-uboot.h> +#include <usb.h> DECLARE_GLOBAL_DATA_PTR; @@ -36,3 +40,41 @@ int board_init(void) { return 0; } + +#ifdef CONFIG_USB_DWC3 +static struct dwc3_device dwc3_device_data = { + .maximum_speed = USB_SPEED_HIGH, + .dr_mode = USB_DR_MODE_PERIPHERAL, + .index = 0, +}; + +int usb_gadget_handle_interrupts(int index) +{ + dwc3_uboot_handle_interrupt(index); + return 0; +} + +int board_usb_init(int index, enum usb_init_type init) +{ + int node; + const void *blob = gd->fdt_blob; + + /* find the snps,dwc3 node */ + node = fdt_node_offset_by_compatible(blob, -1, "snps,dwc3"); + + dwc3_device_data.base = fdtdec_get_addr(blob, node, "reg"); + + return dwc3_uboot_init(&dwc3_device_data); +} + +int board_usb_cleanup(int index, enum usb_init_type init) +{ + dwc3_uboot_exit(index); + return 0; +} + +int g_dnl_board_usb_cable_connected(void) +{ + return 1; +} +#endif diff --git a/board/st/stm32h743-disco/Kconfig b/board/st/stm32h743-disco/Kconfig new file mode 100644 index 0000000000..7d6ec1d958 --- /dev/null +++ b/board/st/stm32h743-disco/Kconfig @@ -0,0 +1,19 @@ +if TARGET_STM32H743_DISCO + +config SYS_BOARD + string + default "stm32h743-disco" + +config SYS_VENDOR + string + default "st" + +config SYS_SOC + string + default "stm32h7" + +config SYS_CONFIG_NAME + string + default "stm32h743-disco" + +endif diff --git a/board/st/stm32h743-disco/MAINTAINERS b/board/st/stm32h743-disco/MAINTAINERS new file mode 100644 index 0000000000..e5e0b5a6f2 --- /dev/null +++ b/board/st/stm32h743-disco/MAINTAINERS @@ -0,0 +1,7 @@ +STM32H743 DISCOVERY BOARD +M: Patrice Chotard <patrice.chotard@st.com> +S: Maintained +F: board/st/stm32h743-disco +F: include/configs/stm32h743-disco.h +F: configs/stm32h743-disco_defconfig +F: arch/arm/dts/stm32h7* diff --git a/board/st/stm32h743-disco/Makefile b/board/st/stm32h743-disco/Makefile new file mode 100644 index 0000000000..778fe1c97f --- /dev/null +++ b/board/st/stm32h743-disco/Makefile @@ -0,0 +1,8 @@ +# +# Copyright (C) STMicroelectronics SA 2017 +# Author(s): Patrice CHOTARD, <patrice.chotard@st.com> for STMicroelectronics.# +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := stm32h743-disco.o diff --git a/board/st/stm32h743-disco/stm32h743-disco.c b/board/st/stm32h743-disco/stm32h743-disco.c new file mode 100644 index 0000000000..625b3a077b --- /dev/null +++ b/board/st/stm32h743-disco/stm32h743-disco.c @@ -0,0 +1,56 @@ +/* + * Copyright (C) STMicroelectronics SA 2017 + * Author(s): Patrice CHOTARD, <patrice.chotard@st.com> for STMicroelectronics. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <dm.h> + +DECLARE_GLOBAL_DATA_PTR; + +int dram_init(void) +{ + struct udevice *dev; + int ret; + + ret = uclass_get_device(UCLASS_RAM, 0, &dev); + if (ret) { + debug("DRAM init failed: %d\n", ret); + return ret; + } + + if (fdtdec_setup_memory_size() != 0) + ret = -EINVAL; + + return ret; +} + +int dram_init_banksize(void) +{ + fdtdec_setup_memory_banksize(); + + return 0; +} + +int board_early_init_f(void) +{ + return 0; +} + +u32 get_board_rev(void) +{ + return 0; +} + +int board_late_init(void) +{ + return 0; +} + +int board_init(void) +{ + gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100; + return 0; +} diff --git a/board/st/stm32h743-eval/Kconfig b/board/st/stm32h743-eval/Kconfig new file mode 100644 index 0000000000..ea879b13c8 --- /dev/null +++ b/board/st/stm32h743-eval/Kconfig @@ -0,0 +1,19 @@ +if TARGET_STM32H743_EVAL + +config SYS_BOARD + string + default "stm32h743-eval" + +config SYS_VENDOR + string + default "st" + +config SYS_SOC + string + default "stm32h7" + +config SYS_CONFIG_NAME + string + default "stm32h743-eval" + +endif diff --git a/board/st/stm32h743-eval/MAINTAINERS b/board/st/stm32h743-eval/MAINTAINERS new file mode 100644 index 0000000000..3029c56023 --- /dev/null +++ b/board/st/stm32h743-eval/MAINTAINERS @@ -0,0 +1,6 @@ +STM32H743 EVALUATION BOARD +M: Patrice Chotard <patrice.chotard@st.com> +S: Maintained +F: board/st/stm32h743-eval +F: include/configs/stm32h743-eval.h +F: configs/stm32h743-eval_defconfig diff --git a/board/st/stm32h743-eval/Makefile b/board/st/stm32h743-eval/Makefile new file mode 100644 index 0000000000..4f25b2d96b --- /dev/null +++ b/board/st/stm32h743-eval/Makefile @@ -0,0 +1,8 @@ +# +# (C) Copyright 2017 +# Patrice Chotard, <patrice.chotard@st.com> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := stm32h743-eval.o diff --git a/board/st/stm32h743-eval/stm32h743-eval.c b/board/st/stm32h743-eval/stm32h743-eval.c new file mode 100644 index 0000000000..625b3a077b --- /dev/null +++ b/board/st/stm32h743-eval/stm32h743-eval.c @@ -0,0 +1,56 @@ +/* + * Copyright (C) STMicroelectronics SA 2017 + * Author(s): Patrice CHOTARD, <patrice.chotard@st.com> for STMicroelectronics. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <dm.h> + +DECLARE_GLOBAL_DATA_PTR; + +int dram_init(void) +{ + struct udevice *dev; + int ret; + + ret = uclass_get_device(UCLASS_RAM, 0, &dev); + if (ret) { + debug("DRAM init failed: %d\n", ret); + return ret; + } + + if (fdtdec_setup_memory_size() != 0) + ret = -EINVAL; + + return ret; +} + +int dram_init_banksize(void) +{ + fdtdec_setup_memory_banksize(); + + return 0; +} + +int board_early_init_f(void) +{ + return 0; +} + +u32 get_board_rev(void) +{ + return 0; +} + +int board_late_init(void) +{ + return 0; +} + +int board_init(void) +{ + gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100; + return 0; +} diff --git a/board/technexion/pico-imx7d/README b/board/technexion/pico-imx7d/README index a2805ee080..8af4effa78 100644 --- a/board/technexion/pico-imx7d/README +++ b/board/technexion/pico-imx7d/README @@ -47,3 +47,20 @@ Remove power from the pico board. Put pico board into normal boot mode. Power up the board and the new updated U-Boot should boot from eMMC. + +Building U-Boot to boot with NXP 4.1 kernel: + +The NXP 4.1 kernel boots only in secure boot mode on mx7. + +Follow the next steps to enable secure boot: + +$ make mrproper +$ make pico-imx7d_defconfig +$ make menuconfig + -> ARM architecture + -> [*] Enable support for booting in non-secure mode + -> [*] Boot in secure mode by default + -> Exit +$ make + +Flash u-boot.imx using the imx_usb_loader tool. diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c index b4c9be7378..67bab51dfd 100644 --- a/board/technexion/pico-imx7d/pico-imx7d.c +++ b/board/technexion/pico-imx7d/pico-imx7d.c @@ -182,7 +182,7 @@ static int setup_fec(void) (IOMUXC_GPR_GPR1_GPR_ENET1_TX_CLK_SEL_MASK | IOMUXC_GPR_GPR1_GPR_ENET1_CLK_DIR_MASK), 0); - return set_clk_enet(ENET_125MHz); + return set_clk_enet(ENET_125MHZ); } int board_phy_config(struct phy_device *phydev) diff --git a/board/theadorable/MAINTAINERS b/board/theadorable/MAINTAINERS index 5ae6b6487c..1e8df93d37 100644 --- a/board/theadorable/MAINTAINERS +++ b/board/theadorable/MAINTAINERS @@ -4,4 +4,3 @@ S: Maintained F: board/theadorable/ F: include/configs/theadorable.h F: configs/theadorable_debug_defconfig -F: configs/theadorable_defconfig diff --git a/board/theobroma-systems/lion_rk3368/README b/board/theobroma-systems/lion_rk3368/README index 47304fcba6..83e4332984 100644 --- a/board/theobroma-systems/lion_rk3368/README +++ b/board/theobroma-systems/lion_rk3368/README @@ -26,12 +26,32 @@ Build the full U-Boot and a FIT image including the ATF > make CROSS_COMPILE=aarch64-unknown-elf- ARCH=arm u-boot.itb -Write to a SD-card -================== +Flash the image +=============== + +Copy the SPL to offset 32k and the FIT image containing the payloads +(U-Boot proper, ATF, devicetree) to offset 256k card. + +SD-Card +------- > dd if=spl-3368.img of=/dev/sdb seek=64 > dd if=u-boot.itb of=/dev/sdb seek=512 +eMMC +---- + +rkdeveloptool allows to flash the on-board eMMC via the USB OTG interface with +help of the Rockchip loader binary. + + > git clone https://github.com/rockchip-linux/rkdeveloptool + > cd rkdeveloptool + > autoreconf -i && && ./configure && make + > git clone https://github.com/rockchip-linux/rkbin.git + > ./rkdeveloptool db rkbin/rk33/rk3368_loader_v2.00.256.bin + > ./rkdeveloptool wl 64 ../spl.img + > ./rkdeveloptool wl 512 ../u-boot.itb + If everything went according to plan, you should see the following output on UART0: diff --git a/board/theobroma-systems/puma_rk3399/README b/board/theobroma-systems/puma_rk3399/README index 214281a329..f67dfb451f 100644 --- a/board/theobroma-systems/puma_rk3399/README +++ b/board/theobroma-systems/puma_rk3399/README @@ -55,18 +55,53 @@ Compile the U-Boot Package the image ================= - > tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl.bin spl.img - > make CROSS_COMPILE=aarch64-linux-gnu- u-boot.itb +Creating a SPL image for SD-Card/eMMC + > tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl.bin spl_mmc.img +Creating a SPL image for SPI-NOR + > tools/mkimage -n rk3399 -T rkspi -d spl/u-boot-spl.bin spl_nor.img +Create the FIT image containing U-Boot proper, ATF, M0 Firmware, devicetree + > make CROSS_COMPILE=aarch64-linux-gnu- u-boot.itb Flash the image =============== -Copy the SPL to offset 32k and the FIT image containing the payloads -(U-Boot proper, ATF, M0 Firmware, devicetree) to offset 256k on a SD -card. +Copy the SPL to offset 32k for SD/eMMC, offset 0 for NOR-Flash and the FIT +image to offset 256k card. - > dd if=spl.img of=/dev/sdb seek=64 +SD-Card +------- + + > dd if=spl_mmc.img of=/dev/sdb seek=64 > dd if=u-boot.itb of=/dev/sdb seek=512 -After powering up the board (with the inserted SD card), you should see -a U-Boot console on UART0 (115200n8). +eMMC +---- + +rkdeveloptool allows to flash the on-board eMMC via the USB OTG interface with +help of the Rockchip loader binary. + + > git clone https://github.com/rockchip-linux/rkdeveloptool + > cd rkdeveloptool + > autoreconf -i && ./configure && make + > git clone https://github.com/rockchip-linux/rkbin.git + > ./rkdeveloptool db rkbin/rk33/rk3399_loader_v1.08.106.bin + > ./rkdeveloptool wl 64 ../spl_mmc.img + > ./rkdeveloptool wl 512 ../u-boot.itb + +NOR-Flash +--------- + +Writing the SPI NOR Flash requires a running U-Boot. For the sake of simplicity +we assume you have a SD-Card with a partition containing the required files +ready. + + > load mmc 1:1 ${kernel_addr_r} spl_nor.img + > sf probe + > sf erase 0 +$filesize + > sf write $kernel_addr_r 0 ${filesize} + > load mmc 1:1 ${kernel_addr_r} u-boot.itb + > sf erase 0x40000 +$filesize + > sf write $kernel_addr_r 0x40000 ${filesize} + + +Reboot the system and you should see a U-Boot console on UART0 (115200n8). diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c index c6f8eed0c9..45d56cd99e 100644 --- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c +++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c @@ -107,7 +107,7 @@ static void setup_serial(void) u8 low[cpuid_length/2], high[cpuid_length/2]; char cpuid_str[cpuid_length * 2 + 1]; u64 serialno; - char serialno_str[16]; + char serialno_str[17]; /* retrieve the device */ ret = uclass_get_device_by_driver(UCLASS_MISC, diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c index ebc6c12cbc..628a61dae0 100644 --- a/board/toradex/apalis_imx6/apalis_imx6.c +++ b/board/toradex/apalis_imx6/apalis_imx6.c @@ -29,7 +29,6 @@ #include <dm/platform_data/serial_mxc.h> #include <dm/platdata.h> #include <fsl_esdhc.h> -#include <g_dnl.h> #include <i2c.h> #include <imx_thermal.h> #include <linux/errno.h> @@ -1224,18 +1223,6 @@ void reset_cpu(ulong addr) { } -#ifdef CONFIG_SPL_USB_GADGET_SUPPORT -int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) -{ - unsigned short usb_pid; - - usb_pid = TORADEX_USB_PRODUCT_NUM_OFFSET + 0xfff; - put_unaligned(usb_pid, &dev->idProduct); - - return 0; -} -#endif - #endif static struct mxc_serial_platdata mxc_serial_plat = { diff --git a/board/toradex/colibri_imx6/colibri_imx6.c b/board/toradex/colibri_imx6/colibri_imx6.c index 669d9123ca..756e3f39df 100644 --- a/board/toradex/colibri_imx6/colibri_imx6.c +++ b/board/toradex/colibri_imx6/colibri_imx6.c @@ -28,7 +28,6 @@ #include <dm/platform_data/serial_mxc.h> #include <dm/platdata.h> #include <fsl_esdhc.h> -#include <g_dnl.h> #include <i2c.h> #include <imx_thermal.h> #include <linux/errno.h> @@ -1108,18 +1107,6 @@ void reset_cpu(ulong addr) { } -#ifdef CONFIG_SPL_USB_GADGET_SUPPORT -int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) -{ - unsigned short usb_pid; - - usb_pid = TORADEX_USB_PRODUCT_NUM_OFFSET + 0xfff; - put_unaligned(usb_pid, &dev->idProduct); - - return 0; -} -#endif - #endif static struct mxc_serial_platdata mxc_serial_plat = { diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c index 5cb14b43de..13b2b5785b 100644 --- a/board/toradex/colibri_imx7/colibri_imx7.c +++ b/board/toradex/colibri_imx7/colibri_imx7.c @@ -280,7 +280,7 @@ static int setup_fec(void) IOMUXC_GPR_GPR1_GPR_ENET1_TX_CLK_SEL_MASK); #endif - return set_clk_enet(ENET_50MHz); + return set_clk_enet(ENET_50MHZ); } int board_phy_config(struct phy_device *phydev) diff --git a/board/udoo/udoo_spl.c b/board/udoo/udoo_spl.c index 3645969e43..694055bd2e 100644 --- a/board/udoo/udoo_spl.c +++ b/board/udoo/udoo_spl.c @@ -252,11 +252,5 @@ void board_init_f(ulong dummy) /* DDR initialization */ spl_dram_init(); - - /* Clear the BSS. */ - memset(__bss_start, 0, __bss_end - __bss_start); - - /* load/boot image from boot device */ - board_init_r(NULL, 0); } #endif diff --git a/board/wandboard/spl.c b/board/wandboard/spl.c index 99a02865ec..00c75d0682 100644 --- a/board/wandboard/spl.c +++ b/board/wandboard/spl.c @@ -300,11 +300,5 @@ void board_init_f(ulong dummy) /* DDR initialization */ spl_dram_init(); - - /* Clear the BSS. */ - memset(__bss_start, 0, __bss_end - __bss_start); - - /* load/boot image from boot device */ - board_init_r(NULL, 0); } #endif |