Extract ps7_* from spl code to prepare for extension.
And also return value.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
obj-y += clk.o
obj-y += lowlevel_init.o
AFLAGS_lowlevel_init.o := -mfpu=neon
-obj-$(CONFIG_SPL_BUILD) += spl.o
+obj-$(CONFIG_SPL_BUILD) += spl.o ps7_spl_init.o
--- /dev/null
+/*
+ * (c) Copyright 2010-2017 Xilinx, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef _ASM_ARCH_PS7_INIT_GPL_H
+#define _ASM_ARCH_PS7_INIT_GPL_H
+
+/* Called by spl.c */
+int ps7_init(void);
+int ps7_post_config(void);
+
+#endif /* _ASM_ARCH_PS7_INIT_GPL_H */
int zynq_board_read_rom_ethaddr(unsigned char *ethaddr);
-/* Driver extern functions */
-extern void ps7_init(void);
-int ps7_post_config(void);
-
#endif /* _SYS_PROTO_H_ */
--- /dev/null
+/*
+ * (c) Copyright 2010-2017 Xilinx, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <asm/io.h>
+#include <asm/spl.h>
+#include <asm/arch/ps7_init_gpl.h>
+
+__weak int ps7_init(void)
+{
+ /*
+ * This function is overridden by the one in
+ * board/xilinx/zynq/(platform)/ps7_init_gpl.c, if it exists.
+ */
+ return 0;
+}
+
+__weak int ps7_post_config(void)
+{
+ /*
+ * This function is overridden by the one in
+ * board/xilinx/zynq/(platform)/ps7_init_gpl.c, if it exists.
+ */
+ return 0;
+}
#include <asm/spl.h>
#include <asm/arch/hardware.h>
#include <asm/arch/sys_proto.h>
+#include <asm/arch/ps7_init_gpl.h>
DECLARE_GLOBAL_DATA_PTR;
}
#endif
-__weak void ps7_init(void)
-{
- /*
- * This function is overridden by the one in
- * board/xilinx/zynq/(platform)/ps7_init_gpl.c, if it exists.
- */
-}
-
-__weak int ps7_post_config(void)
-{
- /*
- * This function is overridden by the one in
- * board/xilinx/zynq/(platform)/ps7_init_gpl.c, if it exists.
- */
- return 0;
-}
-
void spl_board_prepare_for_boot(void)
{
ps7_post_config();