From: Dinh Nguyen <dinguyen@opensource.altera.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCHv1 13/22] arm: socfpga: spl: Add s_init
Date: Thu, 5 Feb 2015 15:16:59 -0600 [thread overview]
Message-ID: <54D3DDCB.9010602@opensource.altera.com> (raw)
In-Reply-To: <201501150054.08701.marex@denx.de>
On 01/14/2015 05:54 PM, Marek Vasut wrote:
> On Wednesday, January 14, 2015 at 05:40:53 PM, dinguyen at opensource.altera.com
> wrote:
>> From: Dinh Nguyen <dinguyen@opensource.altera.com>
>>
>> s_init will map SDRAM to 0x0.
>>
>> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
>
> Hi!
>
> [...]
>
>> +void s_init(void)
>> +{
>> +#ifdef CONFIG_SPL_BUILD
>> + struct socfpga_system_manager *sysmgr_regs =
>> + (struct socfpga_system_manager *)SOCFPGA_SYSMGR_ADDRESS;
>> + unsigned long reg;
>> + /*
>> + * First C code to run. Clear fake OCRAM ECC first as SBE
>> + * and DBE might triggered during power on
>> + */
>> + reg = readl(&sysmgr_regs->eccgrp_ocram);
>> + if (reg & SYSMGR_ECC_OCRAM_SERR)
>> + writel(SYSMGR_ECC_OCRAM_SERR | SYSMGR_ECC_OCRAM_EN,
>> + &sysmgr_regs->eccgrp_ocram);
>> + if (reg & SYSMGR_ECC_OCRAM_DERR)
>> + writel(SYSMGR_ECC_OCRAM_DERR | SYSMGR_ECC_OCRAM_EN,
>> + &sysmgr_regs->eccgrp_ocram);
>> +#else
>> + /*
>> + * Private components security
>> + * U-Boot : configure private timer, global timer and cpu
>> + * component access as non secure for kernel stage (as required
>> + * by kernel)
>> + */
>> + setbits_le32(SOCFPGA_SCU_SNSAC, 0xfff);
>
> We do this in socfpga/misc.c in arch_early_init_r() already. You should
> consolidate this code so we don't have it twice I think.
Yes, this can be removed.
>
>> +
>> +#endif /* CONFIG_SPL_BUILD */
>> +
>> + /* Configure the L2 controller to make SDRAM start at 0 */
>> + writel(0x1, (SOCFPGA_MPUL2_ADDRESS + SOCFPGA_MPUL2_ADRFLTR_START));
>
> This as well.
>
This call has to stay because we want to map the SDRAM to 0x0 in the
SPL. The call in arch_early_init_r() is in u-boot, and thus is too late.
>> +}
>> diff --git a/arch/arm/include/asm/arch-socfpga/system_manager.h
>> b/arch/arm/include/asm/arch-socfpga/system_manager.h index
>> 51d9815..10659f7 100644
>> --- a/arch/arm/include/asm/arch-socfpga/system_manager.h
>> +++ b/arch/arm/include/asm/arch-socfpga/system_manager.h
>> @@ -144,4 +144,14 @@ struct socfpga_system_manager {
>> #define SYSMGR_EMACGRP_CTRL_PHYSEL1_LSB 2
>> #define SYSMGR_EMACGRP_CTRL_PHYSEL_MASK 0x3
>>
>> +/*
>> + * SCU Non-secure Access Control
>> + */
>> +#define SOCFPGA_SCU_SNSAC (SOCFPGA_MPUSCU_ADDRESS + 0x54)
>> +/*
>> + * L2 PL-310
>> + * for configuring L2 address filtering start address in assembly.
>> + */
>> +#define SOCFPGA_MPUL2_ADRFLTR_START (0xC00)
>
> I think this is not needed if you use the code from misc.c , since these
> registers are already defined there.
>
Yes, I can remove this and use the mappings already defined.
Thanks,
Dinh
next prev parent reply other threads:[~2015-02-05 21:16 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-14 16:40 [U-Boot] [PATCHv1 00/22] Add SPL support for SoCFGPA dinguyen at opensource.altera.com
2015-01-14 16:40 ` [U-Boot] [PATCHv1 01/22] arm: socfpga: spl: Add main sdram code dinguyen at opensource.altera.com
2015-01-14 23:34 ` Marek Vasut
2015-01-16 19:04 ` Pavel Machek
2015-01-17 2:39 ` Marek Vasut
2015-02-04 13:36 ` Pavel Machek
2015-01-20 23:51 ` Dinh Nguyen
2015-01-21 8:03 ` Stefan Roese
2015-02-15 23:11 ` Pavel Machek
2015-02-15 23:25 ` Pavel Machek
2015-02-23 16:37 ` Dinh Nguyen
2015-02-23 16:39 ` Dinh Nguyen
2015-02-23 16:57 ` Marek Vasut
2015-02-23 17:00 ` Dinh Nguyen
2015-02-24 17:48 ` Marek Vasut
2015-01-14 16:40 ` [U-Boot] [PATCHv1 02/22] arm: socfpga: enable saveenv to mmc partition dinguyen at opensource.altera.com
2015-01-14 23:39 ` Marek Vasut
2015-01-15 22:00 ` Pavel Machek
2015-01-15 22:08 ` Marek Vasut
2015-01-16 4:50 ` Stefan Roese
2015-01-16 5:14 ` Marek Vasut
2015-01-16 18:35 ` Pavel Machek
2015-01-17 13:51 ` Marek Vasut
2015-01-14 16:40 ` [U-Boot] [PATCHv1 03/22] arm: socfpga: Add sdram initialization code dinguyen at opensource.altera.com
2015-01-14 23:41 ` Marek Vasut
2015-01-14 16:40 ` [U-Boot] [PATCHv1 04/22] arm: socfpga: spl: Add SRAM section dinguyen at opensource.altera.com
2015-01-14 23:40 ` Marek Vasut
2015-01-15 22:01 ` Pavel Machek
2015-01-14 16:40 ` [U-Boot] [PATCHv1 05/22] arm: socfpga: spl: put SPL in sram dinguyen at opensource.altera.com
2015-01-16 19:05 ` Pavel Machek
2015-01-14 16:40 ` [U-Boot] [PATCHv1 06/22] arm: socfpga: add functions to bring sdram, timer, and uart out of reset dinguyen at opensource.altera.com
2015-01-14 23:42 ` Marek Vasut
2015-01-16 19:06 ` Pavel Machek
2015-01-14 16:40 ` [U-Boot] [PATCHv1 07/22] arm: socfpga: spl: enable sdram, timer and uart dinguyen at opensource.altera.com
2015-01-14 23:44 ` Marek Vasut
2015-02-16 21:35 ` Pavel Machek
2015-01-14 16:40 ` [U-Boot] [PATCHv1 08/22] arm: socfpga: spl: Add call to timer_init dinguyen at opensource.altera.com
2015-01-14 23:45 ` Marek Vasut
2015-02-04 3:58 ` Dinh Nguyen
2015-01-14 16:40 ` [U-Boot] [PATCHv1 09/22] arm: socfpga: spl: allow bootrom to enable IOs after warm reset dinguyen at opensource.altera.com
2015-01-14 23:46 ` Marek Vasut
2015-02-16 21:36 ` Pavel Machek
2015-02-17 7:09 ` Marek Vasut
2015-01-14 16:40 ` [U-Boot] [PATCHv1 10/22] arm: socfpga: spl: add sdram init and calibration dinguyen at opensource.altera.com
2015-01-14 23:47 ` Marek Vasut
2015-02-16 21:37 ` Pavel Machek
2015-01-14 16:40 ` [U-Boot] [PATCHv1 11/22] arm: socfpga: spl: printout sdram size dinguyen at opensource.altera.com
2015-01-14 23:49 ` Marek Vasut
2015-01-14 16:40 ` [U-Boot] [PATCHv1 12/22] arm: socfpga: spl: Use common lowlevel_init dinguyen at opensource.altera.com
2015-01-14 23:51 ` Marek Vasut
2015-01-14 16:40 ` [U-Boot] [PATCHv1 13/22] arm: socfpga: spl: Add s_init dinguyen at opensource.altera.com
2015-01-14 23:54 ` Marek Vasut
2015-02-05 21:16 ` Dinh Nguyen [this message]
2015-02-07 13:34 ` Marek Vasut
2015-02-09 16:50 ` Dinh Nguyen
2015-02-09 17:05 ` Marek Vasut
2015-02-07 17:07 ` Simon Glass
2015-01-14 16:40 ` [U-Boot] [PATCHv1 14/22] arm: socfpga: spl: update lowlevel_init dinguyen at opensource.altera.com
2015-01-14 23:56 ` Marek Vasut
2015-01-14 16:40 ` [U-Boot] [PATCHv1 15/22] arm: socfpga: spl: add relocate_stack_to_sdram to lowlevel_init.S dinguyen at opensource.altera.com
2015-01-14 23:58 ` Marek Vasut
2015-01-15 19:19 ` Dinh Nguyen
2015-01-15 22:00 ` Marek Vasut
2015-01-16 0:07 ` Dinh Nguyen
2015-01-16 0:48 ` Marek Vasut
2015-01-14 16:40 ` [U-Boot] [PATCHv1 16/22] arm: socfpga: spl: add the stack in OCRAM dinguyen at opensource.altera.com
2015-01-14 23:59 ` Marek Vasut
2015-01-14 16:40 ` [U-Boot] [PATCHv1 17/22] arm: socfpga: spl: add CONFIG_SPL_STACK to socfpga_common.h dinguyen at opensource.altera.com
2015-01-15 0:00 ` Marek Vasut
2015-01-16 21:56 ` Pavel Machek
2015-01-14 16:40 ` [U-Boot] [PATCHv1 18/22] arm: socfpga: add sdram stack to SPL dinguyen at opensource.altera.com
2015-01-14 16:40 ` [U-Boot] [PATCHv1 19/22] arm: socfpga: spl: set SPL_MALLOC_SIZE dinguyen at opensource.altera.com
2015-01-15 0:01 ` Marek Vasut
2015-01-14 16:41 ` [U-Boot] [PATCHv1 20/22] arm: socfpga: spl: add a malloc section in sram dinguyen at opensource.altera.com
2015-01-15 0:03 ` Marek Vasut
2015-01-14 16:41 ` [U-Boot] [PATCHv1 21/22] arm: socfpga: spl: Add SDRAM check dinguyen at opensource.altera.com
2015-01-15 0:04 ` Marek Vasut
2015-01-16 21:59 ` Pavel Machek
2015-01-17 11:00 ` Marek Vasut
2015-01-14 16:41 ` [U-Boot] [PATCHv1 22/22] arm: socfpga: spl: update pll_config for dev kit dinguyen at opensource.altera.com
2015-01-15 0:05 ` Marek Vasut
2015-01-14 23:01 ` [U-Boot] [PATCHv1 00/22] Add SPL support for SoCFGPA Marek Vasut
2015-01-15 21:57 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54D3DDCB.9010602@opensource.altera.com \
--to=dinguyen@opensource.altera.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox