summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/imx8/Kconfig8
-rw-r--r--arch/arm/mach-imx/imx8m/Kconfig7
-rw-r--r--arch/arm/mach-imx/imx8m/soc.c36
-rw-r--r--arch/arm/mach-imx/mx6/clock.c66
-rw-r--r--arch/arm/mach-imx/romapi.c2
5 files changed, 84 insertions, 35 deletions
diff --git a/arch/arm/mach-imx/imx8/Kconfig b/arch/arm/mach-imx/imx8/Kconfig
index 018b87b85b7..15f844f5030 100644
--- a/arch/arm/mach-imx/imx8/Kconfig
+++ b/arch/arm/mach-imx/imx8/Kconfig
@@ -91,6 +91,13 @@ config TARGET_IMX8QM_ROM7720_A1
select SUPPORT_SPL
select IMX8QM
+config TARGET_IMX8QM_DMSSE20_A1
+ bool "Support i.MX8QM DMS-SE20-A1 board"
+ select BINMAN
+ select BOARD_LATE_INIT
+ select SUPPORT_SPL
+ select IMX8QM
+
config TARGET_IMX8QXP_MEK
bool "Support i.MX8QXP MEK board"
select BINMAN
@@ -105,6 +112,7 @@ endchoice
source "board/freescale/imx8qm_mek/Kconfig"
source "board/freescale/imx8qxp_mek/Kconfig"
source "board/congatec/cgtqmx8/Kconfig"
+source "board/advantech/imx8qm_dmsse20_a1/Kconfig"
source "board/advantech/imx8qm_rom7720_a1/Kconfig"
source "board/toradex/apalis-imx8/Kconfig"
source "board/toradex/colibri-imx8x/Kconfig"
diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index dc51f971d45..7639439bdc9 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -60,6 +60,12 @@ config TARGET_IMX8MQ_PHANBELL
select IMX8MQ
select IMX8M_LPDDR4
+config TARGET_IMX8MQ_REFORM2
+ bool "imx8mq_reform2"
+ select BINMAN
+ select IMX8MQ
+ select IMX8M_LPDDR4
+
config TARGET_IMX8MM_DATA_MODUL_EDM_SBC
bool "Data Modul eDM SBC i.MX8M Mini"
select BINMAN
@@ -362,6 +368,7 @@ source "board/kontron/pitx_imx8m/Kconfig"
source "board/kontron/sl-mx8mm/Kconfig"
source "board/menlo/mx8menlo/Kconfig"
source "board/msc/sm2s_imx8mp/Kconfig"
+source "board/mntre/imx8mq_reform2/Kconfig"
source "board/phytec/phycore_imx8mm/Kconfig"
source "board/phytec/phycore_imx8mp/Kconfig"
source "board/purism/librem5/Kconfig"
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index df865e997d3..4705e6c1192 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -914,6 +914,8 @@ static int low_drive_gpu_freq(void *blob)
if (cnt != 7)
printf("Warning: %s, assigned-clock-rates count %d\n", nodes_path_8mn[0], cnt);
+ if (cnt < 2)
+ return -1;
assignedclks[cnt - 1] = 200000000;
assignedclks[cnt - 2] = 200000000;
@@ -1395,40 +1397,6 @@ usb_modify_speed:
}
#endif
-#ifdef CONFIG_OF_BOARD_FIXUP
-#ifndef CONFIG_SPL_BUILD
-int board_fix_fdt(void *fdt)
-{
- if (is_imx8mpul()) {
- int i = 0;
- int nodeoff, ret;
- const char *status = "disabled";
- static const char * const dsi_nodes[] = {
- "/soc@0/bus@32c00000/mipi_dsi@32e60000",
- "/soc@0/bus@32c00000/lcd-controller@32e80000",
- "/dsi-host"
- };
-
- for (i = 0; i < ARRAY_SIZE(dsi_nodes); i++) {
- nodeoff = fdt_path_offset(fdt, dsi_nodes[i]);
- if (nodeoff > 0) {
-set_status:
- ret = fdt_setprop(fdt, nodeoff, "status", status,
- strlen(status) + 1);
- if (ret == -FDT_ERR_NOSPACE) {
- ret = fdt_increase_size(fdt, 512);
- if (!ret)
- goto set_status;
- }
- }
- }
- }
-
- return 0;
-}
-#endif
-#endif
-
#if !CONFIG_IS_ENABLED(SYSRESET)
void reset_cpu(void)
{
diff --git a/arch/arm/mach-imx/mx6/clock.c b/arch/arm/mach-imx/mx6/clock.c
index cb9d629be40..1bdc568f9b1 100644
--- a/arch/arm/mach-imx/mx6/clock.c
+++ b/arch/arm/mach-imx/mx6/clock.c
@@ -213,6 +213,7 @@ int enable_spi_clk(unsigned char enable, unsigned spi_num)
static u32 decode_pll(enum pll_clocks pll, u32 infreq)
{
u32 div, test_div, pll_num, pll_denom;
+ u64 temp64;
switch (pll) {
case PLL_SYS:
@@ -272,7 +273,10 @@ static u32 decode_pll(enum pll_clocks pll, u32 infreq)
}
test_div = 1 << (2 - test_div);
- return infreq * (div + pll_num / pll_denom) / test_div;
+ temp64 = (u64)infreq;
+ temp64 *= pll_num;
+ do_div(temp64, pll_denom);
+ return infreq * div + (unsigned long)temp64;
default:
return 0;
}
@@ -414,6 +418,60 @@ static u32 get_uart_clk(void)
return freq / (uart_podf + 1);
}
+static u32 get_lcd_clk(unsigned int ifnum)
+{
+ u32 pll_rate;
+ u32 pred, postd;
+
+ if (!is_mx6sx() && !is_mx6ul() && !is_mx6ull() && !is_mx6sl() &&
+ !is_mx6sll()) {
+ debug("This chip does't support lcd\n");
+ return 0;
+ }
+
+ pll_rate = decode_pll(PLL_VIDEO, MXC_HCLK);
+ if (ifnum == 1) {
+ if (!is_mx6sl()) {
+ pred = __raw_readl(&imx_ccm->cscdr2);
+ pred &= MXC_CCM_CSCDR2_LCDIF1_PRE_DIV_MASK;
+ pred = pred >> MXC_CCM_CSCDR2_LCDIF1_PRE_DIV_OFFSET;
+
+ postd = readl(&imx_ccm->cbcmr);
+ postd &= MXC_CCM_CBCMR_LCDIF1_PODF_MASK;
+ postd = postd >> MXC_CCM_CBCMR_LCDIF1_PODF_OFFSET;
+ } else {
+ pred = __raw_readl(&imx_ccm->cscdr2);
+ pred &= MXC_CCM_CSCDR2_LCDIF_PIX_PRE_DIV_MASK;
+ pred = pred >> MXC_CCM_CSCDR2_LCDIF_PIX_PRE_DIV_OFFSET;
+
+ postd = readl(&imx_ccm->cscmr1);
+ postd &= MXC_CCM_CSCMR1_LCDIF_PIX_PODF_OFFSET;
+ postd = postd >> MXC_CCM_CBCMR_LCDIF1_PODF_OFFSET;
+ }
+ } else if (ifnum == 2) {
+ if (is_mx6sx()) {
+ pred = __raw_readl(&imx_ccm->cscdr2);
+ pred &= MXC_CCM_CSCDR2_LCDIF2_PRE_DIV_MASK;
+ pred = pred >> MXC_CCM_CSCDR2_LCDIF2_PRE_DIV_OFFSET;
+
+ postd = readl(&imx_ccm->cscmr1);
+ postd &= MXC_CCM_CSCMR1_LCDIF2_PODF_MASK;
+ postd = postd >> MXC_CCM_CSCMR1_LCDIF2_PODF_OFFSET;
+
+ } else {
+ goto if_err;
+ }
+ } else {
+ goto if_err;
+ }
+
+ return DIV_ROUND_UP_ULL((u64)pll_rate, (postd + 1) * (pred + 1));
+
+if_err:
+ debug("This chip not support lcd iterface %d\n", ifnum);
+ return 0;
+}
+
static u32 get_cspi_clk(void)
{
u32 reg, cspi_podf;
@@ -744,6 +802,7 @@ void mxs_set_lcdclk(u32 base_addr, u32 freq)
}
enable_lcdif_clock(base_addr, 1);
+ debug("pixel clock = %u\n", mxc_get_clock(MXC_LCDIF1_CLK));
} else if (is_mx6sx()) {
/* Setting LCDIF2 for i.MX6SX */
if (enable_pll_video(pll_div, pll_num, pll_denom, post_div))
@@ -765,6 +824,7 @@ void mxs_set_lcdclk(u32 base_addr, u32 freq)
MXC_CCM_CSCMR1_LCDIF2_PODF_OFFSET));
enable_lcdif_clock(base_addr, 1);
+ debug("pixel clock = %u\n", mxc_get_clock(MXC_LCDIF2_CLK));
}
}
@@ -1269,6 +1329,10 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
return get_usdhc_clk(3);
case MXC_SATA_CLK:
return get_ahb_clk();
+ case MXC_LCDIF1_CLK:
+ return get_lcd_clk(1);
+ case MXC_LCDIF2_CLK:
+ return get_lcd_clk(2);
default:
printf("Unsupported MXC CLK: %d\n", clk);
break;
diff --git a/arch/arm/mach-imx/romapi.c b/arch/arm/mach-imx/romapi.c
index b49e7f80a28..ff0522c2d11 100644
--- a/arch/arm/mach-imx/romapi.c
+++ b/arch/arm/mach-imx/romapi.c
@@ -70,6 +70,8 @@ enum boot_device get_boot_device(void)
boot_dev = SPI_NOR_BOOT;
break;
case BT_DEV_TYPE_USB:
+ if (!is_imx8ulp() && !is_imx9())
+ boot_instance = 0;
boot_dev = boot_instance + USB_BOOT;
break;
default: