* [U-Boot-Users] [PATCH: u-boot-fdt] Improve error print messages.
@ 2007-08-07 16:06 Jerry Van Baren
2007-08-07 20:29 ` Kim Phillips
2007-08-09 21:05 ` Wolfgang Denk
0 siblings, 2 replies; 7+ messages in thread
From: Jerry Van Baren @ 2007-08-07 16:06 UTC (permalink / raw)
To: u-boot
Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
---
The American expression is "polishing the turd"... :-)
common/fdt_support.c | 62
+++++++++++++++++++++++++-------------------------
1 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 259bd42..b4dba2b 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -54,7 +54,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong
initrd_end, int force)
err = fdt_check_header(fdt);
if (err < 0) {
- printf("libfdt: %s\n", fdt_strerror(err));
+ printf("fdt_chosen: %s\n", fdt_strerror(err));
return err;
}
@@ -66,11 +66,11 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong
initrd_end, int force)
err = fdt_num_reservemap(fdt, &used, &total);
if (err < 0) {
- printf("libfdt: %s\n", fdt_strerror(err));
+ printf("fdt_chosen: %s\n", fdt_strerror(err));
return err;
}
if (used >= total) {
- printf("WARNING fdt_chosen: "
+ printf("WARNING: "
"no room in the reserved map (%d of %d)\n",
used, total);
return -1;
@@ -88,7 +88,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong
initrd_end, int force)
err = fdt_replace_reservemap_entry(fdt, j,
initrd_start, initrd_end - initrd_start + 1);
if (err < 0) {
- printf("libfdt: %s\n", fdt_strerror(err));
+ printf("fdt_chosen: %s\n", fdt_strerror(err));
return err;
}
}
@@ -114,8 +114,8 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong
initrd_end, int force)
*/
nodeoffset = fdt_add_subnode(fdt, 0, "chosen");
if (nodeoffset < 0) {
- printf("WARNING fdt_chosen: "
- "could not create the /chosen node (%s).\n",
+ printf("WARNING: "
+ "could not create the /chosen node %s.\n",
fdt_strerror(nodeoffset));
return nodeoffset;
}
@@ -129,8 +129,8 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong
initrd_end, int force)
err = fdt_setprop(fdt, nodeoffset,
"bootargs", str, strlen(str)+1);
if (err < 0)
- printf("WARNING fdt_chosen: "
- "could not set bootargs (%s).\n",
+ printf("WARNING: "
+ "could not set bootargs %s.\n",
fdt_strerror(err));
}
if (initrd_start && initrd_end) {
@@ -138,23 +138,23 @@ int fdt_chosen(void *fdt, ulong initrd_start,
ulong initrd_end, int force)
err = fdt_setprop(fdt, nodeoffset,
"linux,initrd-start", &tmp, sizeof(tmp));
if (err < 0)
- printf("WARNING fdt_chosen: "
- "could not set linux,initrd-start (%s).\n",
+ printf("WARNING: "
+ "could not set linux,initrd-start %s.\n",
fdt_strerror(err));
tmp = __cpu_to_be32(initrd_end);
err = fdt_setprop(fdt, nodeoffset,
"linux,initrd-end", &tmp, sizeof(tmp));
if (err < 0)
- printf("WARNING fdt_chosen: "
- "could not set linux,initrd-end (%s).\n",
+ printf("WARNING: "
+ "could not set linux,initrd-end %s.\n",
fdt_strerror(err));
}
#ifdef OF_STDOUT_PATH
err = fdt_setprop(fdt, nodeoffset,
"linux,stdout-path", OF_STDOUT_PATH, strlen(OF_STDOUT_PATH)+1);
if (err < 0)
- printf("WARNING fdt_chosen: "
- "could not set linux,stdout-path (%s).\n",
+ printf("WARNING: "
+ "could not set linux,stdout-path %s.\n",
fdt_strerror(err));
#endif
@@ -179,7 +179,7 @@ int fdt_env(void *fdt)
err = fdt_check_header(fdt);
if (err < 0) {
- printf("libfdt: %s\n", fdt_strerror(err));
+ printf("fdt_env: %s\n", fdt_strerror(err));
return err;
}
@@ -191,7 +191,7 @@ int fdt_env(void *fdt)
if (nodeoffset >= 0) {
err = fdt_del_node(fdt, nodeoffset);
if (err < 0) {
- printf("libfdt: %s\n", fdt_strerror(err));
+ printf("fdt_env: %s\n", fdt_strerror(err));
return err;
}
}
@@ -200,8 +200,8 @@ int fdt_env(void *fdt)
*/
nodeoffset = fdt_add_subnode(fdt, 0, "u-boot-env");
if (nodeoffset < 0) {
- printf("WARNING fdt_env: "
- "could not create the /u-boot-env node (%s).\n",
+ printf("WARNING: "
+ "could not create the /u-boot-env node %s.\n",
fdt_strerror(nodeoffset));
return nodeoffset;
}
@@ -230,8 +230,8 @@ int fdt_env(void *fdt)
continue;
err = fdt_setprop(fdt, nodeoffset, lval, rval, strlen(rval)+1);
if (err < 0) {
- printf("WARNING fdt_env: "
- "could not set %s (%s).\n",
+ printf("WARNING: "
+ "could not set %s %s.\n",
lval, fdt_strerror(err));
return err;
}
@@ -303,7 +303,7 @@ int fdt_bd_t(void *fdt)
err = fdt_check_header(fdt);
if (err < 0) {
- printf("libfdt: %s\n", fdt_strerror(err));
+ printf("fdt_bd_t: %s\n", fdt_strerror(err));
return err;
}
@@ -315,7 +315,7 @@ int fdt_bd_t(void *fdt)
if (nodeoffset >= 0) {
err = fdt_del_node(fdt, nodeoffset);
if (err < 0) {
- printf("libfdt: %s\n", fdt_strerror(err));
+ printf("fdt_bd_t: %s\n", fdt_strerror(err));
return err;
}
}
@@ -324,10 +324,10 @@ int fdt_bd_t(void *fdt)
*/
nodeoffset = fdt_add_subnode(fdt, 0, "bd_t");
if (nodeoffset < 0) {
- printf("WARNING fdt_bd_t: "
- "could not create the /bd_t node (%s).\n",
+ printf("WARNING: "
+ "could not create the /bd_t node %s.\n",
fdt_strerror(nodeoffset));
- printf("libfdt: %s\n", fdt_strerror(nodeoffset));
+ printf("fdt_bd_t: %s\n", fdt_strerror(nodeoffset));
return nodeoffset;
}
/*
@@ -338,8 +338,8 @@ int fdt_bd_t(void *fdt)
err = fdt_setprop(fdt, nodeoffset,
bd_map[i].name, &tmp, sizeof(tmp));
if (err < 0)
- printf("WARNING fdt_bd_t: "
- "could not set %s (%s).\n",
+ printf("WARNING: "
+ "could not set %s %s.\n",
bd_map[i].name, fdt_strerror(err));
}
/*
@@ -347,13 +347,13 @@ int fdt_bd_t(void *fdt)
*/
err = fdt_setprop(fdt, nodeoffset, "enetaddr", &bd->bi_enetaddr, 6);
if (err < 0)
- printf("WARNING fdt_bd_t: "
- "could not set enetaddr (%s).\n",
+ printf("WARNING: "
+ "could not set enetaddr %s.\n",
fdt_strerror(err));
err = fdt_setprop(fdt, nodeoffset, "ethspeed", &bd->bi_ethspeed, 4);
if (err < 0)
- printf("WARNING fdt_bd_t: "
- "could not set ethspeed (%s).\n",
+ printf("WARNING: "
+ "could not set ethspeed %s.\n",
fdt_strerror(err));
return 0;
}
--
1.4.4.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot-Users] [PATCH: u-boot-fdt] Improve error print messages.
2007-08-07 16:06 Jerry Van Baren
@ 2007-08-07 20:29 ` Kim Phillips
2007-08-08 7:15 ` Michal Simek
2007-08-09 21:05 ` Wolfgang Denk
1 sibling, 1 reply; 7+ messages in thread
From: Kim Phillips @ 2007-08-07 20:29 UTC (permalink / raw)
To: u-boot
On Tue, 07 Aug 2007 12:06:29 -0400
Jerry Van Baren <vanbaren@cideas.com> wrote:
> err = fdt_setprop(fdt, nodeoffset, "ethspeed", &bd->bi_ethspeed, 4);
> if (err < 0)
> - printf("WARNING fdt_bd_t: "
> - "could not set ethspeed (%s).\n",
> + printf("WARNING: "
> + "could not set ethspeed %s.\n",
some of these changes fit in 80 cols. It'd be nice to see the 3-liner
printfs reduced to 2-liners.
btw, in case you wanted someone to actually test, or check consistency
even, they can't because git-am bails with a "fatal: corrupt patch at
line 14". Meanwhile, checkpatch.pl suggests you have bad mailer
settings:
---
[kim at localhost u-boot]$ ../linux-2.6/scripts/checkpatch.pl --no-tree 44
ERROR: patch seems to be corrupt (line wrapped?)
#71: FILE: common/fdt_support.c:53:
initrd_end, int force)
ERROR: patch seems to be corrupt (line wrapped?)
#81: FILE: common/fdt_support.c:65:
initrd_end, int force)
ERROR: patch seems to be corrupt (line wrapped?)
#96: FILE: common/fdt_support.c:87:
initrd_end, int force)
ERROR: patch seems to be corrupt (line wrapped?)
#106: FILE: common/fdt_support.c:113:
initrd_end, int force)
ERROR: patch seems to be corrupt (line wrapped?)
#118: FILE: common/fdt_support.c:128:
initrd_end, int force)
ERROR: patch seems to be corrupt (line wrapped?)
#130: FILE: common/fdt_support.c:137:
ulong initrd_end, int force)
Your patch has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
---
Kim
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] [PATCH: u-boot-fdt] Improve error print messages.
@ 2007-08-08 1:26 Jerry Van Baren
0 siblings, 0 replies; 7+ messages in thread
From: Jerry Van Baren @ 2007-08-08 1:26 UTC (permalink / raw)
To: u-boot
Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
---
Take 2, tightening up the prints some more, combine the multi-line
strings onto one line where possible. Pretty soon we will have the
error message of ed <http://snap.nlc.dcccd.edu/learn/nlc/ed.html>. ;-)
common/fdt_support.c | 52 ++++++++++++++++++++-----------------------------
1 files changed, 21 insertions(+), 31 deletions(-)
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 259bd42..caaa682 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -54,7 +54,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
err = fdt_check_header(fdt);
if (err < 0) {
- printf("libfdt: %s\n", fdt_strerror(err));
+ printf("fdt_chosen: %s\n", fdt_strerror(err));
return err;
}
@@ -66,11 +66,11 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
err = fdt_num_reservemap(fdt, &used, &total);
if (err < 0) {
- printf("libfdt: %s\n", fdt_strerror(err));
+ printf("fdt_chosen: %s\n", fdt_strerror(err));
return err;
}
if (used >= total) {
- printf("WARNING fdt_chosen: "
+ printf("WARNING: "
"no room in the reserved map (%d of %d)\n",
used, total);
return -1;
@@ -88,7 +88,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
err = fdt_replace_reservemap_entry(fdt, j,
initrd_start, initrd_end - initrd_start + 1);
if (err < 0) {
- printf("libfdt: %s\n", fdt_strerror(err));
+ printf("fdt_chosen: %s\n", fdt_strerror(err));
return err;
}
}
@@ -114,8 +114,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
*/
nodeoffset = fdt_add_subnode(fdt, 0, "chosen");
if (nodeoffset < 0) {
- printf("WARNING fdt_chosen: "
- "could not create the /chosen node (%s).\n",
+ printf("WARNING: could not create /chosen %s.\n",
fdt_strerror(nodeoffset));
return nodeoffset;
}
@@ -129,8 +128,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
err = fdt_setprop(fdt, nodeoffset,
"bootargs", str, strlen(str)+1);
if (err < 0)
- printf("WARNING fdt_chosen: "
- "could not set bootargs (%s).\n",
+ printf("WARNING: could not set bootargs %s.\n",
fdt_strerror(err));
}
if (initrd_start && initrd_end) {
@@ -138,23 +136,21 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
err = fdt_setprop(fdt, nodeoffset,
"linux,initrd-start", &tmp, sizeof(tmp));
if (err < 0)
- printf("WARNING fdt_chosen: "
- "could not set linux,initrd-start (%s).\n",
+ printf("WARNING: "
+ "could not set linux,initrd-start %s.\n",
fdt_strerror(err));
tmp = __cpu_to_be32(initrd_end);
err = fdt_setprop(fdt, nodeoffset,
"linux,initrd-end", &tmp, sizeof(tmp));
if (err < 0)
- printf("WARNING fdt_chosen: "
- "could not set linux,initrd-end (%s).\n",
+ printf("WARNING: could not set linux,initrd-end %s.\n",
fdt_strerror(err));
}
#ifdef OF_STDOUT_PATH
err = fdt_setprop(fdt, nodeoffset,
"linux,stdout-path", OF_STDOUT_PATH, strlen(OF_STDOUT_PATH)+1);
if (err < 0)
- printf("WARNING fdt_chosen: "
- "could not set linux,stdout-path (%s).\n",
+ printf("WARNING: could not set linux,stdout-path %s.\n",
fdt_strerror(err));
#endif
@@ -179,7 +175,7 @@ int fdt_env(void *fdt)
err = fdt_check_header(fdt);
if (err < 0) {
- printf("libfdt: %s\n", fdt_strerror(err));
+ printf("fdt_env: %s\n", fdt_strerror(err));
return err;
}
@@ -191,7 +187,7 @@ int fdt_env(void *fdt)
if (nodeoffset >= 0) {
err = fdt_del_node(fdt, nodeoffset);
if (err < 0) {
- printf("libfdt: %s\n", fdt_strerror(err));
+ printf("fdt_env: %s\n", fdt_strerror(err));
return err;
}
}
@@ -200,8 +196,7 @@ int fdt_env(void *fdt)
*/
nodeoffset = fdt_add_subnode(fdt, 0, "u-boot-env");
if (nodeoffset < 0) {
- printf("WARNING fdt_env: "
- "could not create the /u-boot-env node (%s).\n",
+ printf("WARNING: could not create /u-boot-env %s.\n",
fdt_strerror(nodeoffset));
return nodeoffset;
}
@@ -230,8 +225,7 @@ int fdt_env(void *fdt)
continue;
err = fdt_setprop(fdt, nodeoffset, lval, rval, strlen(rval)+1);
if (err < 0) {
- printf("WARNING fdt_env: "
- "could not set %s (%s).\n",
+ printf("WARNING: could not set %s %s.\n",
lval, fdt_strerror(err));
return err;
}
@@ -303,7 +297,7 @@ int fdt_bd_t(void *fdt)
err = fdt_check_header(fdt);
if (err < 0) {
- printf("libfdt: %s\n", fdt_strerror(err));
+ printf("fdt_bd_t: %s\n", fdt_strerror(err));
return err;
}
@@ -315,7 +309,7 @@ int fdt_bd_t(void *fdt)
if (nodeoffset >= 0) {
err = fdt_del_node(fdt, nodeoffset);
if (err < 0) {
- printf("libfdt: %s\n", fdt_strerror(err));
+ printf("fdt_bd_t: %s\n", fdt_strerror(err));
return err;
}
}
@@ -324,10 +318,9 @@ int fdt_bd_t(void *fdt)
*/
nodeoffset = fdt_add_subnode(fdt, 0, "bd_t");
if (nodeoffset < 0) {
- printf("WARNING fdt_bd_t: "
- "could not create the /bd_t node (%s).\n",
+ printf("WARNING: could not create /bd_t %s.\n",
fdt_strerror(nodeoffset));
- printf("libfdt: %s\n", fdt_strerror(nodeoffset));
+ printf("fdt_bd_t: %s\n", fdt_strerror(nodeoffset));
return nodeoffset;
}
/*
@@ -338,8 +331,7 @@ int fdt_bd_t(void *fdt)
err = fdt_setprop(fdt, nodeoffset,
bd_map[i].name, &tmp, sizeof(tmp));
if (err < 0)
- printf("WARNING fdt_bd_t: "
- "could not set %s (%s).\n",
+ printf("WARNING: could not set %s %s.\n",
bd_map[i].name, fdt_strerror(err));
}
/*
@@ -347,13 +339,11 @@ int fdt_bd_t(void *fdt)
*/
err = fdt_setprop(fdt, nodeoffset, "enetaddr", &bd->bi_enetaddr, 6);
if (err < 0)
- printf("WARNING fdt_bd_t: "
- "could not set enetaddr (%s).\n",
+ printf("WARNING: could not set enetaddr %s.\n",
fdt_strerror(err));
err = fdt_setprop(fdt, nodeoffset, "ethspeed", &bd->bi_ethspeed, 4);
if (err < 0)
- printf("WARNING fdt_bd_t: "
- "could not set ethspeed (%s).\n",
+ printf("WARNING: could not set ethspeed %s.\n",
fdt_strerror(err));
return 0;
}
--
1.4.4.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot-Users] [PATCH: u-boot-fdt] Improve error print messages.
2007-08-07 20:29 ` Kim Phillips
@ 2007-08-08 7:15 ` Michal Simek
2007-08-08 12:50 ` Jerry Van Baren
0 siblings, 1 reply; 7+ messages in thread
From: Michal Simek @ 2007-08-08 7:15 UTC (permalink / raw)
To: u-boot
Hi,
I am trying to work with fdt (MPC8349EMDS board) but I have some problems.
I download the latest version from u-boot-fdt.git fdt branch
I made minor changes in setting file.
diff --git a/include/configs/MPC8349EMDS.h b/include/configs/MPC8349EMDS.h
index 1567fcf..33198d6 100644
--- a/include/configs/MPC8349EMDS.h
+++ b/include/configs/MPC8349EMDS.h
@@ -339,6 +339,7 @@
#endif
/* pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT 1
#define CONFIG_OF_FLAT_TREE 1
#define CONFIG_OF_BOARD_SETUP 1
@@ -739,7 +740,7 @@
"bootm ${kernel_addr} ${ramdisk_addr}\0" \
"net_nfs=tftp 200000 ${bootfile};run nfsargs addip addtty;" \
"bootm\0" \
- "load=tftp 100000 /tftpboot/mpc8349emds/u-boot.bin\0" \
+ "load=tftp 100000 mpc8349emds/u-boot.bin\0" \
"update=protect off fe000000 fe03ffff; " \
"era fe000000 fe03ffff; cp.b 100000 fe000000 ${filesize}\0" \
"upd=run load;run update\0" \
[monstr at simekmichal1 u-boot-fdt.git]$
I got error message in compiling process
ppc_82xx-gcc -g -Os -fPIC -ffixed-r14 -meabi -mrelocatable -D__KERNEL__ -DTEXT_BASE=0xFE000000 -I/tmp/1/u-boot-fdt.git/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/eldk/usr/bin/../lib/gcc/powerpc-linux/4.0.0/include -pipe -DCONFIG_PPC -D__powerpc__ -DCONFIG_MPC83XX -DCONFIG_E300 -ffixed-r2 -ffixed-r29 -msoft-float -Wall -Wstrict-prototypes -c -o cpu.o cpu.c
cpu.c: In function 'fdt_set_eth0':
cpu.c:336: warning: implicit declaration of function 'fdt_get_property'
cpu.c:337: warning: implicit declaration of function 'fdt_setprop'
cpu.c: In function 'ft_cpu_setup':
cpu.c:502: warning: implicit declaration of function 'fdt_find_node_by_path'
cpu.c:502: error: 'fdt' undeclared (first use in this function)
cpu.c:502: error: (Each undeclared identifier is reported only once
cpu.c:502: error: for each function it appears in.)
make[1]: *** [cpu.o] Error 1
make[1]: Leaving directory `/tmp/1/u-boot-fdt.git/cpu/mpc83xx'
make: *** [cpu/mpc83xx/libmpc83xx.a] Error 2
[monstr at simekmichal1 u-boot-fdt.git]$
I made simple changes. I suppose that function needs pointer to fdt structure.
diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c
index 1a6cba7..37cbaa8 100644
--- a/cpu/mpc83xx/cpu.c
+++ b/cpu/mpc83xx/cpu.c
@@ -497,6 +497,7 @@ ft_cpu_setup(void *blob, bd_t *bd)
int nodeoffset;
int err;
int j;
+ void *fdt=getenv("fdtaddr");
for (j = 0; j < (sizeof(fixup_props) / sizeof(fixup_props[0])); j++) {
nodeoffset = fdt_find_node_by_path(fdt, fixup_props[j].node);
Now building process ends with success.
I update U-BOOT in flash.
U-Boot 1.2.0-g96aa0fa0-dirty (Aug 8 2007 - 09:01:50) MPC83XX
I download dts compiler from Joe Loeliger site (http://www.jdl.com/git_repos/)
I found dts file which desribe board (file ../arch/powerpc/boot/dts/mpc834x_mds.dts ). Linux kernel 2.6.22 (kernel.org)
I convert it to dtb format with command
dtc -b 1 -R 4 -S 0x3000 -I dts -O dtb mpc834x_mds.dts > mpc8349emds.dtb
And load it to board
=> tftp 40000 mpc8349emds.dtb
Speed: 1000, full duplex
Using TSEC0 device
TFTP from server 10.0.0.1; our IP address is 10.0.0.5
Filename 'mpc8349emds.dtb'.
Load address: 0x40000
Loading: ###
done
Bytes transferred = 12288 (3000 hex)
=> fdt addr 40000
=> fdt print /
{
model="MPC8349EMDS";
compatible="MPC8349EMDS", "MPC834xMDS", "MPC83xxMDS";
#address-cells=<00000001>;
#size-cells=<00000001>;
cpus {
... lot of code
pic at 700 {
interrupt-controller;
#address-cells=<00000000>;
#interrupt-cells=<00000002>;
reg=<00000700 00000100>;
built-in;
device_type="ipic";
linux,phandle=<00000001>;
};
};
};
=>
Linux is built with setting from arch/powerpc/configs/mpc834x_mds_defconfig without any changes.
And then I tried to run sequence of commands
=> setenv bootargs root=/dev/ram rw console=ttyS0,9600
=> tftp 2000000 uRamdisk4
Speed: 1000, full duplex
Using TSEC0 device
TFTP from server 10.0.0.1; our IP address is 10.0.0.5
Filename 'uRamdisk4'.
Load address: 0x2000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#
done
Bytes transferred = 5327936 (514c40 hex)
=> tftp 1000000 uImage
Speed: 1000, full duplex
Using TSEC0 device
TFTP from server 10.0.0.1; our IP address is 10.0.0.5
Filename 'uImage'.
Load address: 0x1000000
Loading: #################################################################
#################################################################
#################################################################
#######################################
done
Bytes transferred = 1197628 (12463c hex)
=> bootm 1000000 2000000 40000
## Booting image at 01000000 ...
Image Name: Linux-2.6.22
Created: 2007-08-07 10:08:38 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 1197564 Bytes = 1.1 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
## Loading RAMDisk Image at 02000000 ...
Image Name: ramdisk
Created: 2007-07-13 8:36:51 UTC
Image Type: PowerPC Linux RAMDisk Image (uncompressed)
Data Size: 5327872 Bytes = 5.1 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Booting using the fdt at 0x40000
Loading Ramdisk to 0fa90000, end 0ffa4c00 ... OK
fdt_chosen: FDT_ERR_BADMAGIC
ERROR: /chosen node create failed - must RESET the board to recover.
Resetting the board.?
And I got an error. Do you know where is the problem?
Thanks for your responds,
Best regards,
Michal Simek
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot-Users] [PATCH: u-boot-fdt] Improve error print messages.
2007-08-08 7:15 ` Michal Simek
@ 2007-08-08 12:50 ` Jerry Van Baren
2007-08-08 13:38 ` Michal Simek
0 siblings, 1 reply; 7+ messages in thread
From: Jerry Van Baren @ 2007-08-08 12:50 UTC (permalink / raw)
To: u-boot
Michal Simek wrote:
> Hi,
>
> I am trying to work with fdt (MPC8349EMDS board) but I have some problems.
>
> I download the latest version from u-boot-fdt.git fdt branch
>
> I made minor changes in setting file.
>
> diff --git a/include/configs/MPC8349EMDS.h b/include/configs/MPC8349EMDS.h
> index 1567fcf..33198d6 100644
> --- a/include/configs/MPC8349EMDS.h
> +++ b/include/configs/MPC8349EMDS.h
> @@ -339,6 +339,7 @@
> #endif
>
> /* pass open firmware flat tree */
> +#define CONFIG_OF_LIBFDT 1
> #define CONFIG_OF_FLAT_TREE 1
> #define CONFIG_OF_BOARD_SETUP 1
Undefine CONFIG_OF_FLAT_TREE - it and CONFIG_OF_LIBFDT are mutually
exclusive. That is The Old Way, CONFIG_OF_LIBFDT is The New Way. The
following is the starting point. CONFIG_OF_BOARD_SETUP is most likely
necessary, CONFIG_OF_HAS_BD_T is either necessary or A Good Thing, and
CONFIG_OF_HAS_UBOOT_ENV is optional.
/* pass open firmware flat tree */
#define CONFIG_OF_LIBFDT 1
#undef CONFIG_OF_FLAT_TREE
#define CONFIG_OF_BOARD_SETUP 1
#define CONFIG_OF_HAS_BD_T 1
#define CONFIG_OF_HAS_UBOOT_ENV 1
>
> @@ -739,7 +740,7 @@
> "bootm ${kernel_addr} ${ramdisk_addr}\0" \
> "net_nfs=tftp 200000 ${bootfile};run nfsargs addip addtty;" \
> "bootm\0" \
> - "load=tftp 100000 /tftpboot/mpc8349emds/u-boot.bin\0" \
> + "load=tftp 100000 mpc8349emds/u-boot.bin\0" \
> "update=protect off fe000000 fe03ffff; " \
> "era fe000000 fe03ffff; cp.b 100000 fe000000 ${filesize}\0" \
> "upd=run load;run update\0" \
> [monstr at simekmichal1 u-boot-fdt.git]$
>
> I got error message in compiling process
>
> ppc_82xx-gcc -g -Os -fPIC -ffixed-r14 -meabi -mrelocatable -D__KERNEL__ -DTEXT_BASE=0xFE000000 -I/tmp/1/u-boot-fdt.git/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/eldk/usr/bin/../lib/gcc/powerpc-linux/4.0.0/include -pipe -DCONFIG_PPC -D__powerpc__ -DCONFIG_MPC83XX -DCONFIG_E300 -ffixed-r2 -ffixed-r29 -msoft-float -Wall -Wstrict-prototypes -c -o cpu.o cpu.c
> cpu.c: In function 'fdt_set_eth0':
> cpu.c:336: warning: implicit declaration of function 'fdt_get_property'
> cpu.c:337: warning: implicit declaration of function 'fdt_setprop'
> cpu.c: In function 'ft_cpu_setup':
> cpu.c:502: warning: implicit declaration of function 'fdt_find_node_by_path'
> cpu.c:502: error: 'fdt' undeclared (first use in this function)
> cpu.c:502: error: (Each undeclared identifier is reported only once
> cpu.c:502: error: for each function it appears in.)
> make[1]: *** [cpu.o] Error 1
> make[1]: Leaving directory `/tmp/1/u-boot-fdt.git/cpu/mpc83xx'
> make: *** [cpu/mpc83xx/libmpc83xx.a] Error 2
> [monstr at simekmichal1 u-boot-fdt.git]$
>
> I made simple changes. I suppose that function needs pointer to fdt structure.
>
> diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c
> index 1a6cba7..37cbaa8 100644
> --- a/cpu/mpc83xx/cpu.c
> +++ b/cpu/mpc83xx/cpu.c
> @@ -497,6 +497,7 @@ ft_cpu_setup(void *blob, bd_t *bd)
> int nodeoffset;
> int err;
> int j;
> + void *fdt=getenv("fdtaddr");
>
> for (j = 0; j < (sizeof(fixup_props) / sizeof(fixup_props[0])); j++) {
> nodeoffset = fdt_find_node_by_path(fdt, fixup_props[j].node);
>
> Now building process ends with success.
Perhaps successful build, but the wrong fix. The problem is due to your
enabling CONFIG_OF_FLAT_TREE.
[snip]
> And I got an error. Do you know where is the problem?
Yes.
> Thanks for your responds,
> Best regards,
>
> Michal Simek
HTH,
gvb
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] [PATCH: u-boot-fdt] Improve error print messages.
2007-08-08 12:50 ` Jerry Van Baren
@ 2007-08-08 13:38 ` Michal Simek
0 siblings, 0 replies; 7+ messages in thread
From: Michal Simek @ 2007-08-08 13:38 UTC (permalink / raw)
To: u-boot
HI,
>Undefine CONFIG_OF_FLAT_TREE - it and CONFIG_OF_LIBFDT are mutually
>exclusive. That is The Old Way, CONFIG_OF_LIBFDT is The New Way. The
>following is the starting point. CONFIG_OF_BOARD_SETUP is most likely
>necessary, CONFIG_OF_HAS_BD_T is either necessary or A Good Thing, and
>CONFIG_OF_HAS_UBOOT_ENV is optional.
>
>/* pass open firmware flat tree */
>#define CONFIG_OF_LIBFDT 1
>#undef CONFIG_OF_FLAT_TREE
>#define CONFIG_OF_BOARD_SETUP 1
>#define CONFIG_OF_HAS_BD_T 1
>#define CONFIG_OF_HAS_UBOOT_ENV 1
I changed setting but I have problem with compilation.
/* pass open firmware flat tree */
-#define CONFIG_OF_FLAT_TREE 1
+#define CONFIG_OF_LIBFDT 1
+#undef CONFIG_OF_FLAT_TREE
#define CONFIG_OF_BOARD_SETUP 1
+#define CONFIG_OF_HAS_BD_T 1
+#define CONFIG_OF_HAS_UBOOT_ENV
MPC8349 has compilation problem.
common/libcommon.a(cmd_bootm.o): In function `do_bootm_linux':
/tmp/1/u-boot-fdt.git/common/cmd_bootm.c:978: undefined reference to `ft_board_setup'
common/libcommon.a(cmd_fdt.o): In function `do_fdt':
/tmp/1/u-boot-fdt.git/common/cmd_fdt.c:300: undefined reference to `ft_board_setup'
make: *** [u-boot] Error 1
I tried to change board specific file. Part of patch is below. And function ft_get_prop isn't available. Function ft_get_prop is in common/ft_build.c and this file is in CONFIG_OF_FLAT_TREE choice. What can I do with this?
--- a/board/mpc8349emds/mpc8349emds.c
+++ b/board/mpc8349emds/mpc8349emds.c
@@ -584,7 +584,7 @@ U_BOOT_CMD(
);
#endif /* if defined(CONFIG_DDR_ECC) && defined(CONFIG_DDR_ECC_CMD) */
-#if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
void
ft_board_setup(void *blob, bd_t *bd)
{
I can try fdt on PQ3 (MPC8560 and EP8548).Is it better choise than PQ II Pro?
Best regards,
Michal Simek
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] [PATCH: u-boot-fdt] Improve error print messages.
2007-08-07 16:06 Jerry Van Baren
2007-08-07 20:29 ` Kim Phillips
@ 2007-08-09 21:05 ` Wolfgang Denk
1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2007-08-09 21:05 UTC (permalink / raw)
To: u-boot
In message <46B89885.7020204@cideas.com> you wrote:
> Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
> ---
>
> The American expression is "polishing the turd"... :-)
When is your repo ready for pulling? We are waiting for it....
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
[Doctors and Bartenders], We both get the same two kinds of customers
-- the living and the dying.
-- Dr. Boyce, "The Menagerie" ("The Cage"), stardate unknown
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-08-09 21:05 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-08 1:26 [U-Boot-Users] [PATCH: u-boot-fdt] Improve error print messages Jerry Van Baren
-- strict thread matches above, loose matches on Subject: below --
2007-08-07 16:06 Jerry Van Baren
2007-08-07 20:29 ` Kim Phillips
2007-08-08 7:15 ` Michal Simek
2007-08-08 12:50 ` Jerry Van Baren
2007-08-08 13:38 ` Michal Simek
2007-08-09 21:05 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox