* [U-Boot] [PATCH] powerpc: CONFIG_OF_CONTROL support
@ 2013-04-15 11:59 Jonathan Klee
2013-04-15 11:59 ` [U-Boot] [PATCH] powerpc: Add support for CONFIG_OF_CONTROL Jonathan Klee
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Klee @ 2013-04-15 11:59 UTC (permalink / raw)
To: u-boot
Allow a device tree to be provided through the standard mechanisms.
Tests have been made using CONFIG_OF_SEPERATE on a MPC8378 board.
Jonathan Klee (1):
powerpc: Add support for CONFIG_OF_CONTROL
arch/powerpc/lib/board.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
--
1.7.10.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] powerpc: Add support for CONFIG_OF_CONTROL
2013-04-15 11:59 [U-Boot] [PATCH] powerpc: CONFIG_OF_CONTROL support Jonathan Klee
@ 2013-04-15 11:59 ` Jonathan Klee
2013-04-16 5:01 ` Simon Glass
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Klee @ 2013-04-15 11:59 UTC (permalink / raw)
To: u-boot
Allow a device tree to be provided through the standard mechanisms.
Tests have been made using CONFIG_OF_SEPERATE on a MPC8378 board.
---
arch/powerpc/lib/board.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 422b4a3..3a9a6ce 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -26,6 +26,8 @@
#include <command.h>
#include <malloc.h>
#include <stdio_dev.h>
+#include <libfdt.h>
+#include <fdtdec.h>
#ifdef CONFIG_8xx
#include <mpc8xx.h>
#endif
@@ -124,6 +126,7 @@ DECLARE_GLOBAL_DATA_PTR;
extern ulong __init_end;
extern ulong __bss_end;
+extern ulong __stop___ex_table;
ulong monitor_flash_len;
#if defined(CONFIG_CMD_BEDBUG)
@@ -255,6 +258,21 @@ int init_func_watchdog_reset(void)
* Initialization sequence
*/
+#ifdef CONFIG_OF_CONTROL
+int find_fdt(void)
+{
+#ifdef CONFIG_OF_EMBED
+ /* get a pointer to the FDT */
+ gd->fdt_blob = _binary_dt_dtb_start;
+#elif defined CONFIG_OF_SEPARATE
+ gd->fdt_blob = (void *)&__stop___ex_table;
+#endif
+ gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
+ (uintptr_t)gd->fdt_blob);
+ return 0;
+}
+#endif
+
static init_fnc_t *init_sequence[] = {
#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
probecpu,
@@ -321,6 +339,10 @@ static init_fnc_t *init_sequence[] = {
#endif
INIT_FUNC_WATCHDOG_RESET
init_func_ram,
+#ifdef CONFIG_OF_CONTROL
+ find_fdt,
+ fdtdec_check_fdt,
+#endif
#if defined(CONFIG_SYS_DRAM_TEST)
testdram,
#endif /* CONFIG_SYS_DRAM_TEST */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] powerpc: Add support for CONFIG_OF_CONTROL
2013-04-15 11:59 ` [U-Boot] [PATCH] powerpc: Add support for CONFIG_OF_CONTROL Jonathan Klee
@ 2013-04-16 5:01 ` Simon Glass
0 siblings, 0 replies; 3+ messages in thread
From: Simon Glass @ 2013-04-16 5:01 UTC (permalink / raw)
To: u-boot
On Mon, Apr 15, 2013 at 4:59 AM, Jonathan Klee <klee.jonathan@gmail.com> wrote:
> Allow a device tree to be provided through the standard mechanisms.
>
> Tests have been made using CONFIG_OF_SEPERATE on a MPC8378 board.
SEPARATE
> ---
> arch/powerpc/lib/board.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
> index 422b4a3..3a9a6ce 100644
> --- a/arch/powerpc/lib/board.c
> +++ b/arch/powerpc/lib/board.c
> @@ -26,6 +26,8 @@
> #include <command.h>
> #include <malloc.h>
> #include <stdio_dev.h>
> +#include <libfdt.h>
> +#include <fdtdec.h>
Please put in alphabetical order.
> #ifdef CONFIG_8xx
> #include <mpc8xx.h>
> #endif
> @@ -124,6 +126,7 @@ DECLARE_GLOBAL_DATA_PTR;
>
> extern ulong __init_end;
> extern ulong __bss_end;
> +extern ulong __stop___ex_table;
Where does this name come from - objcopy?
> ulong monitor_flash_len;
>
> #if defined(CONFIG_CMD_BEDBUG)
> @@ -255,6 +258,21 @@ int init_func_watchdog_reset(void)
> * Initialization sequence
> */
>
> +#ifdef CONFIG_OF_CONTROL
> +int find_fdt(void)
> +{
> +#ifdef CONFIG_OF_EMBED
> + /* get a pointer to the FDT */
> + gd->fdt_blob = _binary_dt_dtb_start;
> +#elif defined CONFIG_OF_SEPARATE
> + gd->fdt_blob = (void *)&__stop___ex_table;
> +#endif
> + gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
> + (uintptr_t)gd->fdt_blob);
> + return 0;
> +}
> +#endif
> +
> static init_fnc_t *init_sequence[] = {
> #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
> probecpu,
> @@ -321,6 +339,10 @@ static init_fnc_t *init_sequence[] = {
> #endif
> INIT_FUNC_WATCHDOG_RESET
> init_func_ram,
> +#ifdef CONFIG_OF_CONTROL
> + find_fdt,
> + fdtdec_check_fdt,
> +#endif
> #if defined(CONFIG_SYS_DRAM_TEST)
> testdram,
> #endif /* CONFIG_SYS_DRAM_TEST */
> --
> 1.7.10.4
>
I'm also interested in whether you can get CONFIG_SYS_GENERIC_BOARD
going on your board?
Regards,
Simon
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-16 5:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-15 11:59 [U-Boot] [PATCH] powerpc: CONFIG_OF_CONTROL support Jonathan Klee
2013-04-15 11:59 ` [U-Boot] [PATCH] powerpc: Add support for CONFIG_OF_CONTROL Jonathan Klee
2013-04-16 5:01 ` Simon Glass
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox