Skip to contentSkip to conversation

TFTP boot in u-boot

U-Boot-Users Kruthi 5 participants 7 messages Apr 9, 2004 – Apr 18, 2004

lore
Share & tools
lore

Kruthi

author
#0 lore raw

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

#1 lore raw

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" <[email protected]>
To: <[email protected]>
Sent: Friday, April 09, 2004 5:21 PM
Subject: [U-Boot-Users] TFTP boot in u-boot

Quoted 3 lines

Hi,

I am trying to do some porting for the blackfin bf533 processor. Currently

i am

Quoted 1 line

working with tftp boot. I am able to transfer a file from the host to the

target. Now i

Quoted 1 line

need to boot the linux image on the target. I am just taking the bf533 2.4

kernel

Quoted 5 lines

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

Quoted 1 line

tried loading the linux.dxe to (1000 - 94), i have compared the objdump

with the

Quoted 3 lines

VDSP contents. Its just 1to1.

when i say go 1000, it simply hangs. When i try to stop VDSP and load the

PC

Quoted 3 lines

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?

Quoted 20 lines

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 at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

#2 lore raw
Quoted 11 lines · In message <[email protected]> you…

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

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

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
What was sliced bread the greatest thing since?
#3 lore raw

[U-Boot-Users] pci_hose_write_config_{byte,word}_via_dword?

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;							\
}
#4 lore raw

[U-Boot-Users] pci_hose_write_config_{byte,word}_via_dword?

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

Quoted 52 lines · Masao Uebayashi

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 at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

#5 lore raw

[U-Boot-Users] pci_hose_write_config_{byte,word}_via_dword?

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

Quoted 114 lines · Masami Komiya

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

Quoted 44 lines · Masao Uebayashi

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;                            \
}
Quoted 11 lines

-------------------------------------------------------
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 at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Quoted 11 lines

-------------------------------------------------------
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 at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pci.patch
Url: http://lists.denx.de/pipermail/u-boot/attachments/20040412/90d1a5a0/attachment.txt

#6 lore raw

[U-Boot-Users] pci_hose_write_config_{byte,word}_via_dword?

Quoted 2 lines · In message <[email protected]> you wrote:

The attached patch fixes the pci_hose_write_config_{byte,word}_via_dword problem.

Checked in.

Quoted 2 lines

The original code is difficult to understand, so I have changed the code not only fixing.

Thanks.

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
To be is to program.