Commit 68b3b6f1 authored by Claudiu Beznea's avatar Claudiu Beznea
Browse files

clk: at91: mark ddr clocks as critical



Mark DDR clocks as critical for AT91 devices. These clocks are enabled
by bootloader when initializing DDR and needs to stay enabled. Up to
this patch the DDR clocks were requested from drivers/memory/atmel-sdramc.c
which does only clock request and enable. There is no need to have
a separate driver just for this, thus the atmel-sdramc.c will be deleted
in a subsequent patch.

Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20221208114515.35179-2-claudiu.beznea@microchip.com
parent 1b929c02
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
	for (i = 0; i < ARRAY_SIZE(at91rm9200_systemck); i++) {
		hw = at91_clk_register_system(regmap, at91rm9200_systemck[i].n,
					      at91rm9200_systemck[i].p,
					      at91rm9200_systemck[i].id);
					      at91rm9200_systemck[i].id, 0);
		if (IS_ERR(hw))
			goto err_free;

+1 −1
Original line number Diff line number Diff line
@@ -460,7 +460,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
	for (i = 0; i < data->num_sck; i++) {
		hw = at91_clk_register_system(regmap, data->sck[i].n,
					      data->sck[i].p,
					      data->sck[i].id);
					      data->sck[i].id, 0);
		if (IS_ERR(hw))
			goto err_free;

+8 −2
Original line number Diff line number Diff line
@@ -40,9 +40,14 @@ static const struct clk_pll_characteristics plla_characteristics = {
static const struct {
	char *n;
	char *p;
	unsigned long flags;
	u8 id;
} at91sam9g45_systemck[] = {
	{ .n = "ddrck", .p = "masterck_div", .id = 2 },
	/*
	 * ddrck feeds DDR controller and is enabled by bootloader thus we need
	 * to keep it enabled in case there is no Linux consumer for it.
	 */
	{ .n = "ddrck", .p = "masterck_div", .id = 2, .flags = CLK_IS_CRITICAL },
	{ .n = "uhpck", .p = "usbck",        .id = 6 },
	{ .n = "pck0",  .p = "prog0",        .id = 8 },
	{ .n = "pck1",  .p = "prog1",        .id = 9 },
@@ -198,7 +203,8 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
	for (i = 0; i < ARRAY_SIZE(at91sam9g45_systemck); i++) {
		hw = at91_clk_register_system(regmap, at91sam9g45_systemck[i].n,
					      at91sam9g45_systemck[i].p,
					      at91sam9g45_systemck[i].id);
					      at91sam9g45_systemck[i].id,
					      at91sam9g45_systemck[i].flags);
		if (IS_ERR(hw))
			goto err_free;

+9 −3
Original line number Diff line number Diff line
@@ -54,9 +54,14 @@ static const struct clk_pll_characteristics pllb_characteristics = {
static const struct {
	char *n;
	char *p;
	unsigned long flags;
	u8 id;
} at91sam9n12_systemck[] = {
	{ .n = "ddrck", .p = "masterck_div", .id = 2 },
	/*
	 * ddrck feeds DDR controller and is enabled by bootloader thus we need
	 * to keep it enabled in case there is no Linux consumer for it.
	 */
	{ .n = "ddrck", .p = "masterck_div", .id = 2, .flags = CLK_IS_CRITICAL },
	{ .n = "lcdck", .p = "masterck_div", .id = 3 },
	{ .n = "uhpck", .p = "usbck",        .id = 6 },
	{ .n = "udpck", .p = "usbck",        .id = 7 },
@@ -223,7 +228,8 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
	for (i = 0; i < ARRAY_SIZE(at91sam9n12_systemck); i++) {
		hw = at91_clk_register_system(regmap, at91sam9n12_systemck[i].n,
					      at91sam9n12_systemck[i].p,
					      at91sam9n12_systemck[i].id);
					      at91sam9n12_systemck[i].id,
					      at91sam9n12_systemck[i].flags);
		if (IS_ERR(hw))
			goto err_free;

@@ -236,7 +242,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
							 at91sam9n12_periphck[i].n,
							 "masterck_div",
							 at91sam9n12_periphck[i].id,
							 &range, INT_MIN);
							 &range, INT_MIN, 0);
		if (IS_ERR(hw))
			goto err_free;

+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
	for (i = 0; i < ARRAY_SIZE(at91sam9rl_systemck); i++) {
		hw = at91_clk_register_system(regmap, at91sam9rl_systemck[i].n,
					      at91sam9rl_systemck[i].p,
					      at91sam9rl_systemck[i].id);
					      at91sam9rl_systemck[i].id, 0);
		if (IS_ERR(hw))
			goto err_free;

Loading