diff options
| author | Richard Genoud <[email protected]> | 2026-01-23 12:44:40 +0100 |
|---|---|---|
| committer | Michael Trimarchi <[email protected]> | 2026-02-03 21:44:33 +0100 |
| commit | 8034c41d63c985de3bab9980ce81aa70342f64bf (patch) | |
| tree | f39b505b694c895969c6e4db06c2cf27ed2be230 /board/sunxi | |
| parent | 46d5ef0416a68e2e7084c5443cf0c76f44593b1a (diff) | |
mtd: rawnand: sunxi: remove usage of struct sunxi_ccm_reg
The sunxi_ccm_reg is legacy, drop its usage from nand related code
For that, CCU_NAND0_CLK_CFG and CCU_AHB_GATE1 are added to the clock
files when missing.
And clock code in sunxi_nand{,_spl}.c and board.c are changed to use the
new scheme.
Moreover, drop AHB_DIV_1 in favor of the more readable CCM_NAND_CTRL_M/N
Suggested-by: Andre Przywara <[email protected]>
Signed-off-by: Richard Genoud <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
Diffstat (limited to 'board/sunxi')
| -rw-r--r-- | board/sunxi/board.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c index e9e3fb9a571..85f20ffe085 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -307,15 +307,16 @@ static void nand_pinmux_setup(void) static void nand_clock_setup(void) { - struct sunxi_ccm_reg *const ccm = - (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; + void * const ccm = (void *)SUNXI_CCM_BASE; - setbits_le32(&ccm->ahb_gate0, (CLK_GATE_OPEN << AHB_GATE_OFFSET_NAND0)); + setbits_le32(ccm + CCU_AHB_GATE0, + (CLK_GATE_OPEN << AHB_GATE_OFFSET_NAND0)); #if defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I || \ defined CONFIG_MACH_SUN9I || defined CONFIG_MACH_SUN50I - setbits_le32(&ccm->ahb_reset0_cfg, (1 << AHB_GATE_OFFSET_NAND0)); + setbits_le32(ccm + CCU_AHB_RESET0_CFG, (1 << AHB_GATE_OFFSET_NAND0)); #endif - setbits_le32(&ccm->nand0_clk_cfg, CCM_NAND_CTRL_ENABLE | AHB_DIV_1); + setbits_le32(ccm + CCU_NAND0_CLK_CFG, CCM_NAND_CTRL_ENABLE | + CCM_NAND_CTRL_N(0) | CCM_NAND_CTRL_M(1)); } void board_nand_init(void) |
