]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
POST: Remove duplicated post_hotkey_pressed() functions
authorStefan Roese <sr@denx.de>
Thu, 3 Dec 2009 05:24:30 +0000 (06:24 +0100)
committerWolfgang Denk <wd@denx.de>
Mon, 7 Dec 2009 21:44:31 +0000 (22:44 +0100)
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>
22 files changed:
board/amcc/katmai/katmai.c
board/amcc/kilauea/kilauea.c
board/amcc/makalu/makalu.c
board/amcc/ocotea/ocotea.c
board/amcc/sequoia/sequoia.c
board/amcc/taishan/taishan.c
board/amcc/yucca/yucca.c
board/cm5200/cm5200.c
board/esd/pmc440/pmc440.c
board/gen860t/gen860t.c
board/korat/korat.c
board/kup/common/kup.c
board/mpl/mip405/mip405.c
board/netstal/hcu4/hcu4.c
board/netstal/hcu5/hcu5.c
board/netstal/mcu25/mcu25.c
board/netta/netta.c
board/prodrive/alpr/alpr.c
board/sacsng/sacsng.c
board/ssv/adnpesc1/adnpesc1.c
board/uc100/uc100.c
post/post.c

index 86dc923e7abbc77a3415c0cf465251d30537cd2e..54e2a39aa14dd2cc9122b025619af8ba819ef996 100644 (file)
@@ -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);
index 2f99ea1130aa0c864c711e0383b61d1b132290fd..8ce244555acfdde7cb9c891368807860c948c082 100644 (file)
@@ -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 */
index 3d860af9a13048cc4d0f58a9b85a9c2b4f08f8f7..4afe0916652e852ebb1e31e7c802ee721e7ff93b 100644 (file)
@@ -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 */
index 951a8b5394f562e984a4cecf76c2d557eaef6db4..7bffa3c4082f772a3b8f904cab15072040320aed 100644 (file)
@@ -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
index cb34c9d7df8ad2e2a69fff4779871647b52ed5f9..6756a27238ef7afd6db132b205b252653e4b0d31 100644 (file)
@@ -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
index 279fae21c1cf45bfd42ccadc36b830e81198381e..cac7a78d69e57ad54e60eb68dba6230daf85c8c2 100644 (file)
@@ -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);
index e0d19bcb68a08914b84cfb1fce97d833d2f37d9b..67a016787a41aa9bfd50b4a102d4ad5a8b53f842 100644 (file)
@@ -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
  +---------------------------------------------------------------------------*/
index 9e2f1a5366bbdc43d061988c07cc511c97ff0f8d..0b5412bde62689949b58db5d108baf462f224337 100644 (file)
@@ -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)
 {
index d0ff080fadefe1b90fa5baf1e1e6f7b9bd632dd7..bd43a9aef0d6ccf6a23ed58a61f81c9b66a83865 100644 (file)
@@ -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)
 {
index 008f765af89aa89466aa10f6f52835c462587cf9..b37a0f24d493458b8da346f4d7a6da9760d96d93 100644 (file)
@@ -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
index f942052bd50f246deb53c23e46926a26b33b88f3..d5260dc232e4f9840ff606f1429fcd60df77bde3 100644 (file)
@@ -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)
 {
index fec5407bc742bf3f8edb4d38730b8e82556026b1..2418d59d866c6a0b945321eadd6da87671e9d76f 100644 (file)
@@ -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
index 495e9bd88a430f5f48c51156bfeb91f8c1c379d1..af3a98a42fb4255fd518b6fbd950d19ec2b0c2c0 100644 (file)
@@ -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)
index ba3e9c3cff1ef1adf6c9fd04146d99933ff381b1..8efbc23c897dadf32d4f26ba9611eee89114a8c8 100644 (file)
@@ -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)
 {
index 86156456441e771e85726dc3b42ced692a20ef5b..c545cc01ea760fb64a1a32dad41e32edc7e363b0 100644 (file)
@@ -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)
 {
index 945d79aa200e9b91fef805c1b220e4643dd97feb..c66ab97ac5b35b16e75797d925f428a00f589392 100644 (file)
@@ -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)
 {
index 38c9d8919e0cac6c9667dc8e27eddb066e183677..5c935f47a25c3d00ebb126ba1a24366c5fae3b0f 100644 (file)
@@ -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)
index 66153279fb64bdfad6d85ed3ce6303a610e1f780..060e7eb2372cc15c34ba6186e7033d01b45c1065 100644 (file)
@@ -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
index 2513937ed126ee83ab590dce5a4df73372781f62..49d8bba15de0d10f9d874306d4bdc8e60b4cf413 100644 (file)
@@ -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
index 72810d036aea9a73e89c9b4e07f5d2a2efcd5677..802bfba1ab685b8078198aa43cff285e830af4c8 100644 (file)
@@ -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)
 {
index 38c7be6bad6d1b56a605c22ef50c1057531ea296..4dba2900dbcaaa31ee78e43dbac17a9d1208925d 100644 (file)
@@ -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
index b74e7623169d562c3e69ece9c99790ff7302df7f..b29eb87fc2113701ca8c92618b62bdf568ee8e24 100644 (file)
@@ -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);