|
| 1 | +/* |
| 2 | + * Copyright (c) 2023-2024 Analog Devices, Inc. |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + */ |
| 6 | + |
| 7 | +#include <mem.h> |
| 8 | +#include <zephyr/dt-bindings/gpio/gpio.h> |
| 9 | +#include <zephyr/dt-bindings/clock/adi_max32_clock.h> |
| 10 | + |
| 11 | +#include <freq.h> |
| 12 | + |
| 13 | +/ { |
| 14 | + chosen { |
| 15 | + zephyr,flash-controller = &flc0; |
| 16 | + }; |
| 17 | + |
| 18 | + cpus { |
| 19 | + #address-cells = <1>; |
| 20 | + #size-cells = <0>; |
| 21 | + |
| 22 | + cpu0: cpu@0 { |
| 23 | + device_type = "cpu"; |
| 24 | + compatible = "arm,cortex-m4f"; |
| 25 | + reg = <0>; |
| 26 | + }; |
| 27 | + }; |
| 28 | + |
| 29 | + clocks { |
| 30 | + clk_ipo: clk_ipo { |
| 31 | + compatible = "fixed-clock"; |
| 32 | + #clock-cells = <0>; |
| 33 | + clock-frequency = <DT_FREQ_M(100)>; |
| 34 | + status = "disabled"; |
| 35 | + }; |
| 36 | + |
| 37 | + clk_iso: clk_iso { |
| 38 | + compatible = "fixed-clock"; |
| 39 | + #clock-cells = <0>; |
| 40 | + clock-frequency = <DT_FREQ_M(60)>; |
| 41 | + status = "disabled"; |
| 42 | + }; |
| 43 | + |
| 44 | + clk_inro: clk_inro { |
| 45 | + compatible = "fixed-clock"; |
| 46 | + #clock-cells = <0>; |
| 47 | + clock-frequency = <DT_FREQ_K(8)>; |
| 48 | + status = "disabled"; |
| 49 | + }; |
| 50 | + |
| 51 | + clk_ibro: clk_ibro { |
| 52 | + compatible = "fixed-clock"; |
| 53 | + #clock-cells = <0>; |
| 54 | + clock-frequency = <7372800>; |
| 55 | + status = "disabled"; |
| 56 | + }; |
| 57 | + |
| 58 | + clk_ertco: clk_ertco { |
| 59 | + compatible = "fixed-clock"; |
| 60 | + #clock-cells = <0>; |
| 61 | + clock-frequency = <32768>; |
| 62 | + status = "disabled"; |
| 63 | + }; |
| 64 | + |
| 65 | + clk_erfo: clk_erfo { |
| 66 | + compatible = "fixed-clock"; |
| 67 | + #clock-cells = <0>; |
| 68 | + clock-frequency = <DT_FREQ_M(32)>; |
| 69 | + status = "disabled"; |
| 70 | + }; |
| 71 | + }; |
| 72 | + |
| 73 | + soc { |
| 74 | + sram0: memory@20000000 { |
| 75 | + compatible = "mmio-sram"; |
| 76 | + reg = <0x20000000 DT_SIZE_K(32)>; |
| 77 | + }; |
| 78 | + |
| 79 | + flc0: flash_controller@40029000 { |
| 80 | + compatible = "flash-controller"; |
| 81 | + reg = <0x40029000 0x400>; |
| 82 | + |
| 83 | + #address-cells = <1>; |
| 84 | + #size-cells = <1>; |
| 85 | + status = "okay"; |
| 86 | + |
| 87 | + flash0: flash@10000000 { |
| 88 | + compatible = "soc-nv-flash"; |
| 89 | + reg = <0x10000000 DT_SIZE_K(512)>; |
| 90 | + write-block-size = <16>; |
| 91 | + erase-block-size = <8192>; |
| 92 | + }; |
| 93 | + }; |
| 94 | + |
| 95 | + gcr: clock-controller@40000000 { |
| 96 | + reg = <0x40000000 0x400>; |
| 97 | + compatible = "adi,max32-gcr"; |
| 98 | + #clock-cells = <2>; |
| 99 | + clocks = <&clk_ipo>; |
| 100 | + sysclk-prescaler = <1>; |
| 101 | + status = "okay"; |
| 102 | + }; |
| 103 | + |
| 104 | + pinctrl: pin-controller@40008000 { |
| 105 | + compatible = "adi,max32-pinctrl"; |
| 106 | + #address-cells = <1>; |
| 107 | + #size-cells = <1>; |
| 108 | + reg = <0x40008000 0x2000>; |
| 109 | + |
| 110 | + gpio0: gpio@40008000 { |
| 111 | + reg = <0x40008000 0x1000>; |
| 112 | + compatible = "adi,max32-gpio"; |
| 113 | + gpio-controller; |
| 114 | + #gpio-cells = <2>; |
| 115 | + clocks = <&gcr ADI_MAX32_CLOCK_BUS0 0>; |
| 116 | + interrupts = <24 0>; |
| 117 | + status = "disabled"; |
| 118 | + }; |
| 119 | + |
| 120 | + gpio1: gpio@40009000 { |
| 121 | + reg = <0x40009000 0x1000>; |
| 122 | + compatible = "adi,max32-gpio"; |
| 123 | + gpio-controller; |
| 124 | + #gpio-cells = <2>; |
| 125 | + interrupts = <25 0>; |
| 126 | + clocks = <&gcr ADI_MAX32_CLOCK_BUS0 1>; |
| 127 | + status = "disabled"; |
| 128 | + }; |
| 129 | + }; |
| 130 | + |
| 131 | + uart0: serial@40042000 { |
| 132 | + compatible = "adi,max32-uart"; |
| 133 | + reg = <0x40042000 0x1000>; |
| 134 | + clocks = <&gcr ADI_MAX32_CLOCK_BUS0 9>; |
| 135 | + clock-source = <ADI_MAX32_PRPH_CLK_SRC_PCLK>; |
| 136 | + interrupts = <14 0>; |
| 137 | + status = "disabled"; |
| 138 | + }; |
| 139 | + |
| 140 | + uart1: serial@40043000 { |
| 141 | + compatible = "adi,max32-uart"; |
| 142 | + reg = <0x40043000 0x1000>; |
| 143 | + clocks = <&gcr ADI_MAX32_CLOCK_BUS0 10>; |
| 144 | + clock-source = <ADI_MAX32_PRPH_CLK_SRC_PCLK>; |
| 145 | + interrupts = <15 0>; |
| 146 | + status = "disabled"; |
| 147 | + }; |
| 148 | + |
| 149 | + uart2: serial@40044000 { |
| 150 | + compatible = "adi,max32-uart"; |
| 151 | + reg = <0x40044000 0x1000>; |
| 152 | + clocks = <&gcr ADI_MAX32_CLOCK_BUS1 1>; |
| 153 | + clock-source = <ADI_MAX32_PRPH_CLK_SRC_PCLK>; |
| 154 | + interrupts = <34 0>; |
| 155 | + status = "disabled"; |
| 156 | + }; |
| 157 | + }; |
| 158 | +}; |
| 159 | + |
| 160 | +&nvic { |
| 161 | + arm,num-irq-priority-bits = <3>; |
| 162 | +}; |
0 commit comments