mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Grzeschik <mgr@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH 04/12] ARM: i.MX53 Vincell: Add PBL console support
Date: Wed, 14 Sep 2016 11:24:50 +0200	[thread overview]
Message-ID: <20160914092450.xd5xrsf37qb3odxm@pengutronix.de> (raw)
In-Reply-To: <1473844368-13030-4-git-send-email-s.hauer@pengutronix.de>

On Wed, Sep 14, 2016 at 11:12:40AM +0200, Sascha Hauer wrote:
> PBL console support is more useful than debug_ll. Add support
> for it to the Vincell Board.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/boards/guf-vincell/lowlevel.c | 50 ++++++++++++++++++++--------------
>  1 file changed, 29 insertions(+), 21 deletions(-)
> 
> diff --git a/arch/arm/boards/guf-vincell/lowlevel.c b/arch/arm/boards/guf-vincell/lowlevel.c
> index af7c65d..3985dd7 100644
> --- a/arch/arm/boards/guf-vincell/lowlevel.c
> +++ b/arch/arm/boards/guf-vincell/lowlevel.c
> @@ -11,6 +11,7 @@
>  #include <mach/generic.h>
>  #include <asm/barebox-arm.h>
>  #include <asm/barebox-arm-head.h>
> +#include <asm/cache.h>
>  
>  #define IOMUX_PADCTL_DDRI_DDR (1 << 9)
>  
> @@ -123,12 +124,16 @@ void disable_watchdog(void)
>  	writew(0x0, MX53_WDOG2_BASE_ADDR + 8);
>  }
>  
> -static noinline void imx53_guf_vincell_init(void *fdt)
> +extern char __dtb_imx53_guf_vincell_lt_start[];
> +extern char __dtb_imx53_guf_vincell_start[];
> +
> +static noinline void imx53_guf_vincell_init(int is_lt)
>  {
>  	void __iomem *ccm = (void *)MX53_CCM_BASE_ADDR;
> +	void __iomem *uart = IOMEM(MX53_UART4_BASE_ADDR);

This should be MX53_UART2_BASE_ADDR to be consistent with
linux,stdout-path in imx53-guf-vincell.dts and imx53-guf-vincell-lt.dts.

> +	void *fdt;
>  	u32 r;
>  
> -	imx5_cpu_lowlevel_init();
>  	arm_setup_stack(MX53_IRAM_BASE_ADDR + MX53_IRAM_SIZE - 8);
>  
>  	writel(0x0088494c, ccm + MX5_CCM_CBCDR);
> @@ -137,12 +142,11 @@ static noinline void imx53_guf_vincell_init(void *fdt)
>  
>  	imx53_init_lowlevel_early(800);
>  
> -	if (IS_ENABLED(CONFIG_DEBUG_LL)) {
> -		writel(0x3, MX53_IOMUXC_BASE_ADDR + 0x27c);
> -		writel(0x3, MX53_IOMUXC_BASE_ADDR + 0x278);
> -		imx53_uart_setup_ll();
> -		putc_ll('>');
> -	}
> +	writel(0x3, MX53_IOMUXC_BASE_ADDR + 0x27c);
> +	writel(0x3, MX53_IOMUXC_BASE_ADDR + 0x278);
> +	imx53_uart_setup(uart);
> +	pbl_set_putc(imx_uart_putc, uart);
> +	pr_debug("GuF Vincell\n");
>  
>  	/* Skip SDRAM initialization if we run from RAM */
>  	r = get_pc();
> @@ -152,27 +156,31 @@ static noinline void imx53_guf_vincell_init(void *fdt)
>  		imx_esdctlv4_init();
>  	}
>  
> +	if (is_lt)
> +		fdt = __dtb_imx53_guf_vincell_lt_start;
> +	else
> +		fdt = __dtb_imx53_guf_vincell_start;
> +
>  	imx53_barebox_entry(fdt);
>  }
>  
> -extern char __dtb_imx53_guf_vincell_lt_start[];
> -
> -ENTRY_FUNCTION(start_imx53_guf_vincell_lt, r0, r1, r2)
> +static void __imx53_guf_vincell_init(int is_lt)
>  {
> -	void *fdt;
> -
> -	fdt = __dtb_imx53_guf_vincell_lt_start - get_runtime_offset();
> +	arm_early_mmu_cache_invalidate();
> +	imx5_cpu_lowlevel_init();
> +	relocate_to_current_adr();
> +	setup_c();
> +	barrier();
>  
> -	imx53_guf_vincell_init(fdt);
> +	imx53_guf_vincell_init(is_lt);
>  }
>  
> -extern char __dtb_imx53_guf_vincell_start[];
> +ENTRY_FUNCTION(start_imx53_guf_vincell_lt, r0, r1, r2)
> +{
> +	__imx53_guf_vincell_init(1);
> +}
>  
>  ENTRY_FUNCTION(start_imx53_guf_vincell, r0, r1, r2)
>  {
> -	void *fdt;
> -
> -	fdt = __dtb_imx53_guf_vincell_start - get_runtime_offset();
> -
> -	imx53_guf_vincell_init(fdt);
> +	__imx53_guf_vincell_init(0);
>  }
> -- 
> 2.8.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2016-09-14  9:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14  9:12 [PATCH 01/12] ARM: i.MX53: Add uart5 clock support Sascha Hauer
2016-09-14  9:12 ` [PATCH 02/12] ARM: i.MX53 Vincell: Reset phy consistently from device tree Sascha Hauer
2016-09-14  9:12 ` [PATCH 03/12] ARM: i.MX53 Vincell: Adjust bbu handler partition size to real partition size Sascha Hauer
2016-09-14  9:12 ` [PATCH 04/12] ARM: i.MX53 Vincell: Add PBL console support Sascha Hauer
2016-09-14  9:24   ` Michael Grzeschik [this message]
2016-09-15  8:00     ` Sascha Hauer
2016-09-14  9:12 ` [PATCH 05/12] ARM: i.MX53: do not pass base address to imx*_boot_save_loc Sascha Hauer
2016-09-14  9:12 ` [PATCH 06/12] ARM: i.MX: Provide bootsource functions for early boot code Sascha Hauer
2016-09-14  9:12 ` [PATCH 07/12] ARM: i.MX53: Detect booting from USB Sascha Hauer
2016-09-14  9:12 ` [PATCH 08/12] mtd: imx-nand: Move v3 register definitions to include file Sascha Hauer
2016-09-14  9:12 ` [PATCH 09/12] ARM: i.MX53: Implement NAND xload Sascha Hauer
2016-09-14  9:12 ` [PATCH 10/12] ARM: i.MX53 Vincell: Add NAND xload support Sascha Hauer
2016-09-14  9:12 ` [PATCH 11/12] ARM: imx_v7_defconfig: Enable Vincell support Sascha Hauer
2016-09-14  9:12 ` [PATCH 12/12] ARM: vincell_defconfig: make smaller Sascha Hauer

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=20160914092450.xd5xrsf37qb3odxm@pengutronix.de \
    --to=mgr@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.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