From ce70a04c333b3bf8c3e39b5f05bffcd953493a12 Mon Sep 17 00:00:00 2001 From: Rene Straub Date: Thu, 27 Feb 2020 14:10:43 +0100 Subject: [PATCH] nrhw: sync with NRSW, dualcan-passive shield fixes BugzId: 61778 --- board/nm/common/da9063.h | 4 - board/nm/nmhw21/Kconfig | 2 +- board/nm/nmhw21/board.c | 152 ++++++++++++++++++++++++++++++-- board/nm/nrhw20/board.c | 94 ++++++++++++-------- board/nm/nrhw20/shield.c | 1 + board/nm/nrhw20/shield_can.c | 23 ++++- board/nm/nrhw20/shield_can.h | 1 + board/nm/nrhw24/board.c | 66 ++++++++++---- board/nm/nrhw24/shield.c | 1 + board/nm/nrhw24/shield_can.c | 23 ++++- board/nm/nrhw24/shield_can.h | 1 + common/main.c | 9 +- common/spl/spl.c | 6 +- drivers/i2c/omap24xx_i2c.c | 6 +- drivers/serial/serial-uclass.c | 3 - include/configs/am335x_nrhw24.h | 5 +- lib/display_options.c | 21 +++++ 17 files changed, 334 insertions(+), 84 deletions(-) diff --git a/board/nm/common/da9063.h b/board/nm/common/da9063.h index ee8ceb635b..78706e0a7d 100644 --- a/board/nm/common/da9063.h +++ b/board/nm/common/da9063.h @@ -11,10 +11,6 @@ #ifndef DA9063_H #define DA9063_H -/* -TODO: Add include for uint32_t (stdtypes.h) -#include -*/ #define CONFIG_PMIC_I2C_BUS 0 #define CONFIG_PMIC_I2C_ADDR 0x58 /* Pages 0 and 1, Pages 2 and 3 -> 0x59 */ diff --git a/board/nm/nmhw21/Kconfig b/board/nm/nmhw21/Kconfig index 303535aa86..34d73e76df 100644 --- a/board/nm/nmhw21/Kconfig +++ b/board/nm/nmhw21/Kconfig @@ -15,7 +15,7 @@ config SYS_CONFIG_NAME config CONS_INDEX int "UART used for console" range 1 6 - default 3 + default 3 help The AM335x SoC has a total of 6 UARTs (UART0 to UART5 as referenced in documentation, etc) available to it. Depending on your specific diff --git a/board/nm/nmhw21/board.c b/board/nm/nmhw21/board.c index 9f2f07cc31..1ba63a67ce 100644 --- a/board/nm/nmhw21/board.c +++ b/board/nm/nmhw21/board.c @@ -217,6 +217,8 @@ static void set_indicator_led(int red, int green) gpio_set_value(GPIO_LED1_GREEN, green); } +#ifndef CONFIG_NRSW_BUILD + static void ui_set_status_led(int red, int green) { ui_set_top_led(red, green); @@ -227,6 +229,8 @@ static void ui_set_indicator_led(int red, int green) ui_set_bottom_led(red, green); } +#endif + static void init_i2c(void) { i2c_set_bus_num(0); @@ -253,6 +257,14 @@ static int _bd_init(void) return -1; } +#ifdef CONFIG_NRSW_BUILD + /* TODO: Check if we can get rid of this descriptor and use eMMC partition table */ + if (bd_get_context(&bdctx[2], BD_EEPROM_ADDR, PARTITION_ADDRESS) != 0) { + printf("%s() no valid partition table found\n", __func__); + return -1; + } +#endif + bd_register_context_list(bdctx, ARRAY_SIZE(bdctx)); i2c_set_bus_num(old_bus); @@ -515,12 +527,17 @@ void am33xx_spl_board_init(void) set_status_led(1, 0); /* Red */ set_indicator_led(1, 0); /* Red */ +#ifndef CONFIG_NRSW_BUILD + /* UI detection */ REQUEST_AND_SET_GPIO(GPIO_RST_UI_N); ui_init(CONFIG_UI_I2C_BUS); ui_set_status_led(1, 0); /* Red */ ui_set_indicator_led(1, 0); /* Red */ + +#endif + /* Set MPU Frequency to what we detected now that voltages are set */ do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100); @@ -715,6 +732,8 @@ static void init_usb_hub(void) gpio_set_value(GPIO_RST_USB_HUB_N, 1); } +#ifndef CONFIG_NRSW_BUILD + static void init_user_module(void) { int bus; @@ -756,10 +775,12 @@ static void init_user_module(void) } } +#endif + static void init_sim_mux(void) { /* - * Switch onboard SIM to onboard modem (Mux = 1) + * Switch pluggable micro SIM to onboard modem (mux = 1) */ REQUEST_AND_SET_GPIO(GPIO_SIM_SEL); @@ -798,20 +819,50 @@ static void init_gsm(void) * 4.2.8 PWR_ON pin * 4.2.9 RESET_N pin * - * Functionality: + * Functionality Yocto: * - Leave GSM power enable as is (default at power up = off) * - Set reset line inactive (note: inverter logic in HW present) * - Leave button unpressed (note: inverter logic in HW present) * - Modem shall be enabled by Linux system by enabling GSM power * supply */ +#ifdef CONFIG_NRSW_BUILD + int bus; puts("GSM: "); + bus = da9063_claim_i2c_bus(); + + /* TODO: Keep Power-On and use GSM Modem Reset Signal to restart */ + + REQUEST_AND_SET_GPIO(GPIO_RST_GSM); /* Assert reset (active high) */ + REQUEST_AND_CLEAR_GPIO(GPIO_PWR_GSM); /* Keep power switch inactive (released) */ + + da9063_set_gpio(PMIC_GSM_SUPPLY_EN_IO, 0); /* Switch GSM Supply off */ + mdelay(30+100); /* Give time to discharge supply */ + /* Keep of for 100ms, #3.3.2 */ + + da9063_set_gpio(PMIC_GSM_SUPPLY_EN_IO, 1); /* Enable GSM supply */ + mdelay(10); + + gpio_set_value(GPIO_RST_GSM, 0); /* Take modem out of reset */ + mdelay(300); /* Wait for power to stabilizy, #3.4.2 */ + + gpio_set_value(GPIO_PWR_GSM, 1); /* Generate power on event, #3.4.2 */ + mdelay(1200); + gpio_set_value(GPIO_PWR_GSM, 0); + + da9063_release_i2c_bus(bus); + + puts("ready\n"); +#else + puts("GSM: "); + REQUEST_AND_CLEAR_GPIO(GPIO_RST_GSM); /* Set reset inactive (active high) */ REQUEST_AND_CLEAR_GPIO(GPIO_PWR_GSM); /* Set power switch inactive/released (active high) */ puts("init\n"); +#endif } static void init_gnss(void) @@ -842,16 +893,21 @@ int board_init(void) da9063_init(CONFIG_PMIC_I2C_BUS); +#ifndef CONFIG_NRSW_BUILD /* UI detection */ REQUEST_AND_SET_GPIO(GPIO_RST_UI_N); ui_init(CONFIG_UI_I2C_BUS); +#endif /* Let user know we're starting */ init_leds(); set_status_led(1, 1); /* Orange */ set_indicator_led(0, 0); /* Off */ - ui_set_status_led(1, 1); /* Orange */ + +#ifndef CONFIG_NRSW_BUILD + ui_set_status_led(1, 1); /* Orange */ ui_set_indicator_led(0, 0); /* Off */ +#endif printf("OSC: %lu MHz\n", get_osclk()/1000000); @@ -870,6 +926,37 @@ void set_console(void) } } +#ifdef CONFIG_NRSW_BUILD + +static void set_devicetree_name(void) +{ + char devicetreename[64]; + + /* add hardware versions to environment */ + if (bd_get_devicetree(devicetreename, sizeof(devicetreename)) != 0) { + printf("Devicetree name not found, using default name\n"); + strcpy(devicetreename, "am335x-nmhw21-prod1.dtb"); + } + + setenv("fdt_image", devicetreename); +} + +static void set_root_partition(void) +{ + int boot_partition; + + /* add active root partition to environment */ + boot_partition = bd_get_boot_partition(); + if (boot_partition > 1) { + boot_partition = 0; + } + + /* mmcblk1p1 => root0, mmcblk1p2 => root1 so +1 */ + setenv_ulong("root_part", boot_partition + 1); +} + +#endif + static void get_variant_name(void) { bd_get_variantname(hw_variant_name, sizeof(hw_variant_name)); @@ -877,6 +964,26 @@ static void get_variant_name(void) printf("SYS: %s\n", hw_variant_name); } +#ifdef CONFIG_NRSW_BUILD + +static void get_hw_version(void) +{ + char hw_versions[16]; + char new_env[256]; /* current bootargs = 84 bytes */ + + bd_get_hw_version(&hw_ver, &hw_rev); + bd_get_hw_patch(&hw_patch); + + printf("HW21: V%d.%d\n", hw_ver, hw_rev); + + /* add hardware versions to environment */ + snprintf(hw_versions, sizeof(hw_versions), "CP=%d.%d", hw_ver, hw_rev); + snprintf(new_env, sizeof(new_env), "setenv bootargs $bootargs %s", hw_versions); + setenv("add_version_bootargs", new_env); +} + +#else + static void get_hw_version(void) { bd_get_hw_version(&hw_ver, &hw_rev); @@ -885,6 +992,8 @@ static void get_hw_version(void) printf("MB: V%d.%d\n", hw_ver, hw_rev); } +#endif + static void get_pmic_version(void) { uint8_t val = 0x00; @@ -921,7 +1030,10 @@ static void get_pmic_version(void) static void check_jtag_boot(void) { if (is_jtag_boot(CONFIG_JTAG_MARKER_UBOOT)) { + char *bootcmd = getenv("bootcmd"); setenv ("bootcmd", ""); + /* Save original bootcmd in "bootcmd_orig" to allow manual boot */ + setenv ("bootcmd_orig", bootcmd); puts("Detected JTAG boot. Waiting on command line\n"); } } @@ -970,21 +1082,31 @@ static void blink_led(int pulses) { const int pulse_width = 400*1000; /* 400ms */ +#ifdef CONFIG_NRSW_BUILD + /* Assumes status LED is orange */ + set_status_led(0, 0); + ui_set_top_led(0, 0); +#endif + while (pulses) { udelay(pulse_width); set_status_led(1, 1); +#ifndef CONFIG_NRSW_BUILD ui_set_status_led(1, 1); - +#endif udelay(pulse_width); set_status_led(0, 0); +#ifndef CONFIG_NRSW_BUILD ui_set_status_led(0, 0); - +#endif pulses--; } udelay(pulse_width); set_status_led(1, 1); /* Orange */ +#ifndef CONFIG_NRSW_BUILD ui_set_status_led(1, 1); +#endif } static void check_reset_button(void) @@ -1042,8 +1164,9 @@ static void check_reset_button(void) int board_late_init(void) { #if !defined(CONFIG_SPL_BUILD) +#ifndef CONFIG_NRSW_BUILD int ui_ver = -1; - +#endif if (read_eeprom() < 0) { puts("Could not get board ID.\n"); } @@ -1052,6 +1175,11 @@ int board_late_init(void) get_hw_version(); get_pmic_version(); +#ifdef CONFIG_NRSW_BUILD + set_root_partition(); + set_devicetree_name(); +#endif + /* Initialize pins */ REQUEST_AND_CLEAR_GPIO(GPIO_WLAN_EN); REQUEST_AND_CLEAR_GPIO(GPIO_BT_EN); @@ -1059,12 +1187,14 @@ int board_late_init(void) REQUEST_AND_SET_GPIO(CAN0_TERM_N); /* Unused on V2.0 */ REQUEST_AND_SET_GPIO(CAN1_TERM_N); +#ifndef CONFIG_NRSW_BUILD ui_ver = ui_version(); switch (ui_ver) { case 1: puts("UI: V1.0\n"); break; case 2: puts("UI: V2.0\n"); break; default: puts("UI: N/A\n"); break; } +#endif if (hw_ver == 1) { /* On HW v1.0 switch and PHYs share the same reset line. @@ -1099,7 +1229,9 @@ int board_late_init(void) } init_usb_hub(); +#ifndef CONFIG_NRSW_BUILD init_user_module(); +#endif init_sim_mux(); init_gsm(); init_gnss(); @@ -1113,8 +1245,10 @@ int board_late_init(void) set_status_led(1, 1); /* Orange */ set_indicator_led(0, 0); /* Off */ +#ifndef CONFIG_NRSW_BUILD set_status_led(1, 1); /* Orange */ set_indicator_led(0, 0); /* Off */ +#endif check_fct(); check_jtag_boot(); @@ -1311,6 +1445,8 @@ static void ft_hw_info(void *blob) } } +#ifndef CONFIG_NRSW_BUILD + static void ft_user_module(void *blob) { if (um_present()) { @@ -1402,6 +1538,8 @@ static void ft_user_interface(void *blob) } } +#endif + static void ft_eth(void *blob) { /* @@ -1434,8 +1572,10 @@ int ft_board_setup(void *blob, bd_t *bd) { ft_bootloader_version(blob); ft_hw_info(blob); +#ifndef CONFIG_NRSW_BUILD ft_user_interface(blob); ft_user_module(blob); +#endif ft_eth(blob); return 0; diff --git a/board/nm/nrhw20/board.c b/board/nm/nrhw20/board.c index 9f3632b8b1..265020fb8e 100644 --- a/board/nm/nrhw20/board.c +++ b/board/nm/nrhw20/board.c @@ -3,7 +3,7 @@ * * Board functions for Netmodule NRHW 20, based on AM335x EVB * - * Copyright (C) 2018-2019 NetModule AG - http://www.netmodule.com/ + * Copyright (C) 2018-2020 NetModule AG - http://www.netmodule.com/ * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/ * * SPDX-License-Identifier: GPL-2.0+ @@ -43,6 +43,7 @@ /* TODO: place in proper header file */ extern void serial_set_console_index(int index); +extern int console_init_f(void); DECLARE_GLOBAL_DATA_PTR; @@ -137,6 +138,8 @@ DECLARE_GLOBAL_DATA_PTR; #define IOEXT_LED4_GREEN_MASK (1U << 9) #define IOEXT_LEDS_ALL_MASK (0x03FF) +#define NUM_INDICATOR_LEDS 5 + #define DDR3_CLOCK_FREQUENCY (400) @@ -218,7 +221,7 @@ static void set_status_led(int red, int green) da9063_release_i2c_bus(bus); } -static void set_indicator(unsigned led, int red, int green) +static void set_indicator_led(unsigned led, int red, int green) { int old_bus; uint led_red_mask = 0x1U << (2*led); @@ -321,8 +324,13 @@ struct serial_device *default_serial_console(void) /* TODO: Sorry, what are we doing here.... */ /* This is at least dangerous if not completely wrong */ /* TODO: Using UART1 for moment until it is clear what to do */ +#if 0 + enable_uart5_pin_mux(); + return &eserial6_device; +#else enable_uart1_pin_mux(); return &eserial2_device; +#endif } } @@ -473,10 +481,12 @@ void am33xx_spl_board_init(void) init_pmic_spl(); init_leds(); -#if 0 /* TODO: missing ? */ +#ifdef CONFIG_NRSW_BUILD + set_indicator_led(0, 1, 1); /* Orange */ +#else set_status_led(1, 0); /* Red */ + set_indicator_led(0, 1, 0); /* Red */ #endif - set_indicator(0, 1, 1); /* Orange */ /* Set MPU Frequency to what we detected now that voltages are set */ do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100); @@ -641,12 +651,6 @@ static void init_gsm(void) * 4.2.8 PWR_ON pin * 4.2.9 RESET_N pin * - * Functionality: - * - Leave GSM power enable as is (default at power up = off) - * - Set reset line inactive (note: inverter logic in HW present) - * - Leave button unpressed (note: inverter logic in HW present) - * - Modem shall be enabled by Linux system by enabling GSM power - * supply */ int bus; @@ -710,9 +714,12 @@ int board_init(void) /* Let user know we're starting */ init_leds(); +#ifdef CONFIG_NRSW_BUILD set_status_led(1, 1); /* Orange */ - /* TODO: Status LED correct? */ - +#else + set_status_led(1, 1); /* Orange */ + set_indicator_led(0, 0, 0); /* Off */ +#endif printf("OSC: %lu MHz\n", get_osclk()/1000000); return 0; @@ -726,6 +733,7 @@ int board_init(void) * - Available tty interfaces * - ttyS1: standard console (default) * - ttyS0: COM/IO shield + * - ttyNull0: Dummy device if no real UART is available */ void set_console(void) { @@ -751,7 +759,21 @@ void set_console(void) setenv("defaultconsole", buf); } } - + + /* + * If ttyS0 (COM_IO shield) is selected, make sure we really have + * a COM_IO shield. Otherwise use the dummy tty. Actually this should + * not happen. So it is just a sanity check to prevent the kernel from + * crashing due to missing console, if something is configured wrong. + * (Obviously thats just another hack, but there are no other options on + * this platform because of a lot of conflicts between pins and uarts.) + */ + if (strstr(defaultconsole, "ttyS0")) { + if (bd_get_shield(0) != SHIELD_COM_IO) { + setenv("defaultconsole", "ttyNull"); + } + } + #if defined(CONFIG_PRE_CONSOLE_BUFFER) defaultconsole = getenv("defaultconsole"); @@ -854,7 +876,10 @@ static void get_pmic_version(void) static void check_jtag_boot(void) { if (is_jtag_boot(CONFIG_JTAG_MARKER_UBOOT)) { + char *bootcmd = getenv("bootcmd"); setenv ("bootcmd", ""); + /* Save original bootcmd in "bootcmd_orig" to allow manual boot */ + setenv ("bootcmd_orig", bootcmd); puts("Detected JTAG boot. Waiting on command line\n"); } } @@ -904,9 +929,9 @@ static struct shield_command known_shield_commands[] = { }, { SHIELD_DUALCAN_PASSIVE, - "dualcan", - "shield dualcan termination off off", - can_shield_init + "dualcan-passive", + "shield dualcan-passive", + can_shield_passive_init } }; @@ -985,25 +1010,24 @@ static bool get_button_state(void) return pressed; } -static void blink_led(int pulses) +static void blink_led(int red, int green) { const int pulse_width = 400*1000; /* 400ms */ + int i; - /* Assumes status led on, indicator off */ - set_status_led(0, 0); - - while (pulses) { - udelay(pulse_width); - set_status_led(1, 1); - - udelay(pulse_width); - set_status_led(0, 0); - - pulses--; + /* Assumes status led is on (green), indicator off */ + /* udelay(pulse_width); */ + set_status_led(red, green); + for (i=0; i 3) { + if (read_file("/root/boot/consoledev", buf, sizeof(buf)) > 3) { if (strstr(buf, "tty") == buf) { int i; /* TODO: What is this code doing? */ @@ -755,7 +788,10 @@ static void get_pmic_version(void) static void check_jtag_boot(void) { if (is_jtag_boot(CONFIG_JTAG_MARKER_UBOOT)) { + char *bootcmd = getenv("bootcmd"); setenv ("bootcmd", ""); + /* Save original bootcmd in "bootcmd_orig" to allow manual boot */ + setenv ("bootcmd_orig", bootcmd); puts("Detected JTAG boot. Waiting on command line\n"); } } @@ -805,9 +841,9 @@ static struct shield_command known_shield_commands[] = { }, { SHIELD_DUALCAN_PASSIVE, - "dualcan (passive)", - "shield dualcan termination off off", - can_shield_init + "dualcan-passive", + "shield dualcan-passive", + can_shield_passive_init } }; @@ -1211,7 +1247,11 @@ static void ft_shields(void* blob) break; default: - ft_enable_node(blob, "/netbox_dio_default"); + /* + * Enable uart1 (ttyS0) always as kernel needs it as fallback console, + * if (ttyS1) is not available as console. + */ + ft_enable_node(blob, "/ocp/serial@44e09000"); break; }; @@ -1279,14 +1319,6 @@ int ft_board_setup(void *blob, bd_t *bd) ft_shields(blob); - /* - * Enable uart1 (ttyS0) always as kernel needs it as fallback console, - * if (ttyS1) is not available as console. - */ - /* TODO: This does not work, as pins are then blocked for CAN - * Double check with NRSW - */ - /* ft_enable_node(blob, "/ocp/serial@44e09000"); */ ft_override_thermal(blob); diff --git a/board/nm/nrhw24/shield.c b/board/nm/nrhw24/shield.c index 97f1394a9d..e25e905381 100644 --- a/board/nm/nrhw24/shield.c +++ b/board/nm/nrhw24/shield.c @@ -68,6 +68,7 @@ U_BOOT_CMD( shield, 6, 1, do_shieldmode, "Set the shield mode", "dualcan termination [on|off] [on|off]\n" + "shield dualcan-passive\n" "shield comio mode [rs232|rs485] termination [on|off]\n" ); diff --git a/board/nm/nrhw24/shield_can.c b/board/nm/nrhw24/shield_can.c index ea51b5c4c3..a1252fff7f 100644 --- a/board/nm/nrhw24/shield_can.c +++ b/board/nm/nrhw24/shield_can.c @@ -184,8 +184,18 @@ static int set_shieldmode(char * const argv[], int argc) return configure_shieldmode(get_mode_from_args(argv, argc)); } -/* TODO: Static ? */ -struct shield_t can_shield = { +static int no_options(char * const argv[], int argc) +{ + if (argc != 0) { + debug("Too many arguments\n"); + return -1; + } + + return 0; +} + + +static struct shield_t can_shield = { "dualcan", set_shieldmode }; @@ -193,3 +203,12 @@ void can_shield_init(void) { shield_register(&can_shield); } + +static struct shield_t can_shield_passive = { + "dualcan-passive", no_options +}; + +void can_shield_passive_init(void) +{ + shield_register(&can_shield_passive); +} diff --git a/board/nm/nrhw24/shield_can.h b/board/nm/nrhw24/shield_can.h index 21684cd4f7..56d8251e36 100644 --- a/board/nm/nrhw24/shield_can.h +++ b/board/nm/nrhw24/shield_can.h @@ -5,5 +5,6 @@ int shield_can_init(void); int shield_can_setmode(int mode); void can_shield_init(void); +void can_shield_passive_init(void); #endif // SHIELD_CAN_H diff --git a/common/main.c b/common/main.c index e9a0e85b58..81142dc121 100644 --- a/common/main.c +++ b/common/main.c @@ -113,19 +113,12 @@ int login (void) } } else { - /* SHA1 */ + /* SHA256 */ char *cp = sha_crypt(password, stored_pw_hash); /* TODO: Salt = PW? */ res = memcmp(cp, stored_pw_hash, actread); free(cp); if (res == 0) break; -/* - if (memcmp(cp, stored_pw_hash, actread) == 0) { - free(cp); - break; - } - free(cp); -*/ } /* TODO: exponentional delay */ diff --git a/common/spl/spl.c b/common/spl/spl.c index ec7f237083..484657d811 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -458,9 +458,11 @@ void preloader_console_init(void) gd->have_console = 1; #ifdef CONFIG_NRSW_BUILD - puts("\n" SPL_VERSION); + puts("\n" SPL_VERSION "\n"); +#else + puts("\n"); #endif - puts("\nU-Boot SPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \ + puts("U-Boot SPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \ U_BOOT_TIME ")\n"); #ifdef CONFIG_SPL_DISPLAY_PRINT spl_display_print(); diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c index 0a771a9925..3e33c522e2 100644 --- a/drivers/i2c/omap24xx_i2c.c +++ b/drivers/i2c/omap24xx_i2c.c @@ -420,8 +420,10 @@ static int omap24_i2c_read(struct i2c_adapter *adap, uchar chip, uint addr, } if (status == 0 || (status & I2C_STAT_NACK)) { i2c_error = 1; - /*printf("i2c_read: error waiting for addr ACK (status=0x%x)\n", - status);*/ +#ifdef CONFIG_NRSW_BUILD + printf("i2c_read: error waiting for addr ACK (status=0x%x)\n", + status); +#endif goto rd_exit; } if (alen) { diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index caf3d5c307..3274c0fb3a 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -33,9 +33,6 @@ static int console_index = CONFIG_CONS_INDEX - 1; static int console_index = 0; #endif -/* TODO: Rename CONSOLE_INDEX to console_index, to make clear it - * is a variable now - */ void serial_set_console_index(int index) { console_index = index; diff --git a/include/configs/am335x_nrhw24.h b/include/configs/am335x_nrhw24.h index 901d46272a..ab98dc28d9 100644 --- a/include/configs/am335x_nrhw24.h +++ b/include/configs/am335x_nrhw24.h @@ -174,6 +174,7 @@ int eth_phy_timeout(void); "tftp_recovery=tftpboot $kernel_addr_r recovery-image; tftpboot $fdt_addr_r recovery-dtb; " \ "setenv bootargs rdinit=/etc/preinit console=$defaultconsole,115200 " \ "debug $ethopts; " \ + "run shieldcmd; " \ "bootz $kernel_addr_r - $fdt_addr_r\0" /* kernel_addr_r */ #endif @@ -183,8 +184,8 @@ int eth_phy_timeout(void); #define CONFIG_ZERO_BOOTDELAY_CHECK /* UART Configuration */ -#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0: XModem Boot */ -#define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1: eMMC Boot, User UART */ +#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0: XModem Boot, Shield */ +#define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1: Debug UART (Internal) */ #define CONFIG_I2C #define CONFIG_I2C_MULTI_BUS diff --git a/lib/display_options.c b/lib/display_options.c index 29343fc00e..f0063abdd0 100644 --- a/lib/display_options.c +++ b/lib/display_options.c @@ -13,6 +13,25 @@ #include #include +#ifdef CONFIG_NRSW_BUILD +#include +#endif + +#ifdef CONFIG_NRSW_BUILD + +int display_options (void) +{ + printf ("\n\n%s\n", UBOOT_VERSION); +#if defined(BUILD_TAG) + printf ("%s, Build: %s\n\n", version_string, BUILD_TAG); +#else + printf ("%s\n\n", version_string); +#endif + return 0; +} + +#else /* CONFIG_NRSW_BUILD */ + int display_options (void) { #if defined(BUILD_TAG) @@ -23,6 +42,8 @@ int display_options (void) return 0; } +#endif /* CONFIG_NRSW_BUILD */ + void print_freq(uint64_t freq, const char *s) { unsigned long m = 0;