diff options
author | Jagannadha Sutradharudu Teki <jagannadha.sutradharudu-teki@xilinx.com> | 2014-01-09 01:48:21 +0530 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2014-01-10 15:18:33 +0100 |
commit | b3de92495f23db58a2643fb9328edacbf9a17f1c (patch) | |
tree | 8c19a291bffd9b22576f7c50124c6e99a2fbe0c7 /board | |
parent | fe5eddbf9818ba857d0d7f5e849b5682c9717b74 (diff) | |
download | u-boot-imx-b3de92495f23db58a2643fb9328edacbf9a17f1c.zip u-boot-imx-b3de92495f23db58a2643fb9328edacbf9a17f1c.tar.gz u-boot-imx-b3de92495f23db58a2643fb9328edacbf9a17f1c.tar.bz2 |
zynq: Add support to find bootmode
Added support to find the bootmodes by reading
slcr bootmode register. this can be helpful to
autoboot the configurations w.r.t a specified bootmode.
Added this functionality on board_late_init as it's not
needed for normal initializtion part.
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/xilinx/zynq/board.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c index 5119c09..a5b9bde 100644 --- a/board/xilinx/zynq/board.c +++ b/board/xilinx/zynq/board.c @@ -12,6 +12,12 @@ DECLARE_GLOBAL_DATA_PTR; +/* Bootmode setting values */ +#define ZYNQ_BM_MASK 0x0F +#define ZYNQ_BM_NOR 0x02 +#define ZYNQ_BM_SD 0x05 +#define ZYNQ_BM_JTAG 0x0 + #ifdef CONFIG_FPGA Xilinx_desc fpga; @@ -59,6 +65,25 @@ int board_init(void) return 0; } +int board_late_init(void) +{ + switch ((zynq_slcr_get_boot_mode()) & ZYNQ_BM_MASK) { + case ZYNQ_BM_NOR: + setenv("modeboot", "norboot"); + break; + case ZYNQ_BM_SD: + setenv("modeboot", "sdboot"); + break; + case ZYNQ_BM_JTAG: + setenv("modeboot", "jtagboot"); + break; + default: + setenv("modeboot", ""); + break; + } + + return 0; +} #ifdef CONFIG_CMD_NET int board_eth_init(bd_t *bis) |