Re: [U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200

Dear Łukasz Dałek,
On 19.09.2012 23:02, Marek Vasut wrote:
- .org 0x40
- .ascii "ECEC"
ECEC ... looks familiar, what is it though? WinCE bootloader signature ?
Yes.
+#endif
- return 0;
+}
+/*
- iPAQ h2200 has two stage bootloader.
- We only replace 2nd stage, so u-boot needs to be
- adpopted to the way how 1st stage bootloader works.
- Firstly, code needs to have first 4 bytes equal to
- 0xea0003fe (arm instruction b 0x1000)
GCC/GAS won't generate it so you use .word ?
No. GCC generates sth else than 0xea0003fe.
Try b 0x9098 ... is that it ?
Please keep CC
Best regards, Marek Vasut

On 19.09.2012 23:43, Marek Vasut wrote:
+#endif
- return 0;
+}
+/*
- iPAQ h2200 has two stage bootloader.
- We only replace 2nd stage, so u-boot needs to be
- adpopted to the way how 1st stage bootloader works.
- Firstly, code needs to have first 4 bytes equal to
- 0xea0003fe (arm instruction b 0x1000)
GCC/GAS won't generate it so you use .word ?
No. GCC generates sth else than 0xea0003fe.
Try b 0x9098 ... is that it ?
Yes, GCC/GAS generate 0xeafffffe (b 0x9098).
Can you tell me why? Can I left .word?
Łukasz Dałek

Dear Łukasz Dałek,
On 19.09.2012 23:43, Marek Vasut wrote:
+#endif
- return 0;
+}
+/*
- iPAQ h2200 has two stage bootloader.
- We only replace 2nd stage, so u-boot needs to be
- adpopted to the way how 1st stage bootloader works.
- Firstly, code needs to have first 4 bytes equal to
- 0xea0003fe (arm instruction b 0x1000)
GCC/GAS won't generate it so you use .word ?
No. GCC generates sth else than 0xea0003fe.
Try b 0x9098 ... is that it ?
Yes, GCC/GAS generate 0xeafffffe (b 0x9098).
Can you tell me why? Can I left .word?
Why is the jump offset 0x9098 ?
Łukasz Dałek
Best regards, Marek Vasut

On 20.09.2012 00:01, Marek Vasut wrote:
Yes, GCC/GAS generate 0xeafffffe (b 0x9098).
Can you tell me why? Can I left .word? Why is the jump offset 0x9098 ?
I figured out that 0xeafffffe is a loop (b -4) but I don't know why toolchain generate b -4 instead of b 0x1000 and I don't know how to fix it (without .word).
Łukasz Dałek

Dear Łukasz Dałek,
On 20.09.2012 00:01, Marek Vasut wrote:
Yes, GCC/GAS generate 0xeafffffe (b 0x9098).
Can you tell me why? Can I left .word? Why is the jump offset 0x9098 ?
I figured out that 0xeafffffe is a loop (b -4)
ldr pc, pc, #-4
but I don't know why toolchain generate b -4 instead of b 0x1000 and I don't know how to fix it (without .word).
I don't follow, sorry. How did you even get to 0xeafffffe ?
Łukasz Dałek
Best regards, Marek Vasut

On 20.09.2012 00:42, Marek Vasut wrote:
Dear Łukasz Dałek,
On 20.09.2012 00:01, Marek Vasut wrote:
Yes, GCC/GAS generate 0xeafffffe (b 0x9098).
Can you tell me why? Can I left .word? Why is the jump offset 0x9098 ?
I figured out that 0xeafffffe is a loop (b -4)
ldr pc, pc, #-4
but I don't know why toolchain generate b -4 instead of b 0x1000 and I don't know how to fix it (without .word).
I don't follow, sorry. How did you even get to 0xeafffffe ?
My point is that GCC/GAS generate 0xeafffffe instead of 0xea0003fe when I use 'b 0x1000'. That's why I use directive .word 0xea0003fe instead of asm instruction 'b 0x1000'. But I don't know that: Can I leave that .word directive or I can not.
Another question: I asked in cover letter question about tools. Can I add them in h2200 directory or should I put them somwhere else?
Łukasz Dałek

Dear Łukasz Dałek,
On 20.09.2012 00:42, Marek Vasut wrote:
Dear Łukasz Dałek,
On 20.09.2012 00:01, Marek Vasut wrote:
Yes, GCC/GAS generate 0xeafffffe (b 0x9098).
Can you tell me why? Can I left .word? Why is the jump offset 0x9098 ?
I figured out that 0xeafffffe is a loop (b -4)
ldr pc, pc, #-4
but I don't know why toolchain generate b -4 instead of b 0x1000 and I don't know how to fix it (without .word).
I don't follow, sorry. How did you even get to 0xeafffffe ?
My point is that GCC/GAS generate 0xeafffffe instead of 0xea0003fe when I use 'b 0x1000'.
How did you get to 0x1000 ?
That's why I use directive .word 0xea0003fe
Check some arm instruction quick ref for what 0xea0003fe really is and if it really is necessary or anything else work just fine as well.
instead of asm instruction 'b 0x1000'. But I don't know that: Can I leave that .word directive or I can not.
Another question: I asked in cover letter question about tools. Can I add them in h2200 directory or should I put them somwhere else?
I didn't receive the cover letter.
Łukasz Dałek
Best regards, Marek Vasut

On 20.09.2012 00:56, Marek Vasut wrote:
That's why I use directive .word 0xea0003fe
Check some arm instruction quick ref for what 0xea0003fe really is and if it really is necessary or anything else work just fine as well.
0xea0003fe is a branch instruction. 0x3fe is an offset (0x3fe << 2 + 8 = 0x1000) And I will left it. Bootloader checks for 4 bytes which have to be equal 0xfe, 0x03, 0x00, 0xea and for 4 bytes at the offset 0x40 which have to be equal E, C, E, C
instead of asm instruction 'b 0x1000'. But I don't know that: Can I leave that .word directive or I can not.
Another question: I asked in cover letter question about tools. Can I add them in h2200 directory or should I put them somwhere else?
I didn't receive the cover letter.
Weird, I sent it with patches. With your address in CC field. Btw. Did you got all 6 patches?
Łukasz Dałek

Dear Łukasz Dałek,
On 20.09.2012 00:56, Marek Vasut wrote:
That's why I use directive .word 0xea0003fe
Check some arm instruction quick ref for what 0xea0003fe really is and if it really is necessary or anything else work just fine as well.
0xea0003fe is a branch instruction. 0x3fe is an offset (0x3fe << 2 + 8 = 0x1000) And I will left it. Bootloader checks for 4 bytes which have to be equal 0xfe, 0x03, 0x00, 0xea and for 4 bytes at the offset 0x40 which have to be equal E, C, E, C
It checks the branch instruction? What a piece of crap ... can't you replace it as well?
instead of asm instruction 'b 0x1000'. But I don't know that: Can I leave that .word directive or I can not.
Another question: I asked in cover letter question about tools. Can I add them in h2200 directory or should I put them somwhere else?
I didn't receive the cover letter.
Weird, I sent it with patches. With your address in CC field. Btw. Did you got all 6 patches?
Yes
Next time add
Cc: <>
to the cover letter too.
Łukasz Dałek
Best regards, Marek Vasut

On 20.09.2012 01:09, Marek Vasut wrote:
Dear Łukasz Dałek,
On 20.09.2012 00:56, Marek Vasut wrote:
That's why I use directive .word 0xea0003fe
Check some arm instruction quick ref for what 0xea0003fe really is and if it really is necessary or anything else work just fine as well.
0xea0003fe is a branch instruction. 0x3fe is an offset (0x3fe<< 2 + 8 = 0x1000) And I will left it. Bootloader checks for 4 bytes which have to be equal 0xfe, 0x03, 0x00, 0xea and for 4 bytes at the offset 0x40 which have to be equal E, C, E, C
It checks the branch instruction? What a piece of crap ... can't you replace it as well?
I can't. I would have to prepare sth like x-loader used in ti omap processors. And I want to add driver for sdcard and flash and keyboard and lcd would be nice... So I will left it as it is for now.
Łukasz Dałek

Dear Łukasz Dałek,
On 20.09.2012 01:09, Marek Vasut wrote:
Dear Łukasz Dałek,
On 20.09.2012 00:56, Marek Vasut wrote:
That's why I use directive .word 0xea0003fe
Check some arm instruction quick ref for what 0xea0003fe really is and if it really is necessary or anything else work just fine as well.
0xea0003fe is a branch instruction. 0x3fe is an offset (0x3fe<< 2 + 8 = 0x1000) And I will left it. Bootloader checks for 4 bytes which have to be equal 0xfe, 0x03, 0x00, 0xea and for 4 bytes at the offset 0x40 which have to be equal E, C, E, C
It checks the branch instruction? What a piece of crap ... can't you replace it as well?
I can't. I would have to prepare sth like x-loader used in ti omap processors.
What? Why?
And I want to add driver for sdcard and flash and keyboard and lcd would be nice... So I will left it as it is for now.
these drivers are already in uboot
Łukasz Dałek
Best regards, Marek Vasut

On 20.09.2012 01:25, Marek Vasut wrote:
Dear Łukasz Dałek,
On 20.09.2012 01:09, Marek Vasut wrote:
Dear Łukasz Dałek,
On 20.09.2012 00:56, Marek Vasut wrote:
That's why I use directive .word 0xea0003fe
Check some arm instruction quick ref for what 0xea0003fe really is and if it really is necessary or anything else work just fine as well.
0xea0003fe is a branch instruction. 0x3fe is an offset (0x3fe<< 2 + 8 = 0x1000) And I will left it. Bootloader checks for 4 bytes which have to be equal 0xfe, 0x03, 0x00, 0xea and for 4 bytes at the offset 0x40 which have to be equal E, C, E, C
It checks the branch instruction? What a piece of crap ... can't you replace it as well?
I can't. I would have to prepare sth like x-loader used in ti omap processors.
What? Why?
h2200 uses companion chip from Samsung. When device is powered on chip loads 16kb of flash into internal SRAM and PXA executes it. That program is 1st stage bootloader. But u-boot for my device has ~180kb. So it's to big for SRAM.
And I want to add driver for sdcard and flash and keyboard and lcd would be nice... So I will left it as it is for now.
these drivers are already in uboot
I haven't seen any MediaQ 1178 drivers (LCD). Also SD card and FLASH controllers are embedded in companion chip. Chip is based on S3C440 (or 410?) processor but needs some tweaks and tests.
Łukasz Dałek

Dear Łukasz Dałek,
On 20.09.2012 01:25, Marek Vasut wrote:
Dear Łukasz Dałek,
On 20.09.2012 01:09, Marek Vasut wrote:
Dear Łukasz Dałek,
On 20.09.2012 00:56, Marek Vasut wrote:
> That's why I use directive .word 0xea0003fe
Check some arm instruction quick ref for what 0xea0003fe really is and if it really is necessary or anything else work just fine as well.
0xea0003fe is a branch instruction. 0x3fe is an offset (0x3fe<< 2 + 8 = 0x1000) And I will left it. Bootloader checks for 4 bytes which have to be equal 0xfe, 0x03, 0x00, 0xea and for 4 bytes at the offset 0x40 which have to be equal E, C, E, C
It checks the branch instruction? What a piece of crap ... can't you replace it as well?
I can't. I would have to prepare sth like x-loader used in ti omap processors.
What? Why?
h2200 uses companion chip from Samsung.
OneNAND ?
When device is powered on chip loads 16kb of flash into internal SRAM and PXA executes it. That program is 1st stage bootloader.
Check OneNAND SPL
But u-boot for my device has ~180kb. So it's to big for SRAM.
And I want to add driver for sdcard and flash and keyboard and lcd would be nice... So I will left it as it is for now.
these drivers are already in uboot
I haven't seen any MediaQ 1178 drivers (LCD).
oh it has separate LCD or it uses PXA LCDIF ?
Also SD card and FLASH controllers are embedded in companion chip.
ASIC3 ?
Chip is based on S3C440 (or 410?) processor but needs some tweaks and tests.
Uhhh ?
Łukasz Dałek
Best regards, Marek Vasut

On 20.09.2012 01:43, Marek Vasut wrote:
h2200 uses companion chip from Samsung. OneNAND ?
When device is powered on chip loads 16kb of flash into internal SRAM and PXA executes it. That program is 1st stage bootloader.
Check OneNAND SPL
I'm not sure I didn't checked yet.
But u-boot for my device has ~180kb. So it's to big for SRAM.
And I want to add driver for sdcard and flash and keyboard and lcd would be nice... So I will left it as it is for now.
these drivers are already in uboot
I haven't seen any MediaQ 1178 drivers (LCD).
oh it has separate LCD or it uses PXA LCDIF ?
MQ1178 is a separate SoC.
Also SD card and FLASH controllers are embedded in companion chip.
ASIC3 ?
Hamcop
Chip is based on S3C440 (or 410?) processor but needs some tweaks and tests.
Uhhh ?
Hamcop chip looks like s3c2440 processor without ARM core and with internal data busses limited to 16bytes. Really weird and buggy thing.
Łukasz Dałek

Dear Łukasz Dałek,
On 20.09.2012 01:43, Marek Vasut wrote:
h2200 uses companion chip from Samsung. OneNAND ?
When device is powered on chip loads 16kb of flash into internal SRAM and PXA executes it. That program is 1st stage bootloader.
Check OneNAND SPL
I'm not sure I didn't checked yet.
But u-boot for my device has ~180kb. So it's to big for SRAM.
And I want to add driver for sdcard and flash and keyboard and lcd would be nice... So I will left it as it is for now.
these drivers are already in uboot
I haven't seen any MediaQ 1178 drivers (LCD).
oh it has separate LCD or it uses PXA LCDIF ?
MQ1178 is a separate SoC.
Also SD card and FLASH controllers are embedded in companion chip.
ASIC3 ?
Hamcop
Chip is based on S3C440 (or 410?) processor but needs some tweaks and tests.
Uhhh ?
Hamcop chip looks like s3c2440 processor without ARM core and with internal data busses limited to 16bytes. Really weird and buggy thing.
:-(
Łukasz Dałek
Best regards, Marek Vasut
participants (2)
-
Marek Vasut
-
Łukasz Dałek