Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions arch/riscv/boot/dts/bouffalolab/bl808-pine64-ox64.dts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,24 @@

&pinctrl {
status = "okay";

i2c_2_pins: i2c-pins {
pins = "GPIO6", "GPIO7";
function = "i2c2";
};
};

&seceng {
status = "okay";
};

&i2c2 {
status = "okay";

pinctrl-0 = <&i2c_2_pins>;
pinctrl-names = "default";
};

&uart0 {
status = "okay";
};
Expand Down
12 changes: 12 additions & 0 deletions arch/riscv/boot/dts/bouffalolab/bl808-sipeed-m1s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,24 @@
pins = "GPIO8";
function = "gpio";
};

i2c_2_pins: i2c-pins {
pins = "GPIO6", "GPIO7";
function = "i2c2";
};
};

&seceng {
status = "okay";
};

&i2c2 {
status = "okay";

pinctrl-0 = <&i2c_2_pins>;
pinctrl-names = "default";
};

&uart0 {
status = "okay";
};
Expand Down
56 changes: 56 additions & 0 deletions arch/riscv/boot/dts/bouffalolab/bl808.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@
#clock-cells = <0>;
};

rc32m: rc32m-clk {
compatible = "fixed-clock";
clock-frequency = <32000000>;
clock-output-names = "rc32m";
#clock-cells = <0>;
};

mm_b: mm_bclk1x {
compatible = "fixed-clock";
clock-frequency = <160000000>;
clock-output-names = "mm_b";
#clock-cells = <0>;
};

enet: enet-clk {
compatible = "fixed-clock";
clock-frequency = <50000000>;
Expand Down Expand Up @@ -95,6 +109,48 @@
reg = <0x20004000 0x1000>;
status = "disabled";
};

i2c0: i2c@2000A300 {
compatible = "bflb,bl808-i2c";
reg = <0x2000A300 0x0100>;
interrupts-extended = <&ipclic BFLB_IPC_SOURCE_M0
BFLB_IPC_DEVICE_I2C0
IRQ_TYPE_EDGE_RISING>;
mboxes = <&ipclic BFLB_IPC_SOURCE_M0 BFLB_IPC_DEVICE_I2C0>;
clocks = <&rc32m>;
clock-frequency = <400000>;
status = "disabled";
};

i2c1: i2c@2000A900 {
compatible = "bflb,bl808-i2c";
reg = <0x2000A900 0x0100>;
interrupts-extended = <&ipclic BFLB_IPC_SOURCE_M0
BFLB_IPC_DEVICE_I2C1
IRQ_TYPE_EDGE_RISING>;
mboxes = <&ipclic BFLB_IPC_SOURCE_M0 BFLB_IPC_DEVICE_I2C1>;
clocks = <&rc32m>;
clock-frequency = <400000>;
status = "disabled";
};

i2c2: i2c@30003000 {
compatible = "bflb,bl808-i2c";
reg = <0x30003000 0x1000>;
interrupts = <21 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mm_b>;
clock-frequency = <400000>;
status = "disabled";
};

i2c3: i2c@30004000 {
compatible = "bflb,bl808-i2c";
reg = <0x30004000 0x1000>;
interrupts = <22 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mm_b>;
clock-frequency = <400000>;
status = "disabled";
};

uart0: serial@30002000 {
/*Maps to hardware UART 3*/
Expand Down
5 changes: 1 addition & 4 deletions arch/riscv/configs/bl808_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,9 @@ CONFIG_HW_RANDOM=y
CONFIG_HW_RANDOM_VIRTIO=y
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_XILINX=y
CONFIG_I2C_BL808=y
CONFIG_I2C_SLAVE=y
CONFIG_I2C_SLAVE_EEPROM=y
CONFIG_I2C_DEBUG_CORE=y
CONFIG_I2C_DEBUG_ALGO=y
CONFIG_I2C_DEBUG_BUS=y
# CONFIG_PTP_1588_CLOCK is not set
CONFIG_PINCTRL=y
CONFIG_PINCTRL_BFLB_GPIO=y
Expand Down
10 changes: 10 additions & 0 deletions drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,16 @@ config I2C_RCAR
This driver can also be built as a module. If so, the module
will be called i2c-rcar.

config I2C_BL808
tristate "Bouffalo Lab BL808 I2C driver"
depends on SOC_BOUFFALOLAB
help
This driver provides support for the I2C bus
hardware found on Bouffalo Lab BL808 SoCs.

To compile this driver as a module, choose M here. The
module will be called i2c-bl808. If unsure, say N.

comment "External I2C/SMBus adapter drivers"

config I2C_DIOLAN_U2C
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/busses/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ obj-$(CONFIG_I2C_AU1550) += i2c-au1550.o
obj-$(CONFIG_I2C_AXXIA) += i2c-axxia.o
obj-$(CONFIG_I2C_BCM2835) += i2c-bcm2835.o
obj-$(CONFIG_I2C_BCM_IPROC) += i2c-bcm-iproc.o
obj-$(CONFIG_I2C_BL808) += i2c-bl808.o
obj-$(CONFIG_I2C_CADENCE) += i2c-cadence.o
obj-$(CONFIG_I2C_CBUS_GPIO) += i2c-cbus-gpio.o
obj-$(CONFIG_I2C_CPM) += i2c-cpm.o
Expand Down
Loading