* [U-Boot] [PATCH v3] common: add a prototype for mach_cpu_init()
@ 2018-03-09 17:28 Patrick Delaunay
2018-03-12 1:34 ` Masahiro Yamada
2018-03-18 14:56 ` [U-Boot] [U-Boot, " Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Patrick Delaunay @ 2018-03-09 17:28 UTC (permalink / raw)
To: u-boot
Add a new file init.h with the prototype for arch_cpu_init
Add a prototype for mach_cpu_init() to avoid a warning:
no previous prototype for ‘mach_cpu_init’
It is a first step to move all the functions prototype
used during U-Boot initialization (board_f.c / board_r.c)
from common.h to init.h
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---
Changes in v3:
- create file init.h after Yamada Masahiro review
Changes in v2:
- add return info for functions mach_cpu_init() and arch_cpu_init()
include/common.h | 13 +++----------
include/init.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+), 10 deletions(-)
create mode 100644 include/init.h
diff --git a/include/common.h b/include/common.h
index 0fe9439..11e5459 100644
--- a/include/common.h
+++ b/include/common.h
@@ -62,6 +62,9 @@ typedef void (interrupt_handler_t)(void *);
#define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN
#endif
+/* startup functions */
+#include <init.h>
+
/*
* Function Prototypes
*/
@@ -464,16 +467,6 @@ u32 cpu_mask (void);
u32 cpu_dsp_mask(void);
int is_core_valid (unsigned int);
-/**
- * arch_cpu_init() - basic cpu-dependent setup for an architecture
- *
- * This is called after early malloc is available. It should handle any
- * CPU- or SoC- specific init needed to continue the init sequence. See
- * board_f.c for where it is called. If this is not provided, a default
- * version (which does nothing) will be used.
- */
-int arch_cpu_init(void);
-
void s_init(void);
int checkcpu (void);
diff --git a/include/init.h b/include/init.h
new file mode 100644
index 0000000..324fbe0
--- /dev/null
+++ b/include/init.h
@@ -0,0 +1,51 @@
+/*
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ *
+ * Copy the startup prototype, previously defined in common.h
+ * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __INIT_H_
+#define __INIT_H_ 1
+
+#ifndef __ASSEMBLY__ /* put C only stuff in this section */
+
+/*
+ * Function Prototypes
+ */
+
+/* common/board_f.c */
+
+/**
+ * arch_cpu_init() - basic cpu-dependent setup for an architecture
+ *
+ * This is called after early malloc is available. It should handle any
+ * CPU- or SoC- specific init needed to continue the init sequence. See
+ * board_f.c for where it is called. If this is not provided, a default
+ * version (which does nothing) will be used.
+ *
+ * @return: 0 on success, otherwise error
+ */
+int arch_cpu_init(void);
+
+/**
+ * mach_cpu_init() - SoC/machine dependent CPU setup
+ *
+ * This is called after arch_cpu_init(). It should handle any
+ * SoC or machine specific init needed to continue the init sequence. See
+ * board_f.c for where it is called. If this is not provided, a default
+ * version (which does nothing) will be used.
+ *
+ * @return: 0 on success, otherwise error
+ */
+int mach_cpu_init(void);
+
+/* common/board_r.c */
+
+#endif /* __ASSEMBLY__ */
+/* Put only stuff here that the assembler can digest */
+
+#endif /* __INIT_H_ */
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v3] common: add a prototype for mach_cpu_init()
2018-03-09 17:28 [U-Boot] [PATCH v3] common: add a prototype for mach_cpu_init() Patrick Delaunay
@ 2018-03-12 1:34 ` Masahiro Yamada
2018-03-18 14:56 ` [U-Boot] [U-Boot, " Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2018-03-12 1:34 UTC (permalink / raw)
To: u-boot
2018-03-10 2:28 GMT+09:00 Patrick Delaunay <patrick.delaunay@st.com>:
> Add a new file init.h with the prototype for arch_cpu_init
> Add a prototype for mach_cpu_init() to avoid a warning:
> no previous prototype for ‘mach_cpu_init’
>
> It is a first step to move all the functions prototype
> used during U-Boot initialization (board_f.c / board_r.c)
> from common.h to init.h
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Changes in v3:
> - create file init.h after Yamada Masahiro review
>
> Changes in v2:
> - add return info for functions mach_cpu_init() and arch_cpu_init()
>
> include/common.h | 13 +++----------
> include/init.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 54 insertions(+), 10 deletions(-)
> create mode 100644 include/init.h
>
> diff --git a/include/common.h b/include/common.h
> index 0fe9439..11e5459 100644
> --- a/include/common.h
> +++ b/include/common.h
> @@ -62,6 +62,9 @@ typedef void (interrupt_handler_t)(void *);
> #define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN
> #endif
>
> +/* startup functions */
> +#include <init.h>
> +
> /*
> * Function Prototypes
> */
> @@ -464,16 +467,6 @@ u32 cpu_mask (void);
> u32 cpu_dsp_mask(void);
> int is_core_valid (unsigned int);
>
> -/**
> - * arch_cpu_init() - basic cpu-dependent setup for an architecture
> - *
> - * This is called after early malloc is available. It should handle any
> - * CPU- or SoC- specific init needed to continue the init sequence. See
> - * board_f.c for where it is called. If this is not provided, a default
> - * version (which does nothing) will be used.
> - */
> -int arch_cpu_init(void);
> -
> void s_init(void);
>
> int checkcpu (void);
> diff --git a/include/init.h b/include/init.h
> new file mode 100644
> index 0000000..324fbe0
> --- /dev/null
> +++ b/include/init.h
> @@ -0,0 +1,51 @@
> +/*
> + * (C) Copyright 2000-2009
> + * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> + *
> + * Copy the startup prototype, previously defined in common.h
> + * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
> + *
> + * SPDX-License-Identifier: GPL-2.0+
> + */
> +
> +#ifndef __INIT_H_
> +#define __INIT_H_ 1
> +
> +#ifndef __ASSEMBLY__ /* put C only stuff in this section */
> +
> +/*
> + * Function Prototypes
> + */
> +
> +/* common/board_f.c */
> +
> +/**
> + * arch_cpu_init() - basic cpu-dependent setup for an architecture
> + *
> + * This is called after early malloc is available. It should handle any
> + * CPU- or SoC- specific init needed to continue the init sequence. See
> + * board_f.c for where it is called. If this is not provided, a default
> + * version (which does nothing) will be used.
> + *
> + * @return: 0 on success, otherwise error
> + */
> +int arch_cpu_init(void);
> +
> +/**
> + * mach_cpu_init() - SoC/machine dependent CPU setup
> + *
> + * This is called after arch_cpu_init(). It should handle any
> + * SoC or machine specific init needed to continue the init sequence. See
> + * board_f.c for where it is called. If this is not provided, a default
> + * version (which does nothing) will be used.
> + *
> + * @return: 0 on success, otherwise error
> + */
> +int mach_cpu_init(void);
> +
> +/* common/board_r.c */
> +
> +#endif /* __ASSEMBLY__ */
> +/* Put only stuff here that the assembler can digest */
> +
> +#endif /* __INIT_H_ */
> --
> 2.7.4
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [U-Boot, v3] common: add a prototype for mach_cpu_init()
2018-03-09 17:28 [U-Boot] [PATCH v3] common: add a prototype for mach_cpu_init() Patrick Delaunay
2018-03-12 1:34 ` Masahiro Yamada
@ 2018-03-18 14:56 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2018-03-18 14:56 UTC (permalink / raw)
To: u-boot
On Fri, Mar 09, 2018 at 06:28:12PM +0100, Patrick Delaunay wrote:
> Add a new file init.h with the prototype for arch_cpu_init
> Add a prototype for mach_cpu_init() to avoid a warning:
> no previous prototype for ‘mach_cpu_init’
>
> It is a first step to move all the functions prototype
> used during U-Boot initialization (board_f.c / board_r.c)
> from common.h to init.h
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180318/0c1d9f70/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-03-18 14:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-09 17:28 [U-Boot] [PATCH v3] common: add a prototype for mach_cpu_init() Patrick Delaunay
2018-03-12 1:34 ` Masahiro Yamada
2018-03-18 14:56 ` [U-Boot] [U-Boot, " Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.