POST: Remove duplicated post_hotkey_pressed() functions

This patch introduces a weak default function for post_hotkey_pressed(),
returning 0, for boards without hotkey support. The long-running tests
won't be started on those boards. This default function was implemented
in many board directories. By implementing this weak default we can
remove all those duplicate versions.

Boards with hotkey support, can override this weak default function
by defining one in their board specific code.

Signed-off-by: Stefan Roese <sr@denx.de>
master
Stefan Roese 15 years ago committed by Wolfgang Denk
parent 2a49bf3149
commit 39ff7d5f4c
  1. 11
      board/amcc/katmai/katmai.c
  2. 11
      board/amcc/kilauea/kilauea.c
  3. 11
      board/amcc/makalu/makalu.c
  4. 12
      board/amcc/ocotea/ocotea.c
  5. 11
      board/amcc/sequoia/sequoia.c
  6. 11
      board/amcc/taishan/taishan.c
  7. 11
      board/amcc/yucca/yucca.c
  8. 8
      board/cm5200/cm5200.c
  9. 11
      board/esd/pmc440/pmc440.c
  10. 11
      board/gen860t/gen860t.c
  11. 11
      board/korat/korat.c
  12. 11
      board/kup/common/kup.c
  13. 11
      board/mpl/mip405/mip405.c
  14. 11
      board/netstal/hcu4/hcu4.c
  15. 11
      board/netstal/hcu5/hcu5.c
  16. 11
      board/netstal/mcu25/mcu25.c
  17. 11
      board/netta/netta.c
  18. 12
      board/prodrive/alpr/alpr.c
  19. 12
      board/sacsng/sacsng.c
  20. 11
      board/ssv/adnpesc1/adnpesc1.c
  21. 12
      board/uc100/uc100.c
  22. 16
      post/post.c

@ -279,17 +279,6 @@ int board_pcie_card_present(int port)
}
#endif /* defined(CONFIG_PCI) */
#ifdef CONFIG_POST
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return (ctrlc());
}
#endif
int board_eth_init(bd_t *bis)
{
cpu_eth_init(bis);

@ -284,14 +284,3 @@ int checkboard (void)
return (0);
}
#if defined(CONFIG_POST)
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return 0; /* No hotkeys supported */
}
#endif /* CONFIG_POST */

@ -236,14 +236,3 @@ int checkboard (void)
return (0);
}
#if defined(CONFIG_POST)
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return 0; /* No hotkeys supported */
}
#endif /* CONFIG_POST */

@ -400,15 +400,3 @@ void fpga_init(void)
return;
}
#ifdef CONFIG_POST
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return (ctrlc());
}
#endif

@ -370,17 +370,6 @@ void board_pci_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
}
#endif
#if defined(CONFIG_POST)
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return 0; /* No hotkeys supported */
}
#endif /* CONFIG_POST */
#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_SYS_RAMBOOT)
/*
* On NAND-booting sequoia, we need to patch the chips select numbers

@ -209,17 +209,6 @@ int checkboard (void)
return (0);
}
#ifdef CONFIG_POST
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return (ctrlc());
}
#endif
int board_eth_init(bd_t *bis)
{
cpu_eth_init(bis);

@ -708,17 +708,6 @@ void fpga_init(void)
return;
}
#ifdef CONFIG_POST
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return (ctrlc());
}
#endif
/*---------------------------------------------------------------------------+
| onboard_pci_arbiter_selected => from EPLD
+---------------------------------------------------------------------------*/

@ -330,14 +330,6 @@ int board_early_init_r(void)
}
#ifdef CONFIG_POST
int post_hotkeys_pressed(void)
{
return 0;
}
#endif /* CONFIG_POST */
#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
void post_word_store(ulong a)
{

@ -677,17 +677,6 @@ int is_pci_host(struct pci_controller *hose)
}
#endif /* defined(CONFIG_PCI) */
#if defined(CONFIG_POST)
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return 0; /* No hotkeys supported */
}
#endif /* CONFIG_POST */
#ifdef CONFIG_RESET_PHY_R
void reset_phy(void)
{

@ -292,14 +292,3 @@ void board_poweroff (void)
puts ("### Please power off the board ###\n");
while (1);
}
#ifdef CONFIG_POST
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed (void)
{
return 0; /* No hotkeys supported */
}
#endif

@ -622,17 +622,6 @@ void pci_target_init(struct pci_controller *hose)
}
#endif /* defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_TARGET_INIT) */
#if defined(CONFIG_POST)
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return 0; /* No hotkeys supported */
}
#endif /* CONFIG_POST */
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
void ft_board_setup(void *blob, bd_t *bd)
{

@ -70,14 +70,3 @@ void poweron_key (void)
else
setenv ("key1", "on");
}
#ifdef CONFIG_POST
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed (void)
{
return (0);
}
#endif

@ -706,17 +706,6 @@ void print_mip405_rev (void)
}
#ifdef CONFIG_POST
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return 0; /* No hotkeys supported */
}
#endif
extern int mk_date (char *, struct rtc_time *);
int last_stage_init (void)

@ -174,17 +174,6 @@ phys_size_t initdram(int board_type)
return dram_size;
}
#if defined(CONFIG_POST)
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return 0; /* No hotkeys supported */
}
#endif /* CONFIG_POST */
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
void ft_board_setup(void *blob, bd_t *bd)
{

@ -390,17 +390,6 @@ void pci_master_init(struct pci_controller *hose)
}
#endif /* defined(CONFIG_PCI) */
#if defined(CONFIG_POST)
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return 0; /* No hotkeys supported */
}
#endif /* CONFIG_POST */
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
void ft_board_setup(void *blob, bd_t *bd)
{

@ -173,17 +173,6 @@ phys_size_t initdram(int board_type)
return dram_size;
}
#if defined(CONFIG_POST)
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return 0; /* No hotkeys supported */
}
#endif /* CONFIG_POST */
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
void ft_board_setup(void *blob, bd_t *bd)
{

@ -564,17 +564,6 @@ int pcmcia_init(void)
#endif
#ifdef CONFIG_POST
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return 0; /* No hotkeys supported */
}
#endif
#ifdef CONFIG_HW_WATCHDOG
void hw_watchdog_reset(void)

@ -228,15 +228,3 @@ void pci_master_init(struct pci_controller *hose)
out32r(PCIL0_POM1SA, ~(0x10000000 - 1) | 1); /* 256MB + enable region */
}
#endif /* defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_MASTER_INIT) */
#ifdef CONFIG_POST
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return (ctrlc());
}
#endif

@ -869,15 +869,3 @@ void spi_cs_deactivate(struct spi_slave *slave)
#endif
#endif /* CONFIG_MISC_INIT_R */
#ifdef CONFIG_POST
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return 0; /* No hotkeys supported */
}
#endif

@ -91,17 +91,6 @@ void spi_cs_deactivate(struct spi_slave *slave)
#endif
#if defined(CONFIG_POST)
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(void)
{
return 0; /* No hotkeys supported */
}
#endif /* CONFIG_POST */
#ifdef CONFIG_CMD_NET
int board_eth_init(bd_t *bis)
{

@ -268,15 +268,3 @@ int misc_init_r (void)
return 0;
}
#ifdef CONFIG_POST
/*
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed (void)
{
return 0; /* No hotkeys supported */
}
#endif

@ -58,6 +58,22 @@ int post_init_f (void)
return res;
}
/*
* Supply a default implementation for post_hotkeys_pressed() for boards
* without hotkey support. We always return 0 here, so that the
* long-running tests won't be started.
*
* Boards with hotkey support can override this weak default function
* by defining one in their board specific code.
*/
int __post_hotkeys_pressed(void)
{
return 0; /* No hotkeys supported */
}
int post_hotkeys_pressed(void)
__attribute__((weak, alias("__post_hotkeys_pressed")));
void post_bootmode_init (void)
{
int bootmode = post_bootmode_get (0);

Loading…
Cancel
Save