diff options
author | Tom Rini <trini@konsulko.com> | 2017-06-27 09:32:37 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-06-27 09:32:37 -0400 |
commit | 821560fd8e43eecc208c1c52ad24faadb6b52703 (patch) | |
tree | efb56bc170674d3a6680ca4d343888e9e84403c7 /arch/arm | |
parent | b8a238f1376f16c387765107b9d7f62e4358dd48 (diff) | |
parent | 65496a34835cb4c9547bd02dd15b018c333add9d (diff) |
Merge git://www.denx.de/git/u-boot-imx
Signed-off-by: Tom Rini <trini@konsulko.com>
Conflicts:
include/configs/imx6qdl_icore_rqs.h
include/configs/imx6ul_geam.h
include/configs/imx6ul_isiot.h
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/cpu/arm926ejs/mx25/generic.c | 30 | ||||
-rw-r--r-- | arch/arm/cpu/armv7/mx6/soc.c | 2 | ||||
-rw-r--r-- | arch/arm/cpu/armv7/mx7/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/imx-common/cpu.c | 3 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-mx25/clock.h | 1 |
5 files changed, 42 insertions, 2 deletions
diff --git a/arch/arm/cpu/arm926ejs/mx25/generic.c b/arch/arm/cpu/arm926ejs/mx25/generic.c index 0b1a8f4bbc..5d9bc6c0f1 100644 --- a/arch/arm/cpu/arm926ejs/mx25/generic.c +++ b/arch/arm/cpu/arm926ejs/mx25/generic.c @@ -58,6 +58,14 @@ static ulong imx_get_mpllclk(void) return imx_decode_pll(readl(&ccm->mpctl), fref); } +static ulong imx_get_upllclk(void) +{ + struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE; + ulong fref = MXC_HCLK; + + return imx_decode_pll(readl(&ccm->upctl), fref); +} + static ulong imx_get_armclk(void) { struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE; @@ -95,7 +103,8 @@ static ulong imx_get_ipgclk(void) static ulong imx_get_perclk(int clk) { struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE; - ulong fref = imx_get_ahbclk(); + ulong fref = readl(&ccm->mcr) & (1 << clk) ? imx_get_upllclk() : + imx_get_ahbclk(); ulong div; div = readl(&ccm->pcdr[CCM_PERCLK_REG(clk)]); @@ -104,6 +113,25 @@ static ulong imx_get_perclk(int clk) return fref / div; } +int imx_set_perclk(enum mxc_clock clk, bool from_upll, unsigned int freq) +{ + struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE; + ulong fref = from_upll ? imx_get_upllclk() : imx_get_ahbclk(); + ulong div = (fref + freq - 1) / freq; + + if (clk > MXC_UART_CLK || !div || --div > CCM_PERCLK_MASK) + return -EINVAL; + + clrsetbits_le32(&ccm->pcdr[CCM_PERCLK_REG(clk)], + CCM_PERCLK_MASK << CCM_PERCLK_SHIFT(clk), + div << CCM_PERCLK_SHIFT(clk)); + if (from_upll) + setbits_le32(&ccm->mcr, 1 << clk); + else + clrbits_le32(&ccm->mcr, 1 << clk); + return 0; +} + unsigned int mxc_get_clock(enum mxc_clock clk) { if (clk >= MXC_CLK_NUM) diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c index dd94797514..2bedbdbf20 100644 --- a/arch/arm/cpu/armv7/mx6/soc.c +++ b/arch/arm/cpu/armv7/mx6/soc.c @@ -158,7 +158,7 @@ u32 get_cpu_speed_grade_hz(void) * OCOTP_MEM0[7:6] (see Fusemap Description Table offset 0x480) * defines a 2-bit Temperature Grade * - * return temperature grade and min/max temperature in celcius + * return temperature grade and min/max temperature in Celsius */ #define OCOTP_MEM0_TEMP_SHIFT 6 diff --git a/arch/arm/cpu/armv7/mx7/Kconfig b/arch/arm/cpu/armv7/mx7/Kconfig index 80c129019a..aea85265ef 100644 --- a/arch/arm/cpu/armv7/mx7/Kconfig +++ b/arch/arm/cpu/armv7/mx7/Kconfig @@ -25,6 +25,13 @@ config TARGET_MX7DSABRESD select DM select DM_THERMAL +config TARGET_PICO_IMX7D + bool "pico-imx7d" + select BOARD_LATE_INIT + select MX7D + select DM + select DM_THERMAL + config TARGET_WARP7 bool "warp7" select BOARD_LATE_INIT @@ -45,6 +52,7 @@ config SYS_SOC default "mx7" source "board/freescale/mx7dsabresd/Kconfig" +source "board/technexion/pico-imx7d/Kconfig" source "board/toradex/colibri_imx7/Kconfig" source "board/warp7/Kconfig" diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c index 40fe813d29..74bdd24ed1 100644 --- a/arch/arm/imx-common/cpu.c +++ b/arch/arm/imx-common/cpu.c @@ -275,6 +275,9 @@ u32 get_ahb_clk(void) void arch_preboot_os(void) { +#if defined(CONFIG_PCIE_IMX) + imx_pcie_remove(); +#endif #if defined(CONFIG_CMD_SATA) sata_stop(); #if defined(CONFIG_MX6) diff --git a/arch/arm/include/asm/arch-mx25/clock.h b/arch/arm/include/asm/arch-mx25/clock.h index 9fdaa9dc07..7753cafa9f 100644 --- a/arch/arm/include/asm/arch-mx25/clock.h +++ b/arch/arm/include/asm/arch-mx25/clock.h @@ -51,6 +51,7 @@ enum mxc_clock { MXC_CLK_NUM }; +int imx_set_perclk(enum mxc_clock clk, bool from_upll, unsigned int freq); unsigned int mxc_get_clock(enum mxc_clock clk); #define imx_get_uartclk() mxc_get_clock(MXC_UART_CLK) |