diff mbox

[U-Boot,v2,4/6] sunxi: Update sunxi-common.h to deal with different A1-SRAM base addr on sun9i

Message ID 1432128909-25272-5-git-send-email-hdegoede@redhat.com
State Accepted
Delegated to: Hans de Goede
Headers show

Commit Message

Hans de Goede May 20, 2015, 1:35 p.m. UTC
The A1 SRAM Base differs between sun9i and the others, update sunxi-common.h
to deal with this, so that we do not set the initial stack pointer to point
to the BROM.

This removes the need for the weird undocumented register write I took from
the allwiner u-boot sources and which needed #ifdef-ery in start.S as it
needed to be done really early on.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 include/configs/sunxi-common.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Ian Campbell May 21, 2015, 7:07 p.m. UTC | #1
On Wed, 2015-05-20 at 15:35 +0200, Hans de Goede wrote:
> The A1 SRAM Base differs between sun9i and the others, update sunxi-common.h
> to deal with this, so that we do not set the initial stack pointer to point
> to the BROM.
> 
> This removes the need for the weird undocumented register write I took from
> the allwiner u-boot sources and which needed #ifdef-ery in start.S as it
> needed to be done really early on.

(typo: "allwinner")

Removes in the sense that it simply no longer appears in the series, I
think? (As opposed to a removal hunk being missing from this or a
subsequent patch)

Assuming that is the case:

> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Acked-by: Ian Campbell <ijc@hellion.org.uk>
Hans de Goede May 21, 2015, 10:27 p.m. UTC | #2
Hi,

On 21-05-15 21:07, Ian Campbell wrote:
> On Wed, 2015-05-20 at 15:35 +0200, Hans de Goede wrote:
>> The A1 SRAM Base differs between sun9i and the others, update sunxi-common.h
>> to deal with this, so that we do not set the initial stack pointer to point
>> to the BROM.
>>
>> This removes the need for the weird undocumented register write I took from
>> the allwiner u-boot sources and which needed #ifdef-ery in start.S as it
>> needed to be done really early on.
>
> (typo: "allwinner")
>
> Removes in the sense that it simply no longer appears in the series, I
> think? (As opposed to a removal hunk being missing from this or a
> subsequent patch)

Correct, remove as in simply no longer appears in the series.

Regsrds,

Hans

>
> Assuming that is the case:
>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
> Acked-by: Ian Campbell <ijc@hellion.org.uk>
>
Ian Campbell May 22, 2015, 6:32 a.m. UTC | #3
On Fri, 2015-05-22 at 00:27 +0200, Hans de Goede wrote:
> Hi,
> 
> On 21-05-15 21:07, Ian Campbell wrote:
> > On Wed, 2015-05-20 at 15:35 +0200, Hans de Goede wrote:
> >> The A1 SRAM Base differs between sun9i and the others, update sunxi-common.h
> >> to deal with this, so that we do not set the initial stack pointer to point
> >> to the BROM.
> >>
> >> This removes the need for the weird undocumented register write I took from
> >> the allwiner u-boot sources and which needed #ifdef-ery in start.S as it
> >> needed to be done really early on.
> >
> > (typo: "allwinner")
> >
> > Removes in the sense that it simply no longer appears in the series, I
> > think? (As opposed to a removal hunk being missing from this or a
> > subsequent patch)
> 
> Correct, remove as in simply no longer appears in the series.

Perhaps s/removes/avoids/ and s/write I took/write I previously took/ to
clarify?

Ack regardless.

> 
> Regsrds,
> 
> Hans
> 
> >
> > Assuming that is the case:
> >
> >> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> >
> > Acked-by: Ian Campbell <ijc@hellion.org.uk>
> >
>
Hans de Goede May 22, 2015, 2:58 p.m. UTC | #4
Hi,

On 22-05-15 08:32, Ian Campbell wrote:
> On Fri, 2015-05-22 at 00:27 +0200, Hans de Goede wrote:
>> Hi,
>>
>> On 21-05-15 21:07, Ian Campbell wrote:
>>> On Wed, 2015-05-20 at 15:35 +0200, Hans de Goede wrote:
>>>> The A1 SRAM Base differs between sun9i and the others, update sunxi-common.h
>>>> to deal with this, so that we do not set the initial stack pointer to point
>>>> to the BROM.
>>>>
>>>> This removes the need for the weird undocumented register write I took from
>>>> the allwiner u-boot sources and which needed #ifdef-ery in start.S as it
>>>> needed to be done really early on.
>>>
>>> (typo: "allwinner")
>>>
>>> Removes in the sense that it simply no longer appears in the series, I
>>> think? (As opposed to a removal hunk being missing from this or a
>>> subsequent patch)
>>
>> Correct, remove as in simply no longer appears in the series.
>
> Perhaps s/removes/avoids/ and s/write I took/write I previously took/ to
> clarify?

Updated the commit msg with the above suggestion.

Thanks & Regards,

Hans
diff mbox

Patch

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 2b90681..76f42f5 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -97,8 +97,20 @@ 
 #define CONFIG_SPL_BSS_MAX_SIZE		0x00080000 /* 512 KiB */
 #define CONFIG_SYS_SPL_MALLOC_SIZE	0x00080000 /* 512 KiB */
 
+#ifdef CONFIG_MACH_SUN9I
+/*
+ * The A80's A1 sram starts at 0x00010000 rather then at 0x00000000 and is
+ * slightly bigger. Note that it is possible to map the first 32 KiB of the
+ * A1 at 0x00000000 like with older SoCs by writing 0x16aa0001 to the
+ * undocumented 0x008000e0 SYS_CTRL register. Where the 16aa is a key and
+ * the 1 actually activates the mapping of the first 32 KiB to 0x00000000.
+ */
+#define CONFIG_SYS_INIT_RAM_ADDR	0x10000
+#define CONFIG_SYS_INIT_RAM_SIZE	0x0a000	/* 40 KiB */
+#else
 #define CONFIG_SYS_INIT_RAM_ADDR	0x0
 #define CONFIG_SYS_INIT_RAM_SIZE	0x8000	/* 32 KiB */
+#endif
 
 #define CONFIG_SYS_INIT_SP_OFFSET \
 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)