Re: [U-Boot] [PATCH v2 4/8] nios2: enlarge the code relocation range

2015-09-07 Thread Marek Vasut
On Monday, September 07, 2015 at 03:47:46 AM, Thomas Chou wrote: > Hi Marek, Hi! > On 09/07/2015 08:53 AM, Marek Vasut wrote: > > Where did that 64KB figure come from ? :O > > This is estimated from 41KB of the SPL of socfpga. The code density of > nios2 is worse than ARM. > > > I assume the si

Re: [U-Boot] [PATCH v2 4/8] nios2: enlarge the code relocation range

2015-09-06 Thread Thomas Chou
Hi Marek, On 09/07/2015 08:53 AM, Marek Vasut wrote: Where did that 64KB figure come from ? :O This is estimated from 41KB of the SPL of socfpga. The code density of nios2 is worse than ARM. I assume the simple loader is just a copy loop, huh ? And you synthesise a small RAM or ROM into th

Re: [U-Boot] [PATCH v2 4/8] nios2: enlarge the code relocation range

2015-09-06 Thread Marek Vasut
On Monday, September 07, 2015 at 02:22:52 AM, Thomas Chou wrote: > Hi Marek, Hi! > On 09/06/2015 11:23 PM, Marek Vasut wrote: > > Uh oh, is this copying something the U-Boot SPL cannot do for us ? > > Though U-Boot SPL can do, it will need 64KB onchip memory. While the > EPCS controller needs on

Re: [U-Boot] [PATCH v2 4/8] nios2: enlarge the code relocation range

2015-09-06 Thread Thomas Chou
Hi Marek, On 09/06/2015 11:23 PM, Marek Vasut wrote: Uh oh, is this copying something the U-Boot SPL cannot do for us ? Though U-Boot SPL can do, it will need 64KB onchip memory. While the EPCS controller needs only 512B onchip memory. So we didn't ever consider SPL for nios2. Best regards

Re: [U-Boot] [PATCH v2 4/8] nios2: enlarge the code relocation range

2015-09-06 Thread Marek Vasut
On Sunday, September 06, 2015 at 03:49:20 PM, Thomas Chou wrote: > Hi Marek, Hi, > On 09/06/2015 09:18 PM, Marek Vasut wrote: > > Why so? The EPCS is memory mapped and U-Boot starts from it, right ? So > > U-Boot can relocate itself to the end of DRAM , right ? > > No. EPCS contains a default bo

Re: [U-Boot] [PATCH v2 4/8] nios2: enlarge the code relocation range

2015-09-06 Thread Thomas Chou
Hi Marek, On 09/06/2015 09:18 PM, Marek Vasut wrote: Why so? The EPCS is memory mapped and U-Boot starts from it, right ? So U-Boot can relocate itself to the end of DRAM , right ? No. EPCS contains a default boot copier which I said earlier. Please take a look at this, https://www.altera.co

Re: [U-Boot] [PATCH v2 4/8] nios2: enlarge the code relocation range

2015-09-06 Thread Marek Vasut
On Sunday, September 06, 2015 at 03:12:44 PM, Thomas Chou wrote: > Hi Marek, Hi, > On 09/06/2015 08:29 PM, Marek Vasut wrote: > > We already do it on ARM though and the reason for this is to place U-Boot > > at the end of the DRAM, so that most of the DRAM can be used by the user. > > We place U

Re: [U-Boot] [PATCH v2 4/8] nios2: enlarge the code relocation range

2015-09-06 Thread Thomas Chou
Hi Marek, On 09/06/2015 08:29 PM, Marek Vasut wrote: We already do it on ARM though and the reason for this is to place U-Boot at the end of the DRAM, so that most of the DRAM can be used by the user. We place U-Boot at the end of the DRAM on nios2, too. :) I will look into the relocation on

Re: [U-Boot] [PATCH v2 4/8] nios2: enlarge the code relocation range

2015-09-06 Thread Marek Vasut
On Sunday, September 06, 2015 at 01:28:08 PM, Thomas Chou wrote: > HI Marek, Hi! > On 09/05/2015 08:50 PM, Marek Vasut wrote: > >> We didn't include relocation records in nios2 binary image, so there is > >> no real relocation like that of ARM. > > > > Can we add them instead ? > > I think it i

Re: [U-Boot] [PATCH v2 4/8] nios2: enlarge the code relocation range

2015-09-06 Thread Thomas Chou
HI Marek, On 09/05/2015 08:50 PM, Marek Vasut wrote: We didn't include relocation records in nios2 binary image, so there is no real relocation like that of ARM. Can we add them instead ? I think it is possible. I recalled that we have an old flat image format with elf2flt to run nonmmu ucl

Re: [U-Boot] [PATCH v2 4/8] nios2: enlarge the code relocation range

2015-09-05 Thread Marek Vasut
On Saturday, September 05, 2015 at 04:17:05 AM, Thomas Chou wrote: > Hi Marek, Hi, > On 09/04/2015 09:59 PM, Marek Vasut wrote: > > Can't you just call relocate_code the same way arm does it in > > arch/arm/lib/crt0.S ? > > We didn't include relocation records in nios2 binary image, so there is

Re: [U-Boot] [PATCH v2 4/8] nios2: enlarge the code relocation range

2015-09-04 Thread Thomas Chou
Hi Marek, On 09/04/2015 09:59 PM, Marek Vasut wrote: Can't you just call relocate_code the same way arm does it in arch/arm/lib/crt0.S ? We didn't include relocation records in nios2 binary image, so there is no real relocation like that of ARM. Altera provides small boot loaders for cfi/sf

Re: [U-Boot] [PATCH v2 4/8] nios2: enlarge the code relocation range

2015-09-04 Thread Marek Vasut
On Friday, September 04, 2015 at 02:22:19 PM, Thomas Chou wrote: > As we will use u-boot-dtb.bin, the code relocation range > should be adjusted to accommodate the additional dtb. > It might be overkilled to look into dtb header to find the > dtb size, so we will simply use CONFIG_SYS_MONITOR_LEN.

[U-Boot] [PATCH v2 4/8] nios2: enlarge the code relocation range

2015-09-04 Thread Thomas Chou
As we will use u-boot-dtb.bin, the code relocation range should be adjusted to accommodate the additional dtb. It might be overkilled to look into dtb header to find the dtb size, so we will simply use CONFIG_SYS_MONITOR_LEN. Signed-off-by: Thomas Chou --- arch/nios2/cpu/start.S | 5 +++-- 1 fil