From: Peng Fan <van.freenix@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 05/20] imx: mx7ulp: Add soc level initialization codes and functions
Date: Wed, 22 Feb 2017 14:48:41 +0800 [thread overview]
Message-ID: <20170222064817.GA23339@linux-7smt.suse> (raw)
In-Reply-To: <20485327-23f4-5861-601b-474bb3d8c7d9@denx.de>
On Sun, Feb 12, 2017 at 10:19:41AM +0100, Stefano Babic wrote:
>Hi Peng,
>
>On 27/12/2016 11:04, Peng Fan wrote:
>> Implement soc level functions to get cpu rev, reset cause, enable cache,
>> etc. We will disable the wdog and init clocks in s_init at very early u-boot
>> phase.
>>
>> Since the we are seeking the way to get chip id for mx7ulp, the get_cpu_rev
>> is hard coded to a fixed value. This may change in future.
>>
>
>ok, understood, noted
>
>> Reuse some code in imx-common.
>>
>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>> Signed-off-by: Ye Li <ye.li@nxp.com>
>> Cc: Stefano Babic <sbabic@denx.de>
>> ---
>>
[.......]
>> +
>> +#if defined(CONFIG_DISPLAY_CPUINFO)
>> +const char *get_imx_type(u32 imxtype)
>> +{
>> +#ifdef CONFIG_MXC_OCOTP
>> +
>> + u8 uid[8];
>> + u32 val;
>> +
>> + struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
>> + struct fuse_bank *bank = &ocotp->bank[0];
>> + struct fuse_bank1_regs *fuse =
>> + (struct fuse_bank1_regs *)bank->fuse_regs;
>> +
>> + val = readl(&fuse->cfg0);
>> + *uid = val & 0xFF;
>> + *(uid + 1) = (val & 0xFF00) >> 8;
>> +
>> + val = readl(&fuse->cfg1);
>> + *(uid + 2) = val & 0xFF;
>> + *(uid + 3) = (val & 0xFF00) >> 8;
>> +
>> + val = readl(&fuse->cfg2);
>> + *(uid + 4) = val & 0xFF;
>> + *(uid + 5) = (val & 0xFF00) >> 8;
>> +
>> + val = readl(&fuse->cfg3);
>> + *(uid + 6) = val & 0xFF;
>> + *(uid + 7) = (val & 0xFF00) >> 8;
>
>I think it can be better described here, at least what you want to read
>for fuse->cfg0..cfg3.
Discard in V3.
>
>> +
>> + debug("UID = %02X %02X %02X %02X %02X %02X %02X %02X\r\n",
>> + uid[0], uid[1], uid[2], uid[3], uid[4], uid[5], uid[6], uid[7]);
>> +
>> +#endif
>> + return "7ULP";
>> +}
>> +
[.....]
>> +
>> +u32 get_imx_reset_cause(void)
>> +{
>> + return reset_cause;
>
>Why do you stored it ain a static variable ? Is it read just once from
>registers ?
This function could be removed, it reuses the one in imx-common.c
>
>> +}
>> +
>> +#ifdef CONFIG_ENV_IS_IN_MMC
>> +__weak int board_mmc_get_env_dev(int devno)
>> +{
>> + return CONFIG_SYS_MMC_ENV_DEV;
>> +}
>> +
>> +int mmc_get_env_dev(void)
>> +{
>> + int devno = 0;
>> + u32 bt1_cfg = 0;
>> +
>> + /* If not boot from sd/mmc, use default value */
>> + if (get_boot_mode() == LOW_POWER_BOOT)
>> + return CONFIG_SYS_MMC_ENV_DEV;
>> +
>> + bt1_cfg = readl(CMC1_RBASE + 0x40);
>> + devno = (bt1_cfg >> 9) & 0x7;
>> +
>> + return board_mmc_get_env_dev(devno);
>> +}
>> +#endif
>> diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
>> index 1873185..68ee60f 100644
>> --- a/arch/arm/imx-common/Makefile
>> +++ b/arch/arm/imx-common/Makefile
>> @@ -31,6 +31,10 @@ obj-$(CONFIG_IMX_RDC) += rdc-sema.o
>> obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
>> obj-$(CONFIG_SECURE_BOOT) += hab.o
>> endif
>> +ifeq ($(SOC),$(filter $(SOC),mx7ulp))
>> +obj-y += cache.o
>> +obj-$(CONFIG_SECURE_BOOT) += hab.o
>> +endif
>> ifeq ($(SOC),$(filter $(SOC),vf610))
>> obj-y += ddrmc-vf610.o
>> endif
>> diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h
>> index 8bd1421..b052406 100644
>> --- a/arch/arm/include/asm/arch-imx/cpu.h
>> +++ b/arch/arm/include/asm/arch-imx/cpu.h
>> @@ -25,10 +25,12 @@
>> #define MXC_CPU_MX6QP 0x69
>> #define MXC_CPU_MX7S 0x71 /* dummy ID */
>> #define MXC_CPU_MX7D 0x72
>> +#define MXC_CPU_MX7ULP 0x81 /* Temporally hard code */
>
>ok
>
>> #define MXC_CPU_VF610 0xF6 /* dummy ID */
>>
>> #define MXC_SOC_MX6 0x60
>> #define MXC_SOC_MX7 0x70
>> +#define MXC_SOC_MX7ULP 0x80 /* dummy */
>>
>> #define CHIP_REV_1_0 0x10
>> #define CHIP_REV_1_1 0x11
>> diff --git a/arch/arm/include/asm/arch-mx7ulp/imx-regs.h b/arch/arm/include/asm/arch-mx7ulp/imx-regs.h
>> index 30d0ba4..cdfbe2e 100644
>> --- a/arch/arm/include/asm/arch-mx7ulp/imx-regs.h
>> +++ b/arch/arm/include/asm/arch-mx7ulp/imx-regs.h
>> @@ -97,6 +97,11 @@
>> #define CORE_B_ROM_SIZE (SZ_32K + SZ_64K)
>> #define CORE_B_ROM_BASE (0x00000000)
>>
>> +#define ROMCP_ARB_BASE_ADDR CORE_B_ROM_BASE
>> +#define ROMCP_ARB_END_ADDR CORE_B_ROM_SIZE
>> +#define IRAM_BASE_ADDR OCRAM_0_BASE
>> +#define IRAM_SIZE (SZ_128K + SZ_128K)
>> +
>
>Why is it here and not in Patch 2/20 ?
Move the 2/20 in V3.
Thanks,
Peng.
next prev parent reply other threads:[~2017-02-22 6:48 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-27 10:04 [U-Boot] [PATCH V2 00/20] imx: add i.MX7ULP support Peng Fan
2016-12-27 10:04 ` [U-Boot] [PATCH V2 01/20] imx: mx7ulp: Add mx7ulp to Kconfig Peng Fan
2017-02-12 8:39 ` Stefano Babic
2016-12-27 10:04 ` [U-Boot] [PATCH V2 02/20] imx: mx7ulp: add registers header file Peng Fan
2017-02-12 8:40 ` Stefano Babic
2016-12-27 10:04 ` [U-Boot] [PATCH V2 03/20] imx: mx7ulp: add iomux driver to support IOMUXC0 and IOMUXC1 Peng Fan
2017-02-12 8:45 ` Stefano Babic
2016-12-27 10:04 ` [U-Boot] [PATCH V2 04/20] imx: mx7ulp: Add clock framework and functions Peng Fan
2017-02-12 9:12 ` Stefano Babic
2016-12-27 10:04 ` [U-Boot] [PATCH V2 05/20] imx: mx7ulp: Add soc level initialization codes " Peng Fan
2017-02-12 9:19 ` Stefano Babic
2017-02-22 6:48 ` Peng Fan [this message]
2016-12-27 10:04 ` [U-Boot] [PATCH V2 06/20] imx: mx7ulp: handle all the lpuarts in get_lpuart_clk Peng Fan
2017-02-12 9:20 ` Stefano Babic
2016-12-27 10:04 ` [U-Boot] [PATCH V2 07/20] imx: mx7ulp: Implement the clock functions for i2c driver Peng Fan
2017-02-12 9:20 ` Stefano Babic
2016-12-27 10:04 ` [U-Boot] [PATCH V2 08/20] gpio: Add Rapid GPIO2P driver for i.MX7ULP Peng Fan
2017-02-12 9:21 ` Stefano Babic
2016-12-27 10:04 ` [U-Boot] [PATCH V2 09/20] mxc_ocotp: Update driver to support OCOTP controller on i.MX7ULP Peng Fan
2017-02-12 9:22 ` Stefano Babic
2016-12-27 10:04 ` [U-Boot] [PATCH V2 10/20] mx7ulp: Add iomux pins header file Peng Fan
2016-12-27 10:04 ` [U-Boot] [PATCH V2 11/20] wdog: Add the watchdog driver for MX7ULP Peng Fan
2017-02-12 9:25 ` Stefano Babic
2017-02-22 6:59 ` Peng Fan
2017-02-22 8:18 ` Stefano Babic
2016-12-27 10:04 ` [U-Boot] [PATCH V2 12/20] pinctrl: Add i.MX7ULP pinctrl driver Peng Fan
2017-01-12 5:07 ` Simon Glass
2017-02-12 9:25 ` Stefano Babic
2016-12-27 10:04 ` [U-Boot] [PATCH V2 13/20] i2c: lpi2c: add lpi2c driver for i.MX7ULP Peng Fan
2016-12-27 10:04 ` [U-Boot] [PATCH V2 14/20] serial: lpuart: restructure lpuart driver Peng Fan
2016-12-29 9:28 ` Bhuvanchandra DV
2017-02-12 9:27 ` Stefano Babic
2016-12-27 10:04 ` [U-Boot] [PATCH V2 15/20] serial: lpuart: add i.MX7ULP support Peng Fan
2016-12-27 10:04 ` [U-Boot] [PATCH V2 16/20] mx7ulp: Add HAB boot support Peng Fan
2017-02-12 9:28 ` Stefano Babic
2016-12-27 10:04 ` [U-Boot] [PATCH V2 17/20] arm: dts: add i.MX7ULP dtsi file Peng Fan
2016-12-27 10:04 ` [U-Boot] [PATCH V2 18/20] mmc: fsl_esdhc: support i.MX7ULP Peng Fan
2016-12-27 22:17 ` Jaehoon Chung
2017-02-12 9:29 ` Stefano Babic
2016-12-27 10:04 ` [U-Boot] [PATCH V2 19/20] imx: imx7ulp: add EVK board support Peng Fan
2016-12-27 10:04 ` [U-Boot] [PATCH V2 20/20] imx: mx7ulp_evk: enable mmc/regulator support Peng Fan
2016-12-27 11:22 ` Fabio Estevam
2016-12-27 12:07 ` Peng Fan
2017-01-03 9:05 ` Peng Fan
2017-01-12 2:23 ` Peng Fan
2017-01-12 2:24 ` Peng Fan
2017-02-08 8:36 ` [U-Boot] [PATCH V2 00/20] imx: add i.MX7ULP support Peng Fan
2017-02-08 12:16 ` Stefano Babic
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=20170222064817.GA23339@linux-7smt.suse \
--to=van.freenix@gmail.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