[U-Boot] [PATCH 1/4] microblaze: generic: adding DHCP support

Signed-off-by: Stephan Linz linz@li-pro.net --- include/configs/microblaze-generic.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 9b1569a..c9ee76e 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -231,6 +231,7 @@ #undef CONFIG_CMD_NET #else #define CONFIG_CMD_PING + #define CONFIG_CMD_DHCP #endif
#if defined(CONFIG_SYSTEMACE)

Signed-off-by: Stephan Linz linz@li-pro.net --- include/configs/microblaze-generic.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index c9ee76e..28cee47 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -260,10 +260,10 @@ #define CONFIG_CMD_MTDPARTS /* mtdparts command line support */ #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ #define CONFIG_FLASH_CFI_MTD -#define MTDIDS_DEFAULT "nor0=ml401-0" +#define MTDIDS_DEFAULT "nor0=flash-0"
/* default mtd partition table */ -#define MTDPARTS_DEFAULT "mtdparts=ml401-0:256k(u-boot),"\ +#define MTDPARTS_DEFAULT "mtdparts=flash-0:256k(u-boot),"\ "256k(env),3m(kernel),1m(romfs),"\ "1m(cramfs),-(jffs2)" #endif @@ -292,8 +292,8 @@ #define CONFIG_PREBOOT "echo U-BOOT for ${hostname};setenv preboot;echo"
#define CONFIG_EXTRA_ENV_SETTINGS "unlock=yes\0" /* hardware flash protection */\ - "nor0=ml401-0\0"\ - "mtdparts=mtdparts=ml401-0:"\ + "nor0=flash-0\0"\ + "mtdparts=mtdparts=flash-0:"\ "256k(u-boot),256k(env),3m(kernel),"\ "1m(romfs),1m(cramfs),-(jffs2)\0"

Foresighted to support flat device tree realocations we need to use the new Logical memory blocks library in a manner as been used by all other architectures.
Signed-off-by: Stephan Linz linz@li-pro.net --- arch/microblaze/include/asm/config.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/microblaze/include/asm/config.h b/arch/microblaze/include/asm/config.h index 8a9064b..ec2c316 100644 --- a/arch/microblaze/include/asm/config.h +++ b/arch/microblaze/include/asm/config.h @@ -21,6 +21,8 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_
+#define CONFIG_LMB + /* Relocation to SDRAM works on all Microblaze boards */ #define CONFIG_RELOC_FIXUP_WORKS

Signed-off-by: Stephan Linz linz@li-pro.net --- include/configs/microblaze-generic.h | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 28cee47..89e6dbb 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -305,4 +305,12 @@ #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " #endif
+/* pass open firmware flat tree */ +#define CONFIG_FIT 1 +#define CONFIG_OF_LIBFDT 1 + +/* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (8 << 20) + + #endif /* __CONFIG_H */

Stephan Linz wrote:
Signed-off-by: Stephan Linz linz@li-pro.net
include/configs/microblaze-generic.h | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 28cee47..89e6dbb 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -305,4 +305,12 @@ #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " #endif
+/* pass open firmware flat tree */ +#define CONFIG_FIT 1 +#define CONFIG_OF_LIBFDT 1
that's ok.
+/* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
Why is this value setup to 0x800000?
BTW: One black line is enough
Thanks, Michal

Am Dienstag, 22. Juni 2010 09:25:56 schrieb Michal Simek:
Stephan Linz wrote:
Signed-off-by: Stephan Linz linz@li-pro.net
include/configs/microblaze-generic.h | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 28cee47..89e6dbb 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -305,4 +305,12 @@ #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " #endif
+/* pass open firmware flat tree */ +#define CONFIG_FIT 1 +#define CONFIG_OF_LIBFDT 1
that's ok.
+/* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
Why is this value setup to 0x800000?
First of all the flat device tree handling depends on CONFIG_SYS_BOOTMAPSZ. So I have to define a valid value. As far as I understand the initial memory map for Linux there have to be space for the kernel (text+data), fdt_blob and kernel parameters (at least). I'm unsure with an embedded init ramdisk as produced by simpleImage. The simpleImage can quickly grow up over 6MB with embedded initrd.
So I borrowed this configuration (8MB) from most other configurations (mainly PowerPC).
br, Stephan
BTW: One black line is enough
Thanks, Michal

Stephan Linz wrote:
Am Dienstag, 22. Juni 2010 09:25:56 schrieb Michal Simek:
Stephan Linz wrote:
Signed-off-by: Stephan Linz linz@li-pro.net
include/configs/microblaze-generic.h | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 28cee47..89e6dbb 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -305,4 +305,12 @@ #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " #endif
+/* pass open firmware flat tree */ +#define CONFIG_FIT 1 +#define CONFIG_OF_LIBFDT 1
that's ok.
+/* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
Why is this value setup to 0x800000?
First of all the flat device tree handling depends on CONFIG_SYS_BOOTMAPSZ. So I have to define a valid value. As far as I understand the initial memory map for Linux there have to be space for the kernel (text+data), fdt_blob and kernel parameters (at least). I'm unsure with an embedded init ramdisk as produced by simpleImage. The simpleImage can quickly grow up over 6MB with embedded initrd.
So I borrowed this configuration (8MB) from most other configurations (mainly PowerPC).
ok. Microblaze handles FDT blob in different way. Kernel just need to know where it is and then is copied to another place. We don't have any limits like 8MB or so that's why I prefer to setup ~0UL value or something like that.
Can you please test it?
Thanks, Michal

Hi Michal,
I will work on your proposals today or tomorrow (European time). Please give me some time.
br, Stephan
Am Mittwoch, 23. Juni 2010 08:27:22 schrieb Michal Simek:
Stephan Linz wrote:
Am Dienstag, 22. Juni 2010 09:25:56 schrieb Michal Simek:
Stephan Linz wrote:
Signed-off-by: Stephan Linz linz@li-pro.net
include/configs/microblaze-generic.h | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 28cee47..89e6dbb 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -305,4 +305,12 @@ #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " #endif
+/* pass open firmware flat tree */ +#define CONFIG_FIT 1 +#define CONFIG_OF_LIBFDT 1
that's ok.
+/* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
Why is this value setup to 0x800000?
First of all the flat device tree handling depends on CONFIG_SYS_BOOTMAPSZ. So I have to define a valid value. As far as I understand the initial memory map for Linux there have to be space for the kernel (text+data), fdt_blob and kernel parameters (at least). I'm unsure with an embedded init ramdisk as produced by simpleImage. The simpleImage can quickly grow up over 6MB with embedded initrd.
So I borrowed this configuration (8MB) from most other configurations (mainly PowerPC).
ok. Microblaze handles FDT blob in different way. Kernel just need to know where it is and then is copied to another place. We don't have any limits like 8MB or so that's why I prefer to setup ~0UL value or something like that.
Can you please test it?
Thanks, Michal

Stephan Linz wrote:
Foresighted to support flat device tree realocations we need to use the new Logical memory blocks library in a manner as been used by all other architectures.
Signed-off-by: Stephan Linz linz@li-pro.net
arch/microblaze/include/asm/config.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/microblaze/include/asm/config.h b/arch/microblaze/include/asm/config.h index 8a9064b..ec2c316 100644 --- a/arch/microblaze/include/asm/config.h +++ b/arch/microblaze/include/asm/config.h @@ -21,6 +21,8 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_
+#define CONFIG_LMB
I see what you are trying to do but what is your point with enabling LMB support ?
I am not sure if this enabling bring us any feature which we need.
Thanks, Michal

Am Dienstag, 22. Juni 2010 09:24:40 schrieb Michal Simek:
Stephan Linz wrote:
Foresighted to support flat device tree realocations we need to use the new Logical memory blocks library in a manner as been used by all other architectures.
Signed-off-by: Stephan Linz linz@li-pro.net
arch/microblaze/include/asm/config.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/microblaze/include/asm/config.h b/arch/microblaze/include/asm/config.h index 8a9064b..ec2c316 100644 --- a/arch/microblaze/include/asm/config.h +++ b/arch/microblaze/include/asm/config.h @@ -21,6 +21,8 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_
+#define CONFIG_LMB
I see what you are trying to do but what is your point with enabling LMB support ?
Hm, mainly a clean compilation. Without this define I can not enable the flat device tree handling. LMB is quite new in U-Boot (PowerPC) and there are some dependencies to the FDT support. That force to enable even this feature on MicroBlaze too. I want to avoid a deep intrusion into the code.
I am not sure if this enabling bring us any feature which we need.
Hm, could you pleace consult the PowerPC folks? I think LMB is used to transfer system memory map from U-Boot to Linux kernel in a common way (similar like on x86 PC from BIOS to kernel), or not? Any comments?
br, Stephan
Thanks, Michal

Stephan Linz wrote:
Am Dienstag, 22. Juni 2010 09:24:40 schrieb Michal Simek:
Stephan Linz wrote:
Foresighted to support flat device tree realocations we need to use the new Logical memory blocks library in a manner as been used by all other architectures.
Signed-off-by: Stephan Linz linz@li-pro.net
arch/microblaze/include/asm/config.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/microblaze/include/asm/config.h b/arch/microblaze/include/asm/config.h index 8a9064b..ec2c316 100644 --- a/arch/microblaze/include/asm/config.h +++ b/arch/microblaze/include/asm/config.h @@ -21,6 +21,8 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_
+#define CONFIG_LMB
I see what you are trying to do but what is your point with enabling LMB support ?
Hm, mainly a clean compilation. Without this define I can not enable the flat device tree handling. LMB is quite new in U-Boot (PowerPC) and there are some dependencies to the FDT support. That force to enable even this feature on MicroBlaze too. I want to avoid a deep intrusion into the code.
I am not using the latest u-boot code - just checking if compilation is OK. But I can't see a reason why we should enable LMB because we don't need it. If there is any dependency then there are missing some ifdefs.
I am not sure if this enabling bring us any feature which we need.
Hm, could you pleace consult the PowerPC folks? I think LMB is used to transfer system memory map from U-Boot to Linux kernel in a common way (similar like on x86 PC from BIOS to kernel), or not? Any comments?
Stefan: How is LMB used in PowerPC? Microblaze uses LMB in kernel but IMHO we don't need to use it in u-boot and kernel is not ready for passing any memory map from U-BOOT. Maybe I am wrong that's why I would like to check this with you.
Thanks, Michal

Am Mittwoch, 23. Juni 2010 08:31:59 schrieb Michal Simek:
--8<--snip -->8--
diff --git a/arch/microblaze/include/asm/config.h b/arch/microblaze/include/asm/config.h index 8a9064b..ec2c316 100644 --- a/arch/microblaze/include/asm/config.h +++ b/arch/microblaze/include/asm/config.h @@ -21,6 +21,8 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_
+#define CONFIG_LMB
I see what you are trying to do but what is your point with enabling LMB support ?
Hm, mainly a clean compilation. Without this define I can not enable the flat device tree handling. LMB is quite new in U-Boot ... --8<--snip -->8--
I am not using the latest u-boot code - just checking if compilation is OK. But I can't see a reason why we should enable LMB because we don't need it. If there is any dependency then there are missing some ifdefs.
Hi Michal,
you are right. There are missing some ifdefs in the relocation code so there is no need to enable the LMB in U-Boot on Microblaze (also applies to the 8MB problem, CONFIG_SYS_BOOTMAPSZ).
Please be patient. I prepare a new patch set. I'll roll out as fast as possible ...
br, Stephan

Stephan Linz wrote:
Signed-off-by: Stephan Linz linz@li-pro.net
include/configs/microblaze-generic.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index c9ee76e..28cee47 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -260,10 +260,10 @@ #define CONFIG_CMD_MTDPARTS /* mtdparts command line support */ #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ #define CONFIG_FLASH_CFI_MTD -#define MTDIDS_DEFAULT "nor0=ml401-0" +#define MTDIDS_DEFAULT "nor0=flash-0"
/* default mtd partition table */ -#define MTDPARTS_DEFAULT "mtdparts=ml401-0:256k(u-boot),"\ +#define MTDPARTS_DEFAULT "mtdparts=flash-0:256k(u-boot),"\ "256k(env),3m(kernel),1m(romfs),"\ "1m(cramfs),-(jffs2)" #endif @@ -292,8 +292,8 @@ #define CONFIG_PREBOOT "echo U-BOOT for ${hostname};setenv preboot;echo"
#define CONFIG_EXTRA_ENV_SETTINGS "unlock=yes\0" /* hardware flash protection */\
"nor0=ml401-0\0"\
"mtdparts=mtdparts=ml401-0:"\
"nor0=flash-0\0"\
"mtdparts=mtdparts=flash-0:"\ "256k(u-boot),256k(env),3m(kernel),"\ "1m(romfs),1m(cramfs),-(jffs2)\0"
Will add.
Thanks, Michal

Am Montag, 21. Juni 2010 23:21:02 schrieb Mike Frysinger:
On Monday, June 21, 2010 16:58:09 Stephan Linz wrote:
#define CONFIG_CMD_PING
- #define CONFIG_CMD_DHCP
#endif
not specific to this commit, but preprocessor statements really shouldnt be intended like this
- #define FOO
+# define FOO -mike
You're right. But I modified only a small pices and not the whole file.

Stephan Linz wrote:
Signed-off-by: Stephan Linz linz@li-pro.net
include/configs/microblaze-generic.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 9b1569a..c9ee76e 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -231,6 +231,7 @@ #undef CONFIG_CMD_NET #else #define CONFIG_CMD_PING
- #define CONFIG_CMD_DHCP
#endif
#if defined(CONFIG_SYSTEMACE)
Will add.
Thanks, Michal
participants (3)
-
Michal Simek
-
Mike Frysinger
-
Stephan Linz