[U-Boot-Users] TFTP boot in u-boot

Hi,
I am trying to do some porting for the blackfin bf533 processor. Currently i am working with tftp boot. I am able to transfer a file from the host to the target. Now i need to boot the linux image on the target. I am just taking the bf533 2.4 kernel available in the blackfin site and i want to boot this via tftp.
i just say tftpboot 1000 linux.dxe.
(Actually an elf header gets added to the contents of around 94 bytes. So i even tried loading the linux.dxe to (1000 - 94), i have compared the objdump with the VDSP contents. Its just 1to1.
when i say go 1000, it simply hangs. When i try to stop VDSP and load the PC with 1000 and say go also it hangs. Do i need to do something else?
I also tried by creating uImage as mentioned under README. Is it really required?
Pls let me know how can i boot this linux image from my bootloader?
regards kruthi

Hi, Your way of loading is wrong.
You have to follow the below procedure 1. download the elf image into memory some where, say example tftpboot 0x800000 linux.dxe (consider the memory space availability and use the address according to that.)
2. use the "bootelf" command to load the ELF image. bootelf 0x800000
Regards Ganapathi C
----- Original Message ----- From: "Kruthi" kruthi_77@coolgoose.com To: u-boot-users@lists.sourceforge.net Sent: Friday, April 09, 2004 5:21 PM Subject: [U-Boot-Users] TFTP boot in u-boot
Hi,
I am trying to do some porting for the blackfin bf533 processor. Currently
i am
working with tftp boot. I am able to transfer a file from the host to the
target. Now i
need to boot the linux image on the target. I am just taking the bf533 2.4
kernel
available in the blackfin site and i want to boot this via tftp.
i just say tftpboot 1000 linux.dxe.
(Actually an elf header gets added to the contents of around 94 bytes. So
i even
tried loading the linux.dxe to (1000 - 94), i have compared the objdump
with the
VDSP contents. Its just 1to1.
when i say go 1000, it simply hangs. When i try to stop VDSP and load the
PC
with 1000 and say go also it hangs. Do i need to do something else?
I also tried by creating uImage as mentioned under README. Is it really
required?
Pls let me know how can i boot this linux image from my bootloader?
regards kruthi
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users

In message 00f501c41e25$bfd977e0$af00a8c0@tidelpark.isofttechindia.com you wrote:
Hi, Your way of loading is wrong.
You have to follow the below procedure
- download the elf image into memory some where, say example tftpboot 0x800000 linux.dxe (consider the memory space availability and use the address according to
that.)
- use the "bootelf" command to load the ELF image. bootelf 0x800000
If this is really the case, then the Linux support for this proccessor is not implemented correctly. U-Boot is supposed to allow "tftp ... ; bootm" on all known architectures.
Best regards,
Wolfgang Denk

Hello.
Is there anyone successfully using pci_hose_write_config_{byte,word}_via_dword defined as a macro in drivers/pci.c? Or, are you sure what the code there is doing? When I tried to use it, writing a byte failed and I used the following code.
I think the current code is just wrong, but I can't explain how it's wrong since I can't understand the intention of the code. :-)
Masao #define __mask(_o, _v) \ (_v << ((offset & _o) * 8))
#define __data(_o, _v) \ ((((unsigned long)(val)) & _v) << ((offset & _o) * 8))
#define PCI_WRITE_VIA_DWORD_OP(__size, __type, __offsetmask, __valmask) \ int pci_hose_write_config_##__size##_via_dword( \ struct pci_controller *hose, \ pci_dev_t dev, \ int offset, \ __type val) \ { \ u32 val32; \ \ if (pci_hose_read_config_dword(hose, dev, offset & ~0x3, &val32) < 0) \ return -1; \ /* Clear a byte/word in a word. */ \ val32 &= ~__mask(__offsetmask, __valmask); \ /* Fill a cleared byte/word in a word with a byte/word value. */ \ val32 |= __data(__offsetmask, __valmask); \ /* Write the value as a word! */ \ if (pci_hose_write_config_dword(hose, dev, offset & ~0x3, val32) < 0) \ return -1; \ \ return 0; \ }

I have confirmed the problem reported in this list.
When pci_hose_write_config_{byte,word}_via_dword is used the upper byte is destroied.
If you can access pci device, please execute pci command as the followings.
# pci w.l 00.0c.00 10 12345600 # pci display 00.0c.00 10 00000010: 12345601 10000000 00000000 00000000
# pci w.b 00.0c.00 13 ff # pci display 00.0c.00 10 00000010: ff345601 10000000 00000000 00000000 <== GOOD
-----------------------------------------------------------
# pci w.l 00.0c.00 10 12345600 # pci display 00.0c.00 10 00000010: 12345601 10000000 00000000 00000000
# pci w.b 00.0c.00 12 ff # pci display 00.0c.00 10 00000010: 00ff5601 10000000 00000000 00000000 <== NG
-----------------------------------------------------------
# pci w.l 00.0c.00 10 12345600 # pci display 00.0c.00 10 00000010: 12345601 10000000 00000000 00000000
# pci w.b 00.0c.00 11 ff # pci display 00.0c.00 10 00000010: 0034ff01 10000000 00000000 00000000 <== NG
-----------------------------------------------------------
# pci w.l 00.0c.00 10 12345600 # pci display 00.0c.00 10 00000010: 12345601 10000000 00000000 00000000
# pci w.w 00.0c.00 10 ffff # pci display 00.0c.00 10 00000010: 0000ff01 10000000 00000000 00000000 <== NG
How is your result ?
Best regards.
Masami Komiya
Masao Uebayashi wrote:
Hello.
Is there anyone successfully using pci_hose_write_config_{byte,word}_via_dword defined as a macro in drivers/pci.c? Or, are you sure what the code there is doing? When I tried to use it, writing a byte failed and I used the following code.
I think the current code is just wrong, but I can't explain how it's wrong since I can't understand the intention of the code. :-)
Masao #define __mask(_o, _v) \ (_v << ((offset & _o) * 8))
#define __data(_o, _v) \ ((((unsigned long)(val)) & _v) << ((offset & _o) * 8))
#define PCI_WRITE_VIA_DWORD_OP(__size, __type, __offsetmask, __valmask) \ int pci_hose_write_config_##__size##_via_dword( \ struct pci_controller *hose, \ pci_dev_t dev, \ int offset, \ __type val) \ { \ u32 val32; \ \ if (pci_hose_read_config_dword(hose, dev, offset & ~0x3, &val32) < 0) \ return -1; \ /* Clear a byte/word in a word. */ \ val32 &= ~__mask(__offsetmask, __valmask); \ /* Fill a cleared byte/word in a word with a byte/word value. */ \ val32 |= __data(__offsetmask, __valmask); \ /* Write the value as a word! */ \ if (pci_hose_write_config_dword(hose, dev, offset & ~0x3, val32) < 0) \ return -1; \ \ return 0; \ }
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users

Dear Wolfgang,
The attached patch fixes the pci_hose_write_config_{byte,word}_via_dword problem.
The original code is difficult to understand, so I have changed the code not only fixing.
Best regards.
Masami Komiya
Masami Komiya wrote:
I have confirmed the problem reported in this list.
When pci_hose_write_config_{byte,word}_via_dword is used the upper byte is destroied.
If you can access pci device, please execute pci command as the followings.
# pci w.l 00.0c.00 10 12345600 # pci display 00.0c.00 10 00000010: 12345601 10000000 00000000 00000000
# pci w.b 00.0c.00 13 ff # pci display 00.0c.00 10 00000010: ff345601 10000000 00000000 00000000 <== GOOD
# pci w.l 00.0c.00 10 12345600 # pci display 00.0c.00 10 00000010: 12345601 10000000 00000000 00000000
# pci w.b 00.0c.00 12 ff # pci display 00.0c.00 10 00000010: 00ff5601 10000000 00000000 00000000 <== NG
# pci w.l 00.0c.00 10 12345600 # pci display 00.0c.00 10 00000010: 12345601 10000000 00000000 00000000
# pci w.b 00.0c.00 11 ff # pci display 00.0c.00 10 00000010: 0034ff01 10000000 00000000 00000000 <== NG
# pci w.l 00.0c.00 10 12345600 # pci display 00.0c.00 10 00000010: 12345601 10000000 00000000 00000000
# pci w.w 00.0c.00 10 ffff # pci display 00.0c.00 10 00000010: 0000ff01 10000000 00000000 00000000 <== NG
How is your result ?
Best regards.
Masami Komiya
Masao Uebayashi wrote:
Hello.
Is there anyone successfully using pci_hose_write_config_{byte,word}_via_dword defined as a macro in drivers/pci.c? Or, are you sure what the code there is doing? When I tried to use it, writing a byte failed and I used the following code.
I think the current code is just wrong, but I can't explain how it's wrong since I can't understand the intention of the code. :-)
Masao #define __mask(_o, _v) \ (_v << ((offset & _o) * 8))
#define __data(_o, _v) \ ((((unsigned long)(val)) & _v) << ((offset & _o) * 8))
#define PCI_WRITE_VIA_DWORD_OP(__size, __type, __offsetmask, __valmask) \ int pci_hose_write_config_##__size##_via_dword( \ struct pci_controller *hose, \ pci_dev_t dev, \ int offset, \ __type val) \ { \ u32 val32; \ \ if (pci_hose_read_config_dword(hose, dev, offset & ~0x3, &val32) < 0) \ return -1; \ /* Clear a byte/word in a word. */ \ val32 &= ~__mask(__offsetmask, __valmask); \ /* Fill a cleared byte/word in a word with a byte/word value. */ \ val32 |= __data(__offsetmask, __valmask); \ /* Write the value as a word! */ \ if (pci_hose_write_config_dword(hose, dev, offset & ~0x3, val32) < 0) \ return -1; \ \ return 0; \ }
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
--- pci.c.org 2004-03-15 07:31:20.000000000 +0900 +++ pci.c 2004-04-12 17:56:18.000000000 +0900 @@ -103,14 +103,14 @@ pci_dev_t dev, \ int offset, type val) \ { \ - u32 val32, mask, ldata; \ + u32 val32, mask, ldata, shift; \ \ if (pci_hose_read_config_dword(hose, dev, offset & 0xfc, &val32) < 0)\ return -1; \ \ - mask = val_mask; \ - ldata = (((unsigned long)val) & mask) << ((offset & (int)off_mask) * 8);\ - mask <<= ((mask & (int)off_mask) * 8); \ + shift = ((offset & (int)off_mask) * 8); \ + ldata = (((unsigned long)val) & val_mask) << shift; \ + mask = val_mask << shift; \ val32 = (val32 & ~mask) | ldata; \ \ if (pci_hose_write_config_dword(hose, dev, offset & 0xfc, val32) < 0)\

In message 407A5CEC.9070507@sonare.it you wrote:
The attached patch fixes the pci_hose_write_config_{byte,word}_via_dword problem.
Checked in.
The original code is difficult to understand, so I have changed the code not only fixing.
Thanks.
Best regards,
Wolfgang Denk
participants (5)
-
ganapathi
-
Kruthi
-
Masami Komiya
-
Masao Uebayashi
-
Wolfgang Denk