Skip to content

Commit a36cc6c

Browse files
Andre-ARMwens
authored andcommitted
clk: sunxi-ng: a523: add reset lines
Allwinner SoCs do not contain a separate reset controller, instead the reset lines for the various devices are integrated into the "BGR" (Bus Gate / Reset) registers, for each device group: one for all UARTs, one for all SPI interfaces, and so on. The Allwinner CCU driver also doubles as a reset provider, and since the reset lines are indeed just single bits in those BGR register, we can represent them easily in an array of structs, just containing the register offset and the bit number. Add the location of the reset bits for all devices in the A523/T527 SoCs, using the existing sunxi CCU infrastructure. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://patch.msgid.link/20250307002628.10684-14-andre.przywara@arm.com Signed-off-by: Chen-Yu Tsai <wens@csie.org>
1 parent f3dabb2 commit a36cc6c

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

drivers/clk/sunxi-ng/ccu-sun55i-a523.c

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,11 +1526,95 @@ static struct clk_hw_onecell_data sun55i_a523_hw_clks = {
15261526
},
15271527
};
15281528

1529+
static struct ccu_reset_map sun55i_a523_ccu_resets[] = {
1530+
[RST_MBUS] = { 0x540, BIT(30) },
1531+
[RST_BUS_NSI] = { 0x54c, BIT(16) },
1532+
[RST_BUS_DE] = { 0x60c, BIT(16) },
1533+
[RST_BUS_DI] = { 0x62c, BIT(16) },
1534+
[RST_BUS_G2D] = { 0x63c, BIT(16) },
1535+
[RST_BUS_SYS] = { 0x64c, BIT(16) },
1536+
[RST_BUS_GPU] = { 0x67c, BIT(16) },
1537+
[RST_BUS_CE] = { 0x68c, BIT(16) },
1538+
[RST_BUS_SYS_CE] = { 0x68c, BIT(17) },
1539+
[RST_BUS_VE] = { 0x69c, BIT(16) },
1540+
[RST_BUS_DMA] = { 0x70c, BIT(16) },
1541+
[RST_BUS_MSGBOX] = { 0x71c, BIT(16) },
1542+
[RST_BUS_SPINLOCK] = { 0x72c, BIT(16) },
1543+
[RST_BUS_CPUXTIMER] = { 0x74c, BIT(16) },
1544+
[RST_BUS_DBG] = { 0x78c, BIT(16) },
1545+
[RST_BUS_PWM0] = { 0x7ac, BIT(16) },
1546+
[RST_BUS_PWM1] = { 0x7ac, BIT(17) },
1547+
[RST_BUS_DRAM] = { 0x80c, BIT(16) },
1548+
[RST_BUS_NAND] = { 0x82c, BIT(16) },
1549+
[RST_BUS_MMC0] = { 0x84c, BIT(16) },
1550+
[RST_BUS_MMC1] = { 0x84c, BIT(17) },
1551+
[RST_BUS_MMC2] = { 0x84c, BIT(18) },
1552+
[RST_BUS_SYSDAP] = { 0x88c, BIT(16) },
1553+
[RST_BUS_UART0] = { 0x90c, BIT(16) },
1554+
[RST_BUS_UART1] = { 0x90c, BIT(17) },
1555+
[RST_BUS_UART2] = { 0x90c, BIT(18) },
1556+
[RST_BUS_UART3] = { 0x90c, BIT(19) },
1557+
[RST_BUS_UART4] = { 0x90c, BIT(20) },
1558+
[RST_BUS_UART5] = { 0x90c, BIT(21) },
1559+
[RST_BUS_UART6] = { 0x90c, BIT(22) },
1560+
[RST_BUS_UART7] = { 0x90c, BIT(23) },
1561+
[RST_BUS_I2C0] = { 0x91c, BIT(16) },
1562+
[RST_BUS_I2C1] = { 0x91c, BIT(17) },
1563+
[RST_BUS_I2C2] = { 0x91c, BIT(18) },
1564+
[RST_BUS_I2C3] = { 0x91c, BIT(19) },
1565+
[RST_BUS_I2C4] = { 0x91c, BIT(20) },
1566+
[RST_BUS_I2C5] = { 0x91c, BIT(21) },
1567+
[RST_BUS_CAN] = { 0x92c, BIT(16) },
1568+
[RST_BUS_SPI0] = { 0x96c, BIT(16) },
1569+
[RST_BUS_SPI1] = { 0x96c, BIT(17) },
1570+
[RST_BUS_SPI2] = { 0x96c, BIT(18) },
1571+
[RST_BUS_SPIFC] = { 0x96c, BIT(19) },
1572+
[RST_BUS_EMAC0] = { 0x97c, BIT(16) },
1573+
[RST_BUS_EMAC1] = { 0x98c, BIT(16) | BIT(17) }, /* GMAC1-AXI */
1574+
[RST_BUS_IR_RX] = { 0x99c, BIT(16) },
1575+
[RST_BUS_IR_TX] = { 0x9cc, BIT(16) },
1576+
[RST_BUS_GPADC0] = { 0x9ec, BIT(16) },
1577+
[RST_BUS_GPADC1] = { 0x9ec, BIT(17) },
1578+
[RST_BUS_THS] = { 0x9fc, BIT(16) },
1579+
[RST_USB_PHY0] = { 0xa70, BIT(30) },
1580+
[RST_USB_PHY1] = { 0xa74, BIT(30) },
1581+
[RST_BUS_OHCI0] = { 0xa8c, BIT(16) },
1582+
[RST_BUS_OHCI1] = { 0xa8c, BIT(17) },
1583+
[RST_BUS_EHCI0] = { 0xa8c, BIT(20) },
1584+
[RST_BUS_EHCI1] = { 0xa8c, BIT(21) },
1585+
[RST_BUS_OTG] = { 0xa8c, BIT(24) },
1586+
[RST_BUS_3] = { 0xa8c, BIT(25) }, /* BSP + register */
1587+
[RST_BUS_LRADC] = { 0xa9c, BIT(16) },
1588+
[RST_BUS_PCIE_USB3] = { 0xaac, BIT(16) },
1589+
[RST_BUS_DISPLAY0_TOP] = { 0xabc, BIT(16) },
1590+
[RST_BUS_DISPLAY1_TOP] = { 0xacc, BIT(16) },
1591+
[RST_BUS_HDMI_MAIN] = { 0xb1c, BIT(16) },
1592+
[RST_BUS_HDMI_SUB] = { 0xb1c, BIT(17) },
1593+
[RST_BUS_MIPI_DSI0] = { 0xb4c, BIT(16) },
1594+
[RST_BUS_MIPI_DSI1] = { 0xb4c, BIT(17) },
1595+
[RST_BUS_TCON_LCD0] = { 0xb7c, BIT(16) },
1596+
[RST_BUS_TCON_LCD1] = { 0xb7c, BIT(17) },
1597+
[RST_BUS_TCON_LCD2] = { 0xb7c, BIT(18) },
1598+
[RST_BUS_TCON_TV0] = { 0xb9c, BIT(16) },
1599+
[RST_BUS_TCON_TV1] = { 0xb9c, BIT(17) },
1600+
[RST_BUS_LVDS0] = { 0xbac, BIT(16) },
1601+
[RST_BUS_LVDS1] = { 0xbac, BIT(17) },
1602+
[RST_BUS_EDP] = { 0xbbc, BIT(16) },
1603+
[RST_BUS_VIDEO_OUT0] = { 0xbcc, BIT(16) },
1604+
[RST_BUS_VIDEO_OUT1] = { 0xbcc, BIT(17) },
1605+
[RST_BUS_LEDC] = { 0xbfc, BIT(16) },
1606+
[RST_BUS_CSI] = { 0xc1c, BIT(16) },
1607+
[RST_BUS_ISP] = { 0xc2c, BIT(16) }, /* BSP + register */
1608+
};
1609+
15291610
static const struct sunxi_ccu_desc sun55i_a523_ccu_desc = {
15301611
.ccu_clks = sun55i_a523_ccu_clks,
15311612
.num_ccu_clks = ARRAY_SIZE(sun55i_a523_ccu_clks),
15321613

15331614
.hw_clks = &sun55i_a523_hw_clks,
1615+
1616+
.resets = sun55i_a523_ccu_resets,
1617+
.num_resets = ARRAY_SIZE(sun55i_a523_ccu_resets),
15341618
};
15351619

15361620
static const u32 pll_regs[] = {

0 commit comments

Comments
 (0)