diff options
author | Valentin Longchamp <valentin.longchamp@keymile.com> | 2011-09-02 04:59:10 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-10-22 00:14:35 +0200 |
commit | a2da616311151ecfab8b8fcc510686fc3c0c9a21 (patch) | |
tree | bc5ec2c666ec975c6926a994932a2a0cb7baa02e /board/keymile/km_arm/km_arm.c | |
parent | dee17768d4f0490650cb5f28e2366fe0f690fa06 (diff) |
km_arm: enable POST for these boards
The current km_arm boards have a Power-On test jumper. When this
jumper is set, this triggers some Power-On tests on the board.
This patch enables the support of this jumper for starting the
memory_regions test when the jumper is set.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Diffstat (limited to 'board/keymile/km_arm/km_arm.c')
-rw-r--r-- | board/keymile/km_arm/km_arm.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c index 67f158c1eb2..f78f754f372 100644 --- a/board/keymile/km_arm/km_arm.c +++ b/board/keymile/km_arm/km_arm.c @@ -481,6 +481,38 @@ int arch_memory_test_prepare(u32 *vstart, u32 *size, phys_addr_t *phys_offset) } #endif +#if defined(CONFIG_POST) + +#define KM_POST_EN_L 44 + +int post_hotkeys_pressed(void) +{ + return !kw_gpio_get_value(KM_POST_EN_L); +} + +ulong post_word_load(void) +{ + volatile void* addr = (void *) (gd->ram_size - BOOTCOUNT_ADDR + 4); + return in_le32(addr); + +} +void post_word_store(ulong value) +{ + volatile void* addr = (void *) (gd->ram_size - BOOTCOUNT_ADDR + 4); + out_le32(addr, value); +} + +int arch_memory_test_prepare(u32 *vstart, u32 *size, phys_addr_t *phys_offset) +{ + *vstart = CONFIG_SYS_SDRAM_BASE; + + /* we go up to relocation plus a 1 MB margin */ + *size = CONFIG_SYS_TEXT_BASE - (1<<20); + + return 0; +} +#endif + #if defined(CONFIG_SYS_EEPROM_WREN) int eeprom_write_enable(unsigned dev_addr, int state) { |