Skip to content

Commit e6f2ffe

Browse files
fpoussinjernejsk
authored andcommitted
clk: sunxi-ng: d1: Add CAN bus gates and resets
The D1 CCU contains gates and resets for two CAN buses. While the CAN bus controllers are only documented for the T113 SoC, the CCU is the same across all SoC variants. Signed-off-by: Fabien Poussin <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Signed-off-by: Samuel Holland <[email protected]> Acked-by: Jernej Skrabec <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jernej Skrabec <[email protected]>
1 parent 925b61b commit e6f2ffe

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

drivers/clk/sunxi-ng/ccu-sun20i-d1.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,11 @@ static SUNXI_CCU_GATE_HWS(bus_i2c2_clk, "bus-i2c2", apb1_hws,
469469
static SUNXI_CCU_GATE_HWS(bus_i2c3_clk, "bus-i2c3", apb1_hws,
470470
0x91c, BIT(3), 0);
471471

472+
static SUNXI_CCU_GATE_HWS(bus_can0_clk, "bus-can0", apb1_hws,
473+
0x92c, BIT(0), 0);
474+
static SUNXI_CCU_GATE_HWS(bus_can1_clk, "bus-can1", apb1_hws,
475+
0x92c, BIT(1), 0);
476+
472477
static const struct clk_parent_data spi_parents[] = {
473478
{ .fw_name = "hosc" },
474479
{ .hw = &pll_periph0_clk.hw },
@@ -997,6 +1002,8 @@ static struct ccu_common *sun20i_d1_ccu_clks[] = {
9971002
&bus_i2c1_clk.common,
9981003
&bus_i2c2_clk.common,
9991004
&bus_i2c3_clk.common,
1005+
&bus_can0_clk.common,
1006+
&bus_can1_clk.common,
10001007
&spi0_clk.common,
10011008
&spi1_clk.common,
10021009
&bus_spi0_clk.common,
@@ -1147,6 +1154,8 @@ static struct clk_hw_onecell_data sun20i_d1_hw_clks = {
11471154
[CLK_BUS_I2C1] = &bus_i2c1_clk.common.hw,
11481155
[CLK_BUS_I2C2] = &bus_i2c2_clk.common.hw,
11491156
[CLK_BUS_I2C3] = &bus_i2c3_clk.common.hw,
1157+
[CLK_BUS_CAN0] = &bus_can0_clk.common.hw,
1158+
[CLK_BUS_CAN1] = &bus_can1_clk.common.hw,
11501159
[CLK_SPI0] = &spi0_clk.common.hw,
11511160
[CLK_SPI1] = &spi1_clk.common.hw,
11521161
[CLK_BUS_SPI0] = &bus_spi0_clk.common.hw,
@@ -1252,6 +1261,8 @@ static struct ccu_reset_map sun20i_d1_ccu_resets[] = {
12521261
[RST_BUS_I2C1] = { 0x91c, BIT(17) },
12531262
[RST_BUS_I2C2] = { 0x91c, BIT(18) },
12541263
[RST_BUS_I2C3] = { 0x91c, BIT(19) },
1264+
[RST_BUS_CAN0] = { 0x92c, BIT(16) },
1265+
[RST_BUS_CAN1] = { 0x92c, BIT(17) },
12551266
[RST_BUS_SPI0] = { 0x96c, BIT(16) },
12561267
[RST_BUS_SPI1] = { 0x96c, BIT(17) },
12571268
[RST_BUS_EMAC] = { 0x97c, BIT(16) },

drivers/clk/sunxi-ng/ccu-sun20i-d1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
#include <dt-bindings/clock/sun20i-d1-ccu.h>
1111
#include <dt-bindings/reset/sun20i-d1-ccu.h>
1212

13-
#define CLK_NUMBER (CLK_FANOUT2 + 1)
13+
#define CLK_NUMBER (CLK_BUS_CAN1 + 1)
1414

1515
#endif /* _CCU_SUN20I_D1_H_ */

0 commit comments

Comments
 (0)