From: dinguyen@altera.com (Dinh Nguyen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv1 for soc 5/5] arm: socfpga: Add SMP support for actual socfpga harware
Date: Fri, 25 Jan 2013 15:02:50 -0600 [thread overview]
Message-ID: <1359147770.32148.28.camel@linux-builds1> (raw)
In-Reply-To: <20130125175511.GE10055@amd.pavel.ucw.cz>
Hi Pavel,
On Fri, 2013-01-25 at 18:55 +0100, Pavel Machek wrote:
> Hi!
>
>
> > From: Dinh Nguyen <dinguyen@altera.com>
> >
> > Because the CPU1 start address is different for socfpga-vt and
> > socfpga-cyclone5, we add code to use the correct CPU1 start addr.
> >
> > +++ b/arch/arm/configs/socfpga_defconfig
> > @@ -21,6 +21,7 @@ CONFIG_ARM_THUMBEE=y
> > # CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA is not set
> > # CONFIG_CACHE_L2X0 is not set
> > CONFIG_HIGH_RES_TIMERS=y
> > +CONFIG_VMSPLIT_2G=y
> > CONFIG_SMP=y
> > CONFIG_NR_CPUS=2
> > CONFIG_AEABI=y
>
> Is this related to CPU1 start address?
Yes, it's really only necessary when running the virtual simulator.
>
> > +++ b/arch/arm/mach-socfpga/headsmp.S
> > @@ -13,13 +13,19 @@
> > __CPUINIT
> > .arch armv7-a
> >
> > -#define CPU1_START_ADDR 0xffd08010
> > -
> > ENTRY(secondary_trampoline)
> > - movw r0, #:lower16:CPU1_START_ADDR
> > - movt r0, #:upper16:CPU1_START_ADDR
> > + movw r2, #:lower16:cpu1start_addr
> > + movt r2, #:upper16:cpu1start_addr
> >
> > + ldr r0, [r2]
> > ldr r1, [r0]
> > bx r1
> >
> > ENTRY(secondary_trampoline_end)
> > +
> > +#ifdef CONFIG_SMP
> > +ENTRY(v7_secondary_startup)
> > + bl v7_invalidate_l1
> > + b secondary_startup
> > +ENDPROC(v7_secondary_startup)
> > +#endif
>
> #ifdef should not be neccessary, as headsmp.S is only compiled when CONFIG_SMP.
>
> > +++ b/arch/arm/mach-socfpga/platsmp.c
> > @@ -49,7 +49,8 @@ static int __cpuinit socfpga_boot_secondary(unsigned int cpu, struct task_struct
> >
> > memcpy(phys_to_virt(0), &secondary_trampoline, trampoline_size);
> >
> > - __raw_writel(virt_to_phys(secondary_startup), (sys_manager_base_addr+0x10));
> > + __raw_writel(virt_to_phys(v7_secondary_startup),
> > + (sys_manager_base_addr + (cpu1start_addr & 0x000000ff)));
> >
>
> The math is rather interesting here; is (sys_manager_base_addr +
> (cpu1start_addr & 0x000000ff)) == cpu1start_addr ?
>
> > @@ -55,6 +56,16 @@ static void __init socfpga_scu_map_io(void)
> > iotable_init(&scu_io_desc, 1);
> > }
> >
> > +static void __init init_socfpga_vt(void)
> > +{
> > + cpu1start_addr = 0xffd08010;
> > +}
> > +
> > +static void __init init_socfpga(void)
> > +{
> > + cpu1start_addr = 0xffd080c4;
> > +}
>
> Should this be put into device tree somewhere?
>
> In addition, this patch seems to break operation in the emulator for
> me. In fact, it looks pretty much like emulator crash, with continuous
> scroll of
>
> B_TRANSPORT::(R(Addr=0x23092FD0, Count=08 ...
Definitely make sure CONFIG_VMSPLIT_2G=y is set for the Virtual Target.
Dinh
>
> [sorry, it is hard to copy moving messages].
>
> I'm using kernel based on 3.7-rc2. Should I attempt updating?
>
> Thanks,
> Pavel
next prev parent reply other threads:[~2013-01-25 21:02 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-25 1:00 [PATCHv1 for soc 0/5] Enabling socfpga on hardware dinguyen at altera.com
2013-01-25 1:00 ` [PATCHv1 for soc 1/5] arm: socfpga: Add new device tree source for actual socfpga HW dinguyen at altera.com
2013-01-25 14:22 ` Pavel Machek
2013-01-25 16:18 ` Dinh Nguyen
2013-01-28 7:12 ` Olof Johansson
2013-01-25 1:00 ` [PATCHv1 for soc 2/5] arm: socfpga: Add clock entries to socfpga.dtsi dinguyen at altera.com
2013-01-28 7:13 ` Olof Johansson
2013-01-28 11:19 ` Pavel Machek
2013-01-25 1:00 ` [PATCHv1 for soc 3/5] arm: socfpga: Add entries to enable make dtbs socfpga dinguyen at altera.com
2013-01-25 15:13 ` Pavel Machek
2013-01-25 16:21 ` Dinh Nguyen
2013-01-25 1:00 ` [PATCHv1 for soc 4/5] arm: Add v7_invalidate_l1 to cache-v7.S dinguyen at altera.com
2013-01-25 4:15 ` Simon Horman
2013-01-25 4:35 ` Simon Horman
2013-01-25 16:18 ` Dinh Nguyen
2013-01-25 4:42 ` Stephen Warren
2013-01-28 10:45 ` Pavel Machek
2013-01-28 17:27 ` Stephen Warren
2013-01-28 17:35 ` Dinh Nguyen
2013-01-25 8:13 ` Santosh Shilimkar
2013-01-25 16:20 ` Dinh Nguyen
2013-01-25 17:47 ` Santosh Shilimkar
2013-01-25 15:49 ` Pavel Machek
2013-01-25 16:24 ` Dinh Nguyen
2013-01-25 18:05 ` Pavel Machek
2013-01-28 13:13 ` Shawn Guo
2013-01-25 1:00 ` [PATCHv1 for soc 5/5] arm: socfpga: Add SMP support for actual socfpga harware dinguyen at altera.com
2013-01-25 17:55 ` Pavel Machek
2013-01-25 21:02 ` Dinh Nguyen [this message]
2013-01-26 20:59 ` Pavel Machek
2013-01-28 19:31 ` Pavel Machek
2013-01-28 19:36 ` [RFC] socfpga: make function static Pavel Machek
2013-01-29 18:43 ` [PATCHv1 for soc 5/5] arm: socfpga: Add SMP support for actual socfpga harware 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=1359147770.32148.28.camel@linux-builds1 \
--to=dinguyen@altera.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.