Skip to content

Commit 22ffba5

Browse files
AlessandroLuokartben
authored andcommitted
drivers: ambiq: Add spi/i2c support for apollo510
This commit adds spi and i2c support for apollo510 Signed-off-by: Hao Luo <hluo@ambiq.com>
1 parent 389103d commit 22ffba5

File tree

3 files changed

+297
-0
lines changed

3 files changed

+297
-0
lines changed

boards/ambiq/apollo510_evb/apollo510_evb-pinctrl.dtsi

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,123 @@
2424
};
2525
};
2626

27+
i2c0_default: i2c0_default {
28+
group1 {
29+
pinmux = <M0SCL_P5>, <M0SDAWIR3_P6>;
30+
drive-open-drain;
31+
drive-strength = "0.5";
32+
bias-pull-up;
33+
};
34+
};
35+
36+
i2c1_default: i2c1_default {
37+
group1 {
38+
pinmux = <M1SCL_P8>, <M1SDAWIR3_P9>;
39+
drive-open-drain;
40+
drive-strength = "0.5";
41+
bias-pull-up;
42+
};
43+
};
44+
45+
i2c2_default: i2c2_default {
46+
group1 {
47+
pinmux = <M2SCL_P25>, <M2SDAWIR3_P26>;
48+
drive-open-drain;
49+
drive-strength = "0.5";
50+
bias-pull-up;
51+
};
52+
};
53+
54+
i2c3_default: i2c3_default {
55+
group1 {
56+
pinmux = <M3SCL_P31>, <M3SDAWIR3_P32>;
57+
drive-open-drain;
58+
drive-strength = "0.5";
59+
bias-pull-up;
60+
};
61+
};
62+
63+
i2c5_default: i2c5_default {
64+
group1 {
65+
pinmux = <M5SCL_P47>, <M5SDAWIR3_P48>;
66+
drive-open-drain;
67+
drive-strength = "0.5";
68+
bias-pull-up;
69+
};
70+
};
71+
72+
i2c6_default: i2c6_default {
73+
group1 {
74+
pinmux = <M6SCL_P61>, <M6SDAWIR3_P62>;
75+
drive-open-drain;
76+
drive-strength = "0.5";
77+
bias-pull-up;
78+
};
79+
};
80+
81+
i2c7_default: i2c7_default {
82+
group1 {
83+
pinmux = <M7SCL_P22>, <M7SDAWIR3_P23>;
84+
drive-open-drain;
85+
drive-strength = "0.5";
86+
bias-pull-up;
87+
};
88+
};
89+
90+
spid0_default: spid0_default {
91+
group1 {
92+
pinmux = <SLSCK_P11>, <SLMISO_P83>, <SLMOSI_P52>, <SLnCE_P13>;
93+
};
94+
};
95+
96+
spi0_default: spi0_default {
97+
group1 {
98+
pinmux = <M0SCK_P5>, <M0MISO_P7>, <M0MOSI_P6>;
99+
};
100+
};
101+
102+
spi1_default: spi1_default {
103+
group1 {
104+
pinmux = <M1SCK_P8>, <M1MISO_P10>, <M1MOSI_P9>;
105+
};
106+
};
107+
108+
spi2_default: spi2_default {
109+
group1 {
110+
pinmux = <M2SCK_P25>, <M2MISO_P27>, <M2MOSI_P26>;
111+
};
112+
};
113+
114+
spi3_default: spi3_default {
115+
group1 {
116+
pinmux = <M3SCK_P31>, <M3MISO_P33>, <M3MOSI_P32>;
117+
};
118+
};
119+
120+
spi4_default: spi4_default {
121+
group1 {
122+
pinmux = <M4SCK_P34>, <M4MISO_P36>, <M4MOSI_P35>;
123+
};
124+
};
125+
126+
spi5_default: spi5_default {
127+
group1 {
128+
pinmux = <M5SCK_P47>, <M5MISO_P49>, <M5MOSI_P48>;
129+
};
130+
};
131+
132+
spi6_default: spi6_default {
133+
group1 {
134+
pinmux = <M6SCK_P61>, <M6MISO_P63>, <M6MOSI_P62>;
135+
};
136+
};
137+
138+
spi7_default: spi7_default {
139+
group1 {
140+
pinmux = <M7SCK_P22>, <M7MISO_P24>, <M7MOSI_P23>;
141+
};
142+
};
143+
27144
mspi0_default: mspi0_default {
28145
group0 {
29146
pinmux = <MSPI0_0_P64>,

boards/ambiq/apollo510_evb/apollo510_evb.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ supported:
1212
- watchdog
1313
- counter
1414
- gpio
15+
- spi
16+
- i2c
1517
- rtc
1618
- clock_control
1719
- mspi

dts/arm/ambiq/ambiq_apollo510.dtsi

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,184 @@
291291
status = "disabled";
292292
};
293293

294+
spid0: spi@IOSLAVE_BASE_NAME {
295+
compatible = "ambiq,spid";
296+
reg = <IOSLAVE_REG_BASE IOSLAVE_REG_SIZE>;
297+
#address-cells = <1>;
298+
#size-cells = <0>;
299+
interrupts = <4 0>;
300+
status = "disabled";
301+
zephyr,pm-device-runtime-auto;
302+
};
303+
304+
iom0: iom@IOM0_BASE_NAME {
305+
compatible = "ambiq,iom";
306+
reg = <IOM0_REG_BASE IOM0_REG_SIZE>;
307+
interrupts = <6 0>;
308+
309+
spi {
310+
compatible = "ambiq,spi";
311+
#address-cells = <1>;
312+
#size-cells = <0>;
313+
status = "disabled";
314+
zephyr,pm-device-runtime-auto;
315+
};
316+
i2c {
317+
compatible = "ambiq,i2c";
318+
#address-cells = <1>;
319+
#size-cells = <0>;
320+
status = "disabled";
321+
zephyr,pm-device-runtime-auto;
322+
};
323+
};
324+
325+
iom1: iom@IOM1_BASE_NAME {
326+
compatible = "ambiq,iom";
327+
reg = <IOM1_REG_BASE IOM1_REG_SIZE>;
328+
interrupts = <7 0>;
329+
330+
spi {
331+
compatible = "ambiq,spi";
332+
#address-cells = <1>;
333+
#size-cells = <0>;
334+
status = "disabled";
335+
zephyr,pm-device-runtime-auto;
336+
};
337+
i2c {
338+
compatible = "ambiq,i2c";
339+
#address-cells = <1>;
340+
#size-cells = <0>;
341+
status = "disabled";
342+
zephyr,pm-device-runtime-auto;
343+
};
344+
};
345+
346+
iom2: iom@IOM2_BASE_NAME {
347+
compatible = "ambiq,iom";
348+
reg = <IOM2_REG_BASE IOM2_REG_SIZE>;
349+
interrupts = <8 0>;
350+
351+
spi {
352+
compatible = "ambiq,spi";
353+
#address-cells = <1>;
354+
#size-cells = <0>;
355+
status = "disabled";
356+
zephyr,pm-device-runtime-auto;
357+
};
358+
i2c {
359+
compatible = "ambiq,i2c";
360+
#address-cells = <1>;
361+
#size-cells = <0>;
362+
status = "disabled";
363+
zephyr,pm-device-runtime-auto;
364+
};
365+
};
366+
367+
iom3: iom@IOM3_BASE_NAME {
368+
compatible = "ambiq,iom";
369+
reg = <IOM3_REG_BASE IOM3_REG_SIZE>;
370+
interrupts = <9 0>;
371+
372+
spi {
373+
compatible = "ambiq,spi";
374+
#address-cells = <1>;
375+
#size-cells = <0>;
376+
status = "disabled";
377+
zephyr,pm-device-runtime-auto;
378+
};
379+
i2c {
380+
compatible = "ambiq,i2c";
381+
#address-cells = <1>;
382+
#size-cells = <0>;
383+
status = "disabled";
384+
zephyr,pm-device-runtime-auto;
385+
};
386+
};
387+
388+
iom4: iom@IOM4_BASE_NAME {
389+
compatible = "ambiq,iom";
390+
reg = <IOM4_REG_BASE IOM4_REG_SIZE>;
391+
interrupts = <10 0>;
392+
393+
spi {
394+
compatible = "ambiq,spi";
395+
#address-cells = <1>;
396+
#size-cells = <0>;
397+
status = "disabled";
398+
zephyr,pm-device-runtime-auto;
399+
};
400+
i2c {
401+
compatible = "ambiq,i2c";
402+
#address-cells = <1>;
403+
#size-cells = <0>;
404+
status = "disabled";
405+
zephyr,pm-device-runtime-auto;
406+
};
407+
};
408+
409+
iom5: iom@IOM5_BASE_NAME {
410+
compatible = "ambiq,iom";
411+
reg = <IOM5_REG_BASE IOM5_REG_SIZE>;
412+
interrupts = <11 0>;
413+
414+
spi {
415+
compatible = "ambiq,spi";
416+
#address-cells = <1>;
417+
#size-cells = <0>;
418+
status = "disabled";
419+
zephyr,pm-device-runtime-auto;
420+
};
421+
i2c {
422+
compatible = "ambiq,i2c";
423+
#address-cells = <1>;
424+
#size-cells = <0>;
425+
status = "disabled";
426+
zephyr,pm-device-runtime-auto;
427+
};
428+
};
429+
430+
iom6: iom@IOM6_BASE_NAME {
431+
compatible = "ambiq,iom";
432+
reg = <IOM6_REG_BASE IOM6_REG_SIZE>;
433+
interrupts = <12 0>;
434+
435+
spi {
436+
compatible = "ambiq,spi";
437+
#address-cells = <1>;
438+
#size-cells = <0>;
439+
status = "disabled";
440+
zephyr,pm-device-runtime-auto;
441+
};
442+
i2c {
443+
compatible = "ambiq,i2c";
444+
#address-cells = <1>;
445+
#size-cells = <0>;
446+
status = "disabled";
447+
zephyr,pm-device-runtime-auto;
448+
};
449+
};
450+
451+
iom7: iom@IOM7_BASE_NAME {
452+
compatible = "ambiq,iom";
453+
reg = <IOM7_REG_BASE IOM7_REG_SIZE>;
454+
interrupts = <13 0>;
455+
456+
spi {
457+
compatible = "ambiq,spi";
458+
#address-cells = <1>;
459+
#size-cells = <0>;
460+
status = "disabled";
461+
zephyr,pm-device-runtime-auto;
462+
};
463+
i2c {
464+
compatible = "ambiq,i2c";
465+
#address-cells = <1>;
466+
#size-cells = <0>;
467+
status = "disabled";
468+
zephyr,pm-device-runtime-auto;
469+
};
470+
};
471+
294472
uart0: uart@UART0_BASE_NAME {
295473
compatible = "ambiq,uart", "arm,pl011";
296474
reg = <UART0_REG_BASE UART0_REG_SIZE>;

0 commit comments

Comments
 (0)