From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Date: Mon, 19 Jan 2015 19:57:41 +0100 Subject: [U-Boot] [PATCH 04/12] sunxi: Update sunxi-common.h to deal with different DRAM base addr on sun9i In-Reply-To: <1421534659.13341.12.camel@hellion.org.uk> References: <1421333554-29822-1-git-send-email-hdegoede@redhat.com> <1421333554-29822-5-git-send-email-hdegoede@redhat.com> <1421534659.13341.12.camel@hellion.org.uk> Message-ID: <54BD53A5.3090502@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On 17-01-15 23:44, Ian Campbell wrote: > On Thu, 2015-01-15 at 15:52 +0100, Hans de Goede wrote: >> The DRAM Base differs between sun9i and the others and we cannot use >> math in various places like the environment setting and linker scripts, >> so "simply" define everything which contains the SDRAM_BASE twice. > > Is it really not possible to use maths in linker scripts? How have I > never noticed that... I'm not 100% sure on that, I'm sure that it is not possible in the environment stuff, so I thought lets play it safe and just write it out fully for everything. I will drop the unconfirmed linker script reference from the commit message for v2 > > Anyway, given that things only differ in the most significant nibble of > the RAM base address I think something like this might work: > > /* NB: find out if one of these is already available somewhere */ > #define __stringify(x) #x > #define stringify(x) __stringify(x) > > #define SDRAM_OFFSET(x) 0x2##x /* or 0x4 */ > #define CONFIG_SYS_SDRAM_BASE SDRAM_OFFSET(0000000) > > #define MEM_LAYOUT_ENV_SETTINGS \ > "kernel_addr_r=" stringify(SDRAM_OFFSET(200000)) "\0" > ... Yeah I think that will work. I'll do that for v2 (it may take a few days before I get around to doing / posting a v2). Regards, Hans