diff mbox

[U-Boot,v2,03/18] mvebu: Add board_pex_config()

Message ID 20170111150102.7399-4-mario.six@gdsys.cc
State Awaiting Upstream
Delegated to: Stefan Roese
Headers show

Commit Message

Mario Six Jan. 11, 2017, 3 p.m. UTC
Allow boards to do some initialization when PCIe comes up.

Signed-off-by: Dirk Eibach <dirk.eibach@gdsys.cc>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
---
Changes in v2:

* Switched usage of __attribute(...) to __weak to simplify weak function
  declaration
---
 arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c | 8 ++++++++
 arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h | 2 ++
 2 files changed, 10 insertions(+)

--
2.9.0

Comments

Stefan Roese Jan. 18, 2017, 3:58 p.m. UTC | #1
On 11.01.2017 16:00, Mario Six wrote:
> Allow boards to do some initialization when PCIe comes up.
>
> Signed-off-by: Dirk Eibach <dirk.eibach@gdsys.cc>
> Signed-off-by: Mario Six <mario.six@gdsys.cc>
> ---
> Changes in v2:
>
> * Switched usage of __attribute(...) to __weak to simplify weak function
>   declaration

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan
Stefan Roese Feb. 1, 2017, 11:40 a.m. UTC | #2
On 11.01.2017 16:00, Mario Six wrote:
> Allow boards to do some initialization when PCIe comes up.
>
> Signed-off-by: Dirk Eibach <dirk.eibach@gdsys.cc>
> Signed-off-by: Mario Six <mario.six@gdsys.cc>
> ---
> Changes in v2:
>
> * Switched usage of __attribute(...) to __weak to simplify weak function
>   declaration

Applied to u-boot-marvell/master

Thanks,
Stefan
diff mbox

Patch

diff --git a/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c b/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c
index 98c447c..9e5b647 100644
--- a/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c
+++ b/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c
@@ -13,6 +13,11 @@ 
 #include "ctrl_pex.h"
 #include "sys_env_lib.h"

+__weak void board_pex_config(void)
+{
+	/* nothing in this weak default implementation */
+}
+
 int hws_pex_config(const struct serdes_map *serdes_map, u8 count)
 {
 	u32 pex_idx, tmp, next_busno, first_busno, temp_pex_reg,
@@ -77,6 +82,9 @@  int hws_pex_config(const struct serdes_map *serdes_map, u8 count)

 	/* Support gen1/gen2 */
 	DEBUG_INIT_FULL_S("Support gen1/gen2\n");
+
+	board_pex_config();
+
 	next_busno = 0;
 	mdelay(150);

diff --git a/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h b/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h
index 5f7e2c7..ca8a4d2 100644
--- a/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h
+++ b/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h
@@ -83,4 +83,6 @@  int pex_local_bus_num_set(u32 pex_if, u32 bus_num);
 int pex_local_dev_num_set(u32 pex_if, u32 dev_num);
 u32 pex_config_read(u32 pex_if, u32 bus, u32 dev, u32 func, u32 reg_off);

+void board_pex_config(void);
+
 #endif