Skip to content

Commit e19c303

Browse files
Wren6991popcornmix
authored andcommitted
Add SMI driver
Signed-off-by: Luke Wren <wren6991@gmail.com>
1 parent 1ee3b49 commit e19c303

File tree

9 files changed

+1861
-1
lines changed

9 files changed

+1861
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
* Broadcom BCM2835 SMI character device driver.
2+
3+
SMI or secondary memory interface is a peripheral specific to certain Broadcom
4+
SOCs, and is helpful for talking to things like parallel-interface displays
5+
and NAND flashes (in fact, most things with a parallel register interface).
6+
7+
This driver adds a character device which provides a user-space interface to
8+
an instance of the SMI driver.
9+
10+
Required properties:
11+
- compatible: "brcm,bcm2835-smi-dev"
12+
- smi_handle: a phandle to the smi node.
13+
14+
Optional properties:
15+
- None.
16+
17+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
* Broadcom BCM2835 SMI driver.
2+
3+
SMI or secondary memory interface is a peripheral specific to certain Broadcom
4+
SOCs, and is helpful for talking to things like parallel-interface displays
5+
and NAND flashes (in fact, most things with a parallel register interface).
6+
7+
Required properties:
8+
- compatible: "brcm,bcm2835-smi"
9+
- reg: Should contain location and length of SMI registers and SMI clkman regs
10+
- interrupts: *the* SMI interrupt.
11+
- pinctrl-names: should be "default".
12+
- pinctrl-0: the phandle of the gpio pin node.
13+
- brcm,smi-clock-source: the clock source for clkman
14+
- brcm,smi-clock-divisor: the integer clock divisor for clkman
15+
- dmas: the dma controller phandle and the DREQ number (4 on a 2835)
16+
- dma-names: the name used by the driver to request its channel.
17+
Should be "rx-tx".
18+
19+
Optional properties:
20+
- None.
21+
22+
Examples:
23+
24+
8 data pin configuration:
25+
26+
smi: smi@7e600000 {
27+
compatible = "brcm,bcm2835-smi";
28+
reg = <0x7e600000 0x44>, <0x7e1010b0 0x8>;
29+
interrupts = <2 16>;
30+
pinctrl-names = "default";
31+
pinctrl-0 = <&smi_pins>;
32+
brcm,smi-clock-source = <6>;
33+
brcm,smi-clock-divisor = <4>;
34+
dmas = <&dma 4>;
35+
dma-names = "rx-tx";
36+
37+
status = "okay";
38+
};
39+
40+
smi_pins: smi_pins {
41+
brcm,pins = <2 3 4 5 6 7 8 9 10 11 12 13 14 15>;
42+
/* Alt 1: SMI */
43+
brcm,function = <5 5 5 5 5 5 5 5 5 5 5 5 5 5>;
44+
/* /CS, /WE and /OE are pulled high, as they are
45+
generally active low signals */
46+
brcm,pull = <2 2 2 2 2 2 0 0 0 0 0 0 0 0>;
47+
};
48+

drivers/char/broadcom/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,11 @@ config BCM2835_DEVGPIOMEM
4141
on the 2835. Calling mmap(/dev/gpiomem) will map the GPIO
4242
register page to the user's pointer.
4343

44+
config BCM2835_SMI_DEV
45+
tristate "Character device driver for BCM2835 Secondary Memory Interface"
46+
depends on (MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835) && BCM2835_SMI
47+
default m
48+
help
49+
This driver provides a character device interface (ioctl + read/write) to
50+
Broadcom's Secondary Memory interface. The low-level functionality is provided
51+
by the SMI driver itself.

drivers/char/broadcom/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o
33
obj-$(CONFIG_BCM_VC_SM) += vc_sm/
44

55
obj-$(CONFIG_BCM2835_DEVGPIOMEM)+= bcm2835-gpiomem.o
6-
6+
obj-$(CONFIG_BCM2835_SMI_DEV) += bcm2835_smi_dev.o

0 commit comments

Comments
 (0)