Skip to content

Commit e002c2d

Browse files
committed
clk: bcm2835: Add BCM2711_CLOCK_EMMC2 support
commit 42de9ad upstream. The new BCM2711 supports an additional clock for the emmc2 block. So add a new compatible and register this clock only for BCM2711. Signed-off-by: Stefan Wahren <[email protected]> Reviewed-by: Matthias Brugger <[email protected]> Acked-by: Eric Anholt <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
1 parent 9e1e710 commit e002c2d

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

arch/arm/boot/dts/bcm2838.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@
210210
compatible = "brcm,bcm2711-emmc2";
211211
status = "okay";
212212
interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>;
213+
clocks = <&clocks BCM2711_CLOCK_EMMC2>;
213214
reg = <0x7e340000 0x100>;
214215
};
215216

drivers/clk/bcm/clk-bcm2835.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@
124124
#define CM_AVEODIV 0x1bc
125125
#define CM_EMMCCTL 0x1c0
126126
#define CM_EMMCDIV 0x1c4
127+
#define CM_EMMC2CTL 0x1d0
128+
#define CM_EMMC2DIV 0x1d4
127129

128130
/* General bits for the CM_*CTL regs */
129131
# define CM_ENABLE BIT(4)
@@ -302,7 +304,8 @@
302304
#define VCMSG_ID_CORE_CLOCK 4
303305

304306
#define SOC_BCM2835 BIT(0)
305-
#define SOC_ALL (SOC_BCM2835)
307+
#define SOC_BCM2711 BIT(1)
308+
#define SOC_ALL (SOC_BCM2835 | SOC_BCM2711)
306309

307310
/*
308311
* Names of clocks used within the driver that need to be replaced
@@ -2102,6 +2105,16 @@ static const struct bcm2835_clk_desc clk_desc_array[] = {
21022105
.frac_bits = 8,
21032106
.tcnt_mux = 39),
21042107

2108+
/* EMMC2 clock (only available for BCM2711) */
2109+
[BCM2711_CLOCK_EMMC2] = REGISTER_PER_CLK(
2110+
SOC_BCM2711,
2111+
.name = "emmc2",
2112+
.ctl_reg = CM_EMMC2CTL,
2113+
.div_reg = CM_EMMC2DIV,
2114+
.int_bits = 4,
2115+
.frac_bits = 8,
2116+
.tcnt_mux = 42),
2117+
21052118
/* General purpose (GPIO) clocks */
21062119
[BCM2835_CLOCK_GP0] = REGISTER_PER_CLK(
21072120
SOC_ALL,
@@ -2376,8 +2389,13 @@ static const struct cprman_plat_data cprman_bcm2835_plat_data = {
23762389
.soc = SOC_BCM2835,
23772390
};
23782391

2392+
static const struct cprman_plat_data cprman_bcm2711_plat_data = {
2393+
.soc = SOC_BCM2711,
2394+
};
2395+
23792396
static const struct of_device_id bcm2835_clk_of_match[] = {
23802397
{ .compatible = "brcm,bcm2835-cprman", .data = &cprman_bcm2835_plat_data },
2398+
{ .compatible = "brcm,bcm2711-cprman", .data = &cprman_bcm2711_plat_data },
23812399
{}
23822400
};
23832401
MODULE_DEVICE_TABLE(of, bcm2835_clk_of_match);

include/dt-bindings/clock/bcm2835.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,5 @@
6666
#define BCM2835_CLOCK_DSI1E 48
6767
#define BCM2835_CLOCK_DSI0P 49
6868
#define BCM2835_CLOCK_DSI1P 50
69+
70+
#define BCM2711_CLOCK_EMMC2 51

0 commit comments

Comments
 (0)