All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@linaro.org>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Josh Zhao <joshsystem@gmail.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: bootwrapper can't be compiled for cubieboard2
Date: Fri, 30 Aug 2013 15:24:05 +0200	[thread overview]
Message-ID: <52209CF5.5080008@linaro.org> (raw)
In-Reply-To: <1377868347.31937.223.camel@hastur.hellion.org.uk>

On 08/30/2013 03:12 PM, Ian Campbell wrote:
> On Fri, 2013-08-30 at 10:51 +0100, Ian Campbell wrote:
>> I'll try that shortly and let you know how I get on.
>
> Success! My failure previously was not getting the kernel command line
> in the right place, so no printk...

Excellent! Great news! Seems I need to shell out those 70 EUR now ;-)

Thanks!
Andre.

P.S. Keep my fingers cross for the Xen boot.

> Starting from
> https://github.com/linux-sunxi/u-boot-sunxi.git sunxi
> I merged your stuff:
> git pull git://git.linaro.org/people/aprzywara/u-boot.git hypmode_v4
> and applied the patch below (NB: u-boot doesn't support SMP on this
> platform yet, hence stubbing out the kicking of secondaries etc) and
> https://groups.google.com/forum/#!topic/linux-sunxi/7oS0CM2WSy4.
>
> Then built with:
>
> $ make Cubieboard2_FEL CROSS_COMPILE=arm-linux-gnueabihf-
>
> Then I could boot via FEL (http://linux-sunxi.org/FEL/USBBoot) using
> usb-boot from git://github.com/linux-sunxi/sunxi-tools.git:
> usb-boot ~/devel/u-boot.git/spl/u-boot-spl.bin ~/devel/u-boot.git/u-boot.bin uImage
>
> where uImage is the zImage+dtb (cat into tmp) and mkimage -A arm -O
> linux -T kernel -a 0x40008000 -e 0x40008000 -C none -d tmp uImage
>
> Linux says:
> [    0.000000] CPU: All CPU(s) started in HYP mode.
> [    0.000000] CPU: Virtualization extensions available.
>
> (All == all 1)
>
> Kernel is https://github.com/mripard/linux.git sunxi-next-a20-cubie2
> multi_v7_defconfig + CONFIG_DEBUG_LL w/ CONFIG_DEBUG_SUNXI_UART0 and
> CONFIG_EARLY_PRINTK.
> I used appended dtb and set /chosen/bootargs = "console=ttyS0,115200
> earlyprintk" in arch/arm/boot/dts/sun7i-a20-cubieboard2.dts (only
> because usb-boot doesn't happen to load dtb and pass it to bootm, will
> fix that up...)
>
> Now to try Xen!
>
> Ian.
>
> commit 9267730ab1c3b6be5cf9118b2ce4e708e9d4ba66
> Author: Ian Campbell <ijc@hellion.org.uk>
> Date:   Fri Aug 30 13:52:07 2013 +0100
>
>      sunxi: Enable hyp mode boot on sunxi platforms
>
>      Required a call to cleanup_before_linux in order to disable caches before
>      switching to NS world, otherwise we switch to an incorrecly configured banked
>      version of SCTLR.
>
>      Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
>
> diff --git a/arch/arm/cpu/armv7/virt-v7.c b/arch/arm/cpu/armv7/virt-v7.c
> index 4dc8c45..a76dcf7 100644
> --- a/arch/arm/cpu/armv7/virt-v7.c
> +++ b/arch/arm/cpu/armv7/virt-v7.c
> @@ -132,6 +132,8 @@ int armv7_switch_nonsec(void)
>   	unsigned int reg;
>   	unsigned itlinesnr, i;
>
> +	cleanup_before_linux();
> +
>   	/* check whether the CPU supports the security extensions */
>   	reg = read_id_pfr1();
>   	if ((reg & 0xF0) == 0) {
> diff --git a/board/sunxi/Makefile b/board/sunxi/Makefile
> index 4780c99..d756091 100644
> --- a/board/sunxi/Makefile
> +++ b/board/sunxi/Makefile
> @@ -76,9 +76,13 @@ COBJS-$(CONFIG_UHOST_U1A)	+= dram_sun4i_360_1024_iow8.o
>   COBJS-$(CONFIG_WOBO_I5)		+= dram_wobo_i5.o
>   COBJS-$(CONFIG_XZPAD700)	+= dram_xzpad700.o
>
> +ifneq ($(CONFIG_ARMV7_NONSEC)$(CONFIG_ARMV7_VIRT),)
> +SOBJS                           := smp.o
> +endif
> +
>   COBJS	:= $(COBJS-y)
> -SRCS	:= $(COBJS:.o=.c)
> -OBJS	:= $(addprefix $(obj),$(COBJS))
> +SRCS	:= $(COBJS:.o=.c) $(SOBJS:.o=.S)
> +OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
>
>   all:	$(LIB)
>
> diff --git a/board/sunxi/board.c b/board/sunxi/board.c
> index 50c07e2..4b8c732 100755
> --- a/board/sunxi/board.c
> +++ b/board/sunxi/board.c
> @@ -40,6 +40,20 @@
>
>   DECLARE_GLOBAL_DATA_PTR;
>
> +/* Setting the address at which secondary cores start from.
> + * SMP currently unsupported.
> + */
> +void smp_set_core_boot_addr(unsigned long addr, int corenr)
> +{
> +	printf("WARNING: ignoring attempt to set core boot address %lx on core %d\n",
> +	       addr, corenr);
> +}
> +
> +void smp_kick_all_cpus(void)
> +{
> +	printf("WARNING: Not kicking secondary CPUs\n");
> +}
> +
>   /* add board specific code here */
>   int board_init(void)
>   {
> diff --git a/board/sunxi/smp.S b/board/sunxi/smp.S
> new file mode 100644
> index 0000000..6a6e08c
> --- /dev/null
> +++ b/board/sunxi/smp.S
> @@ -0,0 +1,33 @@
> +/*
> + * code for redirecting secondary cores to their start address
> + *
> + * Copyright (c) 2013	Andre Przywara <andre.przywara@linaro.org>
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#include <config.h>
> +#include <linux/linkage.h>
> +
> +/* void _smp_waitloop(unsigned previous_address); */
> +ENTRY(smp_waitloop)
> +	/* SMP currently unsupported */
> +1:	wfi
> +	b 1b
> +ENDPROC(smp_waitloop)
> diff --git a/include/configs/sun7i.h b/include/configs/sun7i.h
> index a6ede2a..f0d9222 100644
> --- a/include/configs/sun7i.h
> +++ b/include/configs/sun7i.h
> @@ -34,6 +34,8 @@
>   #define CONFIG_SYS_PROMPT		"sun7i# "
>   #define CONFIG_MACH_TYPE		4283
>
> +#define CONFIG_ARMV7_VIRT
> +
>   #if defined(CONFIG_SYS_SECONDARY_ON)
>   #define CONFIG_BOARD_POSTCLK_INIT 1
>   #endif
>
>

  reply	other threads:[~2013-08-30 13:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-30  7:12 bootwrapper can't be compiled for cubieboard2 Josh Zhao
2013-08-30  8:06 ` Ian Campbell
2013-08-30  8:27   ` Andre Przywara
2013-08-30  9:51     ` Ian Campbell
2013-08-30 13:12       ` Ian Campbell
2013-08-30 13:24         ` Andre Przywara [this message]
2013-09-02  3:59         ` Josh Zhao
2013-09-02 11:38           ` Ian Campbell

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=52209CF5.5080008@linaro.org \
    --to=andre.przywara@linaro.org \
    --cc=ian.campbell@citrix.com \
    --cc=joshsystem@gmail.com \
    --cc=xen-devel@lists.xen.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.