Skip to content

Commit

Permalink
clk: bcm2835: Add BCM2711_CLOCK_EMMC2 support
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
lategoodbye committed Sep 21, 2019
1 parent 1ba6b13 commit 3014bfa
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/arm/boot/dts/bcm2838.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
compatible = "brcm,bcm2711-emmc2";
status = "okay";
interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clocks BCM2711_CLOCK_EMMC2>;
reg = <0x7e340000 0x100>;
};

Expand Down
20 changes: 19 additions & 1 deletion drivers/clk/bcm/clk-bcm2835.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
#define CM_AVEODIV 0x1bc
#define CM_EMMCCTL 0x1c0
#define CM_EMMCDIV 0x1c4
#define CM_EMMC2CTL 0x1d0
#define CM_EMMC2DIV 0x1d4

/* General bits for the CM_*CTL regs */
# define CM_ENABLE BIT(4)
Expand Down Expand Up @@ -302,7 +304,8 @@
#define VCMSG_ID_CORE_CLOCK 4

#define SOC_BCM2835 BIT(0)
#define SOC_ALL (SOC_BCM2835)
#define SOC_BCM2711 BIT(1)
#define SOC_ALL (SOC_BCM2835 | SOC_BCM2711)

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

/* EMMC2 clock (only available for BCM2711) */
[BCM2711_CLOCK_EMMC2] = REGISTER_PER_CLK(
SOC_BCM2711,
.name = "emmc2",
.ctl_reg = CM_EMMC2CTL,
.div_reg = CM_EMMC2DIV,
.int_bits = 4,
.frac_bits = 8,
.tcnt_mux = 42),

/* General purpose (GPIO) clocks */
[BCM2835_CLOCK_GP0] = REGISTER_PER_CLK(
SOC_ALL,
Expand Down Expand Up @@ -2376,8 +2389,13 @@ static const struct cprman_plat_data cprman_bcm2835_plat_data = {
.soc = SOC_BCM2835,
};

static const struct cprman_plat_data cprman_bcm2711_plat_data = {
.soc = SOC_BCM2711,
};

static const struct of_device_id bcm2835_clk_of_match[] = {
{ .compatible = "brcm,bcm2835-cprman", .data = &cprman_bcm2835_plat_data },
{ .compatible = "brcm,bcm2711-cprman", .data = &cprman_bcm2711_plat_data },
{}
};
MODULE_DEVICE_TABLE(of, bcm2835_clk_of_match);
Expand Down
2 changes: 2 additions & 0 deletions include/dt-bindings/clock/bcm2835.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@
#define BCM2835_CLOCK_DSI1E 48
#define BCM2835_CLOCK_DSI0P 49
#define BCM2835_CLOCK_DSI1P 50

#define BCM2711_CLOCK_EMMC2 51

0 comments on commit 3014bfa

Please sign in to comment.