Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions arch/arm/dts/imx6qdl-dhcom-u-boot.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
};
};

&reg_usb_otg_vbus {
gpio = <&gpio3 31 GPIO_ACTIVE_HIGH>;
enable-active-high;
};

&wdog1 {
bootph-pre-ram;
};
6 changes: 1 addition & 5 deletions board/beacon/imx8mm/spl.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ void board_init_f(ulong dummy)
int ret;

arch_cpu_init();

init_uart_clk(1);

timer_init();

/* Clear the BSS. */
Expand All @@ -114,8 +111,6 @@ void board_init_f(ulong dummy)
hang();
}

preloader_console_init();

ret = uclass_get_device_by_name(UCLASS_CLK,
"clock-controller@30380000",
&dev);
Expand All @@ -124,6 +119,7 @@ void board_init_f(ulong dummy)
hang();
}

preloader_console_init();
enable_tzc380();

power_init_board();
Expand Down
2 changes: 0 additions & 2 deletions board/beacon/imx8mn/spl.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ int board_early_init_f(void)
/* Claiming pwm pins prevents LCD flicker during startup*/
imx_iomux_v3_setup_multiple_pads(pwm_pads, ARRAY_SIZE(pwm_pads));

init_uart_clk(1);

return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions board/beacon/imx8mp/spl.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ void board_init_f(ulong dummy)

arch_cpu_init();

init_uart_clk(1);

ret = spl_early_init();
if (ret) {
debug("spl_init() failed: %d\n", ret);
Expand Down
5 changes: 0 additions & 5 deletions board/freescale/imx93_evk/spl.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ int power_init_board(void)
pmic_reg_write(dev, PCA9450_BUCK3OUT_DVS0, buck_val + 0x4);
}

if (IS_ENABLED(CONFIG_IMX93_EVK_LPDDR4X)) {
/* Set VDDQ to 1.1V from buck2 */
pmic_reg_write(dev, PCA9450_BUCK2OUT_DVS0, 0x28);
}

/* set standby voltage to 0.65v */
if (val & PCA9450_REG_PWRCTRL_TOFF_DEB)
pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS1, 0x0);
Expand Down
33 changes: 28 additions & 5 deletions board/raspberrypi/rpi/rpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,21 @@ static const struct rpi_model rpi_models_new_scheme[] = {
DTB_DIR "bcm2712-rpi-5-b.dtb",
true,
},
[0x18] = {
"Compute Module 5",
DTB_DIR "bcm2712-rpi-cm5-cm5io.dtb",
true,
},
[0x19] = {
"500",
DTB_DIR "bcm2712-rpi-500.dtb",
true,
},
[0x1A] = {
"Compute Module 5 Lite",
DTB_DIR "bcm2712-rpi-cm5l-cm5io.dtb",
true,
},
};

static const struct rpi_model rpi_models_old_scheme[] = {
Expand Down Expand Up @@ -579,8 +594,14 @@ void update_fdt_from_fw(void *fdt, void *fw_fdt)
/* kernel address randomisation seed as provided by the firmware */
copy_property(fdt, fw_fdt, "/chosen", "kaslr-seed");

/* warnings from the firmware (if any) */
copy_property(fdt, fw_fdt, "/chosen", "user-warnings");

/* address of the PHY device as provided by the firmware */
copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg");

/* Bluetooth device address as provided by the firmware */
copy_property(fdt, fw_fdt, "/soc/serial@7e201000/bluetooth", "local-bd-address");
}

int ft_board_setup(void *blob, struct bd_info *bd)
Expand All @@ -589,11 +610,13 @@ int ft_board_setup(void *blob, struct bd_info *bd)

update_fdt_from_fw(blob, (void *)fw_dtb_pointer);

node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer");
if (node < 0)
fdt_simplefb_add_node(blob);
else
fdt_simplefb_enable_and_mem_rsv(blob);
if (CONFIG_IS_ENABLED(FDT_SIMPLEFB)) {
node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer");
if (node < 0)
fdt_simplefb_add_node(blob);
else
fdt_simplefb_enable_and_mem_rsv(blob);
}

#ifdef CONFIG_EFI_LOADER
/* Reserve the spin table */
Expand Down
1 change: 1 addition & 0 deletions configs/imx8mp_beacon_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ CONFIG_USE_ETHPRIME=y
CONFIG_ETHPRIME="eth1"
CONFIG_SPL_DM=y
CONFIG_CLK_COMPOSITE_CCF=y
CONFIG_SPL_CLK_IMX8MP=y
CONFIG_CLK_IMX8MP=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_FASTBOOT_BUF_ADDR=0x42800000
Expand Down
1 change: 1 addition & 0 deletions drivers/clk/imx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ config SPL_CLK_IMX8MP
depends on ARCH_IMX8M && SPL
select SPL_CLK
select SPL_CLK_CCF
select SPL_CLK_COMPOSITE_CCF
help
This enables SPL DM/DTS support for clock driver in i.MX8MP

Expand Down
28 changes: 26 additions & 2 deletions drivers/clk/imx/clk-imx6q.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ static const char *const usdhc_sels[] = { "pll2_pfd2_396m", "pll2_pfd0_352m", };
static const char *const periph_sels[] = { "periph_pre", "periph_clk2", };
static const char *const periph_pre_sels[] = { "pll2_bus", "pll2_pfd2_396m",
"pll2_pfd0_352m", "pll2_198m", };
static const char *const uart_sels[] = { "pll3_80m", "osc", };
static const char *const ecspi_sels[] = { "pll3_60m", "osc", };

static int imx6q_clk_probe(struct udevice *dev)
{
Expand Down Expand Up @@ -78,6 +80,15 @@ static int imx6q_clk_probe(struct udevice *dev)
imx_clk_mux("usdhc4_sel", base + 0x1c, 19, 1,
usdhc_sels, ARRAY_SIZE(usdhc_sels)));

if (of_machine_is_compatible("fsl,imx6qp") {
clk_dm(IMX6QDL_CLK_UART_SEL,
imx_clk_mux("uart_sel", base + 0x24, 6, 1, uart_sels,
ARRAY_SIZE(uart_sels)));
clk_dm(IMX6QDL_CLK_ECSPI_SEL,
imx_clk_mux("ecspi_sel", base + 0x38, 18, 1, ecspi_sels,
ARRAY_SIZE(ecspi_sels)));
}

clk_dm(IMX6QDL_CLK_USDHC1_PODF,
imx_clk_divider("usdhc1_podf", "usdhc1_sel",
base + 0x24, 11, 3));
Expand All @@ -91,8 +102,17 @@ static int imx6q_clk_probe(struct udevice *dev)
imx_clk_divider("usdhc4_podf", "usdhc4_sel",
base + 0x24, 22, 3));

clk_dm(IMX6QDL_CLK_ECSPI_ROOT,
imx_clk_divider("ecspi_root", "pll3_60m", base + 0x38, 19, 6));
if (of_machine_is_compatible("fsl,imx6qp") {
clk_dm(IMX6QDL_CLK_UART_SERIAL_PODF,
imx_clk_divider("uart_serial_podf", "uart_sel", base + 0x24, 0, 6));
clk_dm(IMX6QDL_CLK_ECSPI_ROOT,
imx_clk_divider("ecspi_root", "ecspi_sel", base + 0x38, 19, 6));
} else {
clk_dm(IMX6QDL_CLK_UART_SERIAL_PODF,
imx_clk_divider("uart_serial_podf", "pll3_80m", base + 0x24, 0, 6));
clk_dm(IMX6QDL_CLK_ECSPI_ROOT,
imx_clk_divider("ecspi_root", "pll3_60m", base + 0x38, 19, 6));
}

clk_dm(IMX6QDL_CLK_ECSPI1,
imx_clk_gate2("ecspi1", "ecspi_root", base + 0x6c, 0));
Expand All @@ -102,6 +122,10 @@ static int imx6q_clk_probe(struct udevice *dev)
imx_clk_gate2("ecspi3", "ecspi_root", base + 0x6c, 4));
clk_dm(IMX6QDL_CLK_ECSPI4,
imx_clk_gate2("ecspi4", "ecspi_root", base + 0x6c, 6));
clk_dm(IMX6QDL_CLK_UART_IPG,
imx_clk_gate2("uart_ipg", "ipg", base + 0x7c, 24));
clk_dm(IMX6QDL_CLK_UART_SERIAL,
imx_clk_gate2("uart_serial", "uart_serial_podf", base + 0x7c, 26));
clk_dm(IMX6QDL_CLK_USDHC1,
imx_clk_gate2("usdhc1", "usdhc1_podf", base + 0x80, 2));
clk_dm(IMX6QDL_CLK_USDHC2,
Expand Down
34 changes: 34 additions & 0 deletions drivers/clk/imx/clk-imx8mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,22 @@ static const char * const imx8mm_i2c4_sels[] = {"clock-osc-24m", "sys_pll1_160m"
"sys_pll3_out", "audio_pll1_out", "video_pll1_out",
"audio_pll2_out", "sys_pll1_133m", };

static const char * const imx8mm_uart1_sels[] = {"clock-osc-24m", "sys_pll1_80m", "sys_pll2_200m",
"sys_pll2_100m", "sys_pll3_out", "clk_ext2", "clk_ext4",
"audio_pll2_out", };

static const char * const imx8mm_uart2_sels[] = {"clock-osc-24m", "sys_pll1_80m", "sys_pll2_200m",
"sys_pll2_100m", "sys_pll3_out", "clk_ext2", "clk_ext3",
"audio_pll2_out", };

static const char * const imx8mm_uart3_sels[] = {"clock-osc-24m", "sys_pll1_80m", "sys_pll2_200m",
"sys_pll2_100m", "sys_pll3_out", "clk_ext2", "clk_ext4",
"audio_pll2_out", };

static const char * const imx8mm_uart4_sels[] = {"clock-osc-24m", "sys_pll1_80m", "sys_pll2_200m",
"sys_pll2_100m", "sys_pll3_out", "clk_ext2", "clk_ext3",
"audio_pll2_out", };

#if CONFIG_IS_ENABLED(PCIE_DW_IMX)
static const char * const imx8mm_pcie1_ctrl_sels[] = {"clock-osc-24m", "sys_pll2_250m", "sys_pll2_200m",
"sys_pll1_266m", "sys_pll1_800m", "sys_pll2_500m",
Expand Down Expand Up @@ -322,6 +338,24 @@ static int imx8mm_clk_probe(struct udevice *dev)
imx8m_clk_composite("i2c3", imx8mm_i2c3_sels, base + 0xae00));
clk_dm(IMX8MM_CLK_I2C4,
imx8m_clk_composite("i2c4", imx8mm_i2c4_sels, base + 0xae80));

clk_dm(IMX8MM_CLK_UART1,
imx8m_clk_composite("uart1", imx8mm_uart1_sels, base + 0xaf00));
clk_dm(IMX8MM_CLK_UART2,
imx8m_clk_composite("uart2", imx8mm_uart2_sels, base + 0xaf80));
clk_dm(IMX8MM_CLK_UART3,
imx8m_clk_composite("uart3", imx8mm_uart3_sels, base + 0xb000));
clk_dm(IMX8MM_CLK_UART4,
imx8m_clk_composite("uart4", imx8mm_uart4_sels, base + 0xb080));
clk_dm(IMX8MM_CLK_UART1_ROOT,
imx_clk_gate4("uart1_root_clk", "uart1", base + 0x4490, 0));
clk_dm(IMX8MM_CLK_UART2_ROOT,
imx_clk_gate4("uart2_root_clk", "uart2", base + 0x44a0, 0));
clk_dm(IMX8MM_CLK_UART3_ROOT,
imx_clk_gate4("uart3_root_clk", "uart3", base + 0x44b0, 0));
clk_dm(IMX8MM_CLK_UART4_ROOT,
imx_clk_gate4("uart4_root_clk", "uart4", base + 0x44c0, 0));

clk_dm(IMX8MM_CLK_WDOG,
imx8m_clk_composite("wdog", imx8mm_wdog_sels, base + 0xb900));
clk_dm(IMX8MM_CLK_USDHC3,
Expand Down
32 changes: 32 additions & 0 deletions drivers/clk/imx/clk-imx8mn.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,22 @@ static const char * const imx8mn_i2c4_sels[] = {"clock-osc-24m", "sys_pll1_160m"
"sys_pll3_out", "audio_pll1_out", "video_pll_out",
"audio_pll2_out", "sys_pll1_133m", };

static const char * const imx8mn_uart1_sels[] = {"clock-osc-24m", "sys_pll1_80m", "sys_pll2_200m",
"sys_pll2_100m", "sys_pll3_out", "clk_ext2",
"clk_ext4", "audio_pll2_out", };

static const char * const imx8mn_uart2_sels[] = {"clock-osc-24m", "sys_pll1_80m", "sys_pll2_200m",
"sys_pll2_100m", "sys_pll3_out", "clk_ext2",
"clk_ext3", "audio_pll2_out", };

static const char * const imx8mn_uart3_sels[] = {"clock-osc-24m", "sys_pll1_80m", "sys_pll2_200m",
"sys_pll2_100m", "sys_pll3_out", "clk_ext2",
"clk_ext4", "audio_pll2_out", };

static const char * const imx8mn_uart4_sels[] = {"clock-osc-24m", "sys_pll1_80m", "sys_pll2_200m",
"sys_pll2_100m", "sys_pll3_out", "clk_ext2",
"clk_ext3", "audio_pll2_out", };

#ifndef CONFIG_XPL_BUILD
static const char * const imx8mn_pwm1_sels[] = {"clock-osc-24m", "sys_pll2_100m", "sys_pll1_160m",
"sys_pll1_40m", "sys_pll3_out", "clk_ext1",
Expand Down Expand Up @@ -311,6 +327,14 @@ static int imx8mn_clk_probe(struct udevice *dev)
imx8m_clk_composite("i2c3", imx8mn_i2c3_sels, base + 0xae00));
clk_dm(IMX8MN_CLK_I2C4,
imx8m_clk_composite("i2c4", imx8mn_i2c4_sels, base + 0xae80));
clk_dm(IMX8MN_CLK_UART1,
imx8m_clk_composite("uart1", imx8mn_uart1_sels, base + 0xaf00));
clk_dm(IMX8MN_CLK_UART2,
imx8m_clk_composite("uart2", imx8mn_uart2_sels, base + 0xaf80));
clk_dm(IMX8MN_CLK_UART3,
imx8m_clk_composite("uart3", imx8mn_uart3_sels, base + 0xb000));
clk_dm(IMX8MN_CLK_UART4,
imx8m_clk_composite("uart4", imx8mn_uart4_sels, base + 0xb080));
clk_dm(IMX8MN_CLK_WDOG,
imx8m_clk_composite("wdog", imx8mn_wdog_sels, base + 0xb900));
clk_dm(IMX8MN_CLK_USDHC3,
Expand Down Expand Up @@ -355,6 +379,14 @@ static int imx8mn_clk_probe(struct udevice *dev)
imx_clk_gate2_shared2("nand_usdhc_rawnand_clk",
"nand_usdhc_bus", base + 0x4300, 0,
&share_count_nand));
clk_dm(IMX8MN_CLK_UART1_ROOT,
imx_clk_gate4("uart1_root_clk", "uart1", base + 0x4490, 0));
clk_dm(IMX8MN_CLK_UART2_ROOT,
imx_clk_gate4("uart2_root_clk", "uart2", base + 0x44a0, 0));
clk_dm(IMX8MN_CLK_UART3_ROOT,
imx_clk_gate4("uart3_root_clk", "uart3", base + 0x44b0, 0));
clk_dm(IMX8MN_CLK_UART4_ROOT,
imx_clk_gate4("uart4_root_clk", "uart4", base + 0x44c0, 0));
clk_dm(IMX8MN_CLK_USB1_CTRL_ROOT,
imx_clk_gate4("usb1_ctrl_root_clk", "usb_bus", base + 0x44d0, 0));

Expand Down
11 changes: 11 additions & 0 deletions drivers/serial/serial_mxc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>
*/

#include <clk.h>
#include <dm.h>
#include <errno.h>
#include <watchdog.h>
Expand Down Expand Up @@ -312,7 +313,17 @@ int mxc_serial_setbrg(struct udevice *dev, int baudrate)
static int mxc_serial_probe(struct udevice *dev)
{
struct mxc_serial_plat *plat = dev_get_plat(dev);
#if CONFIG_IS_ENABLED(CLK_CCF)
int ret;

ret = clk_get_bulk(dev, &plat->clks);
if (ret)
return ret;

ret = clk_enable_bulk(&plat->clks);
if (ret)
return ret;
#endif
_mxc_serial_init(plat->reg, plat->use_dte);

return 0;
Expand Down
3 changes: 3 additions & 0 deletions include/dm/platform_data/serial_mxc.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
/* Information about a serial port */
struct mxc_serial_plat {
struct mxc_uart *reg; /* address of registers in physical memory */
#if CONFIG_IS_ENABLED(CLK_CCF)
struct clk_bulk clks;
#endif
bool use_dte;
};

Expand Down