From mboxrd@z Thu Jan 1 00:00:00 1970 From: Przemyslaw Marczak Date: Tue, 18 Nov 2014 14:47:16 +0100 Subject: [U-Boot] [PATCH v8 2/3] Odroid-XU3: Add support for Odroid-XU3 In-Reply-To: <546B3125.9070501@samsung.com> References: <1415946333-13718-1-git-send-email-human.hwang@samsung.com> <1415946333-13718-3-git-send-email-human.hwang@samsung.com> <5469CBD1.8060200@samsung.com> <20141118105722.4b81951b@hwh-ubuntu> <546B3125.9070501@samsung.com> Message-ID: <546B4DE4.2060201@samsung.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Hyungwon, On 11/18/2014 12:44 PM, Przemyslaw Marczak wrote: > Hello, > > On 11/18/2014 02:57 AM, Hyungwon Hwang wrote: >> Dear Przemyslaw Marczak, >> >>>> +/* >>>> + * FIXME: The number of bank is actually 8. But there is no way to >>>> reserver the >>>> + * last 16 Mib in the last bank now. So I just excluded the last >>>> bank >>>> + * temporally. >>>> + */ >>> >>> It's not prober solution, since non-dt kernel could get wrong DRAM >>> size. Please look at board/samsung/odroid/odroid.c - into function >>> exynos_init(). >>> >>> The Odroid U3 has reserved the last 1MB of the last DRAM bank. >> >> I agree. It is a temporary solution, and it must be fixed soon. I see >> the exynos_init() function and adapt the method to fix the problem in >> Odroid XU3. But it did not work. Figuring out what is wrong, I found >> that the 2 lines of code in the exynos_init() to reserve the last 1MB >> does not affect the behavior of Odroid U3. Even after I commented out >> the codes, it works well. Is it a effective solution to reserve the >> memory? Is there anything else which I am missing? >> >> I really appreciate for your comment. Thanks. >> >> Best regards, >> Hyungwon Hwang. >> > > Yes, I also checked now, that this doesn't work for your board. > > On Odroid U3, there was a problem in the kernel - so dram size passed to > the kernel is decreased by 1MB. It don't make a difference for the > U-Boot if you don't touch this memory. > > I can suppose that it depends on secure firmware. > > If you plan to fix it in the future, then it's ok. In other way it will > require some modification of board/samsung/common/board.c dram code. > > You can leave it as it is, since I plan to send some patches from > tizen.org for exynos ram init. > And it probably will fix this issue - if dts has decreased last bank > size with the 16MiB. > > Best regards, I made some quick test: (diff) for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { addr = CONFIG_SYS_SDRAM_BASE + (i * SDRAM_BANK_SIZE); - gd->ram_size += get_ram_size((long *)addr, SDRAM_BANK_SIZE); + if (i == 7) + gd->ram_size += (SDRAM_BANK_SIZE - (22 << 20)); + else + gd->ram_size += SDRAM_BANK_SIZE; } return 0; Similar in dram_init_banksize(): - size = get_ram_size((long *)addr, SDRAM_BANK_SIZE); + + if (i == 7) + size = (SDRAM_BANK_SIZE - (22 << 20)); + else + size = SDRAM_BANK_SIZE; and this works fine. I also checked that size of the reserved area is 22MiB. Best regards, -- Przemyslaw Marczak Samsung R&D Institute Poland Samsung Electronics p.marczak@samsung.com