From 06fd853890f23491605bfd6c9ab0116b79e15aaa Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 30 Nov 2012 13:01:17 +0000 Subject: arm: Add CONFIG_DELAY_ENVIRONMENT to delay environment loading This option delays loading of the environment until later, so that only the default environment will be available to U-Boot. This can address the security risk of untrusted data being used during boot. Any time you load untrusted data you expose yourself to a bug in the code. The attacker gets to choose the data so can sometimes carefully craft it to exploit a bug. We try to avoid touching user-controlled data during a verified boot unless strictly necessary. Since the default environment is good enough in this case (or you would just change it), this gets around the problem by just not loading the environment. When CONFIG_DELAY_ENVIRONMENT is defined, it is convenient to have a run-time way of enabling loading of the environment. Add this to the fdt as /config/delay-environment. Note: This patch depends on http://patchwork.ozlabs.org/patch/194342/ Signed-off-by: Doug Anderson Signed-off-by: Simon Glass Reviewed-by: Doug Anderson --- README | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'README') diff --git a/README b/README index 653ef6aa4a..ef8571c898 100644 --- a/README +++ b/README @@ -2378,6 +2378,15 @@ CBFS (Coreboot Filesystem) support run-time determined information about the hardware to the environment. These will be named board_name, board_rev. + CONFIG_DELAY_ENVIRONMENT + + Normally the environment is loaded when the board is + intialised so that it is available to U-Boot. This inhibits + that so that the environment is not available until + explicitly loaded later by U-Boot code. With CONFIG_OF_CONTROL + this is instead controlled by the value of + /config/load-environment. + - DataFlash Support: CONFIG_HAS_DATAFLASH -- cgit v1.2.1 From b2b92f53157d9afe73b413516834e062448a2fce Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 30 Nov 2012 13:01:18 +0000 Subject: Document the CONFIG_DISPLAY_BOARDINFO option Add a short note about this in the README. Signed-off-by: Simon Glass --- README | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'README') diff --git a/README b/README index ef8571c898..d57ee91ca3 100644 --- a/README +++ b/README @@ -3457,6 +3457,11 @@ use the "saveenv" command to store a valid environment. space for already greatly restricted images, including but not limited to NAND_SPL configurations. +- CONFIG_DISPLAY_BOARDINFO + Display information about the board that U-Boot is running on + when U-Boot starts up. The board function checkboard() is called + to do this. + Low Level (hardware related) configuration options: --------------------------------------------------- -- cgit v1.2.1 From e2e3e2b1be703e0c93d0e49cac9a0dd2e1ba8f6e Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 30 Nov 2012 13:01:19 +0000 Subject: arm: Add CONFIG_DISPLAY_BOARDINFO_LATE to display board info on LCD This option displays board info after stdio is running, so that it will appear on the LCD. If it is displayed earlier, the board info will appear on the serial console but not on the LCD. Here follows a blow-by-blow description. 1a. Without CONFIG_DISPLAY_BOARDINFO_LATE, on serial: U-Boot 2011.12-02550-g037e1c5-dirty (Nov 15 2012 - 14:29:42) for SMDK5250 CPU: S5PC520 @ 1700MHz Board: Google Snow, rev 0 I2C: ready DRAM: 2 GiB Elpida DDR3 @ 800MHz MMC: S5P MSHC0: 0, S5P MSHC1: 1 SF: Detected W25Q32 with page size 4 KiB, total 4 MiB *** Warning - bad CRC, using default environment In: mkbp-keyb Out: lcd Err: lcd Net: No ethernet found. Hit any key to stop autoboot: 0 SMDK5250 # 1b. Without CONFIG_DISPLAY_BOARDINFO_LATE, on LCD (note machine info is missing): In: mkbp-keyb Out: lcd Err: lcd Net: No ethernet found. Hit any key to stop autoboot: 0 SMDK5250 # 2a. With CONFIG_DISPLAY_BOARDINFO_LATE, on serial: U-Boot 2011.12-02550-g037e1c5 (Nov 15 2012 - 14:27:40) for SMDK5250 CPU: S5PC520 @ 1700MHz I2C: ready DRAM: 2 GiB Elpida DDR3 @ 800MHz MMC: S5P MSHC0: 0, S5P MSHC1: 1 SF: Detected W25Q32 with page size 4 KiB, total 4 MiB *** Warning - bad CRC, using default environment Model: Google Snow In: mkbp-keyb Out: lcd Err: lcd Net: No ethernet found. Hit any key to stop autoboot: 0 SMDK5250 # 2b. With CONFIG_DISPLAY_BOARDINFO_LATE, on LCD (note machine info is present): Model: Google Snow In: mkbp-keyb Out: lcd Err: lcd Net: No ethernet found. Hit any key to stop autoboot: 0 SMDK5250 # Since the LCD is all that a typical user sees, it is useful to display the model there. We may be able to rearrange things some other way one day, but at present this seems like a convenient way of getting the required behaviour. Signed-off-by: Simon Glass --- README | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'README') diff --git a/README b/README index d57ee91ca3..9c261680d4 100644 --- a/README +++ b/README @@ -3462,6 +3462,11 @@ use the "saveenv" command to store a valid environment. when U-Boot starts up. The board function checkboard() is called to do this. +- CONFIG_DISPLAY_BOARDINFO_LATE + Similar to the previous option, but display this information + later, once stdio is running and output goes to the LCD, if + present. + Low Level (hardware related) configuration options: --------------------------------------------------- -- cgit v1.2.1 From 15a33e49decc81f34b35998a61757bfe2becae83 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 30 Nov 2012 13:01:20 +0000 Subject: Add option to display customised memory information Some boards want to report more than just memory size. For example, it might be useful to display the memory type (DDR2, DDR3) or manufacturer. Add a weak function to support this requirement, accessed through a new 'meminfo' command. Any example of the DRAM: output is below, just for illustration: SMDK5250 # meminfo DRAM: 2 GiB Elpida DDR3 @ 800MHz Signed-off-by: Simon Glass --- README | 1 + 1 file changed, 1 insertion(+) (limited to 'README') diff --git a/README b/README index 9c261680d4..a9a92d7f83 100644 --- a/README +++ b/README @@ -849,6 +849,7 @@ The following options need to be configured: CONFIG_CMD_LOADS loads CONFIG_CMD_MD5SUM print md5 message digest (requires CONFIG_CMD_MEMORY and CONFIG_MD5) + CONFIG_CMD_MEMINFO * Display detailed memory information CONFIG_CMD_MEMORY md, mm, nm, mw, cp, cmp, crc, base, loop, loopw, mtest CONFIG_CMD_MISC Misc functions like sleep etc -- cgit v1.2.1 From 7de0fe1ac330399afc1873e11061668a93cf4fb9 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Mon, 7 Jan 2013 01:35:20 +0000 Subject: serial/ns16550: add an option to avoid hanging on broken platforms Some platforms (e.g. IGEPv2 board) has a broken ns16550 UART that does not set the TEMT bit when the transmitter is empty in SPL. This makes U-Boot to hang while waiting for TEMT to be set. Add a new option to avoid this: CONFIG_SYS_NS16550_BROKEN_TEMT 16550 UART set the Transmitter Empty (TEMT) Bit when all output has finished and the transmitter is totally empty. U-Boot waits for this bit to be set to initialize the serial console. On some broken platforms this bit is not set in SPL making U-Boot to hang while waiting for TEMT. Define this option to avoid it. Signed-off-by: Javier Martinez Canillas --- README | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'README') diff --git a/README b/README index 653ef6aa4a..98dbe98c2e 100644 --- a/README +++ b/README @@ -616,6 +616,14 @@ The following options need to be configured: boot loader that has already initialized the UART. Define this variable to flush the UART at init time. + CONFIG_SYS_NS16550_BROKEN_TEMT + + 16550 UART set the Transmitter Empty (TEMT) Bit when all output + has finished and the transmitter is totally empty. U-Boot waits + for this bit to be set to initialize the serial console. On some + broken platforms this bit is not set in SPL making U-Boot to + hang while waiting for TEMT. Define this option to avoid it. + - Console Interface: Depending on board, define exactly one serial port -- cgit v1.2.1