public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] armv8: s32v234: Introduce basic support for s32v234evb
Date: Tue, 19 Apr 2016 12:53:52 -0400	[thread overview]
Message-ID: <20160419165352.GD13577@bill-the-cat> (raw)
In-Reply-To: <1459642206-20101-2-git-send-email-eddy.petrisor@gmail.com>

On Sun, Apr 03, 2016 at 03:10:06AM +0300, Eddy Petri?or wrote:

> Add initial support for NXP's S32V234 SoC and S32V234EVB board.
> 
> The S32V230 family is designed to support computation-intensive applications
> for image processing. The S32V234, as part of the S32V230 family, is a
> high-performance automotive processor designed to support safe
> computation-intensive applications in the area of vision and sensor fusion.
> 
> Code originally writen by:
> Original-signed-off-by: Stoica Cosmin-Stefan <cosminstefan.stoica@freescale.com>
> Original-signed-off-by: Mihaela Martinas <Mihaela.Martinas@freescale.com>
> Original-signed-off-by: Eddy Petri?or <eddy.petrisor@gmail.com>
> 
> Signed-off-by: Eddy Petri?or <eddy.petrisor@gmail.com>

Interesting, thanks for the contribution.  Some comments:

[snip]
> +#ifndef CONFIG_SYS_DCACHE_OFF
> +
> +#define CONFIG_SYS_FSL_IRAM_BASE        0x3e800000UL
> +#define CONFIG_SYS_FSL_IRAM_SIZE        0x800000UL
> +#define CONFIG_SYS_FSL_DRAM_BASE1       0x80000000UL
> +#define CONFIG_SYS_FSL_DRAM_SIZE1       0x40000000UL
> +#define CONFIG_SYS_FSL_DRAM_BASE2       0xC0000000UL
> +#define CONFIG_SYS_FSL_DRAM_SIZE2       0x20000000UL
> +#define CONFIG_SYS_FSL_PERIPH_BASE      0x40000000UL
> +#define CONFIG_SYS_FSL_PERIPH_SIZE      0x40000000UL

We shouldn't use CONFIG_SYS here as it's not a config option.

[snip]
> +++ b/arch/arm/cpu/armv8/s32v234/generic.c
[snip]
> +#ifdef CONFIG_FSL_ESDHC
> +DECLARE_GLOBAL_DATA_PTR;
> +#endif

No need to guard this.

[snip]
> +/* Dump some core clocks */
> +int do_s32v234_showclocks(cmd_tbl_t * cmdtp, int flag, int argc,
> +			  char *const argv[])
> +{
> +#if 0				/* Disable until the clock code will updated for S32V234 */

We should probably remove this then..

> +U_BOOT_CMD(clocks, CONFIG_SYS_MAXARGS, 1, do_s32v234_showclocks,
> +	   "display clocks", "");

And we're trying to not have commands in places other than cmd/

> +#ifdef CONFIG_FEC_MXC
> +void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
> +{
> +#if 0				/* b46902 */
> +	struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
> +	struct fuse_bank *bank = &ocotp->bank[4];
> +	struct fuse_bank4_regs *fuse =
> +	    (struct fuse_bank4_regs *)bank->fuse_regs;
> +
> +	u32 value = readl(&fuse->mac_addr0);
> +	mac[0] = (value >> 8);
> +	mac[1] = value;
> +
> +	value = readl(&fuse->mac_addr1);
> +	mac[2] = value >> 24;
> +	mac[3] = value >> 16;
> +	mac[4] = value >> 8;
> +	mac[5] = value;
> +#endif
> +}
> +#endif

If the FEC stuff doesn't work yet, lets just leave it out.

> +void reset_cpu(ulong addr)
> +{
> +#if 0				/* b46902 */
> +	struct src *src_regs = (struct src *)SRC_BASE_ADDR;
> +
> +	/* Generate a SW reset from SRC SCR register */
> +	writel(SRC_SCR_SW_RST, &src_regs->scr);
> +
> +	/* If we get there, we are not in good shape */
> +	mdelay(1000);
> +	printf("FATAL: Reset Failed!\n");
> +	hang();
> +#endif
> +};

Here and elsewhere, we should drop if 0'd code.  Can we not really do a
reset?

> diff --git a/arch/arm/include/asm/arch-s32v234/mc_me_regs.h b/arch/arm/include/asm/arch-s32v234/mc_me_regs.h
> new file mode 100644
> index 0000000..4313140
> --- /dev/null
> +++ b/arch/arm/include/asm/arch-s32v234/mc_me_regs.h
> @@ -0,0 +1,212 @@
> +/*
> + * Copyright 2015 Freescale Semiconductor, Inc.
> + *
> + * 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.

Here and anywhere else that was missed, please use SPDX tags.

[snip]
> diff --git a/board/freescale/s32v234evb/lpddr2.c b/board/freescale/s32v234evb/lpddr2.c
> new file mode 100644
> index 0000000..0bd5183
> --- /dev/null
> +++ b/board/freescale/s32v234evb/lpddr2.c

This file, and a few other things too possibly, feel more like SoC
specific things rather than board specific things.  Further, especially
for the DDR parts, can we leverage arch/arm/cpu/armv7/mx6/ddr.c perhaps
here? And move it into drivers/ddr/imx/ ?

> +static void setup_iomux_enet(void)
> +{
> +	/* TODO: Implement enet iomux when it is activated. */
> +}
> +
> +static void setup_iomux_i2c(void)
> +{
> +	/* TODO: Implement i2c iomux when it is activated. */
> +}
> +
> +#ifdef CONFIG_SYS_USE_NAND
> +void setup_iomux_nfc(void)
> +{
> +	/*TODO: Implement nfc iomux when it is activated. */
> +}
> +#endif

We should leave out these TODO bits for now.

> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
> index ea5f4bf..d564022 100644
> --- a/drivers/mmc/fsl_esdhc.c
> +++ b/drivers/mmc/fsl_esdhc.c
> @@ -182,7 +182,7 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)
>  	int timeout;
>  	struct fsl_esdhc_cfg *cfg = mmc->priv;
>  	struct fsl_esdhc *regs = (struct fsl_esdhc *)cfg->esdhc_base;
> -#ifdef CONFIG_FSL_LAYERSCAPE
> +#if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234)
>  	dma_addr_t addr;
>  #endif
>  	uint wml_value;

Maybe we need to come up with a flag that says 64bit CPU and use that
here?  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160419/6ebbbed3/attachment.sig>

  reply	other threads:[~2016-04-19 16:53 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-03  0:10 [U-Boot] [PATCH 1/2] serial: Introduce linflex uart support Eddy Petrișor
2016-04-03  0:10 ` [U-Boot] [PATCH 2/2] armv8: s32v234: Introduce basic support for s32v234evb Eddy Petrișor
2016-04-19 16:53   ` Tom Rini [this message]
2016-04-21 16:03     ` Eddy Petrișor
2016-04-21 16:28       ` Tom Rini
2016-04-04  3:22 ` [U-Boot] [PATCH 1/2] serial: Introduce linflex uart support Bin Meng
2016-04-04 14:22   ` Eddy Petrișor
2016-04-05  1:43     ` Bin Meng
2016-04-27 21:39 ` [U-Boot] [PATCH 0/2] Initial support for S32V234 - version 2 Eddy Petrișor
2016-04-27 21:39 ` [U-Boot] [PATCH 1/2] serial: Introduce linflex uart support Eddy Petrișor
2016-04-27 21:39 ` [U-Boot] [PATCH 2/2] armv8: s32v234: Introduce basic support for s32v234evb Eddy Petrișor
2016-04-27 22:07 ` [U-Boot] [PATCH v2 0/2] Initial S32V234 support - version 2 (with notes now) Eddy Petrișor
2016-04-27 22:07 ` [U-Boot] [PATCH v2 1/2] serial: Introduce linflex uart support Eddy Petrișor
2016-05-07 14:56   ` Bin Meng
2016-05-08  0:05     ` Eddy Petrișor
2016-04-27 22:07 ` [U-Boot] [PATCH v2 2/2] armv8: s32v234: Introduce basic support for s32v234evb Eddy Petrișor
2016-05-07 16:22   ` Alexander Graf
2016-05-07 23:59     ` Eddy Petrișor
2016-05-08  7:21       ` Alexander Graf
2016-05-28  9:56 ` [U-Boot] [PATCH v3 0/2] Initial support for S32V234 - version 3 Eddy Petrișor
2016-05-28  9:56   ` [U-Boot] [PATCH v3 1/2] serial: Introduce linflex uart support Eddy Petrișor
2016-05-28  9:56   ` [U-Boot] [PATCH v3 2/2] armv8: s32v234: Introduce basic support for s32v234evb Eddy Petrișor
2016-05-28 10:10     ` Alexander Graf
2016-05-28 10:51 ` [U-Boot] [PATCH v4 0/2] Initial support for s32v234 Eddy Petrișor
2016-05-28 10:51   ` [U-Boot] [PATCH v4 1/2] serial: Introduce linflex uart support Eddy Petrișor
2016-05-28 10:51   ` [U-Boot] [PATCH v4 2/2] armv8: s32v234: Introduce basic support for s32v234evb Eddy Petrișor
2016-06-04 19:18 ` [U-Boot] [PATCH v5 0/2] Initial support for s32v234 Eddy Petrișor
2016-06-04 19:18   ` [U-Boot] [PATCH v5 1/2] serial: Introduce linflex uart support Eddy Petrișor
2016-06-04 19:18   ` [U-Boot] [PATCH v5 2/2] armv8: s32v234: Introduce basic support for s32v234evb Eddy Petrișor
2016-06-04 22:23   ` [U-Boot] [PATCH v5 0/2] Initial support for s32v234 Fabio Estevam
2016-06-04 23:59     ` Eddy Petrișor
2016-06-05  0:52       ` Fabio Estevam
2016-06-05  1:15         ` Eddy Petrișor
2016-06-05  0:42 ` [U-Boot] [PATCH v6 " Eddy Petrișor
2016-06-05  0:42   ` [U-Boot] [PATCH v6 1/2] serial: Introduce linflex uart support Eddy Petrișor
2016-06-19 14:10     ` [U-Boot] [U-Boot, v6, " Tom Rini
2016-06-19 20:41       ` Eddy Petrișor
2016-06-05  0:43   ` [U-Boot] [PATCH v6 2/2] armv8: s32v234: Introduce basic support for s32v234evb Eddy Petrișor
2016-06-19 14:10     ` [U-Boot] [U-Boot, v6, " Tom Rini
2016-06-19 20:51       ` Eddy Petrișor

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=20160419165352.GD13577@bill-the-cat \
    --to=trini@konsulko.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