Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions dts/arm/ti/mspm0g1x0x_g3x0x/mspm0g1106.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* SPDX-License-Identifier: Apache-2.0 */

#include <ti/mspm0g1x0x_g3x0x/mspm0g1x0x_g3x0x.dtsi>
#include <ti/mspm0g1x0x_g3x0x/mspm0gxxx6.dtsi>
4 changes: 4 additions & 0 deletions dts/arm/ti/mspm0g1x0x_g3x0x/mspm0g1107.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* SPDX-License-Identifier: Apache-2.0 */

#include <ti/mspm0g1x0x_g3x0x/mspm0g1x0x_g3x0x.dtsi>
#include <ti/mspm0g1x0x_g3x0x/mspm0gxxx7.dtsi>
4 changes: 4 additions & 0 deletions dts/arm/ti/mspm0g1x0x_g3x0x/mspm0g1506.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* SPDX-License-Identifier: Apache-2.0 */

#include <ti/mspm0g1x0x_g3x0x/mspm0g1x0x_g3x0x.dtsi>
#include <ti/mspm0g1x0x_g3x0x/mspm0gxxx6.dtsi>
4 changes: 4 additions & 0 deletions dts/arm/ti/mspm0g1x0x_g3x0x/mspm0g1507.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* SPDX-License-Identifier: Apache-2.0 */

#include <ti/mspm0g1x0x_g3x0x/mspm0g1x0x_g3x0x.dtsi>
#include <ti/mspm0g1x0x_g3x0x/mspm0gxxx7.dtsi>
125 changes: 125 additions & 0 deletions dts/arm/ti/mspm0g1x0x_g3x0x/mspm0g1x0x_g3x0x.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
/* SPDX-License-Identifier: Apache-2.0 */

#include <arm/armv6-m.dtsi>
#include <freq.h>
#include <zephyr/dt-bindings/clock/mspm0_clock.h>
#include <zephyr/dt-bindings/gpio/gpio.h>
#include <zephyr/dt-bindings/i2c/i2c.h>

/ {
cpus {
#address-cells = <1>;
#size-cells = <0>;

cpu0: cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-m0+";
reg = <0>;
};
};

sram0: memory@20200000 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From MSPM0G3507 TRM I see it's 0x20000000

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's two regions here. The 0x2000 is for other G devices which support ECC-corrected SRAM, which is not present on the G3507 currently. (So the TRM would need to be updated to reflect that)

0x2020.0000 is non-corrected SRAM, whereas 0x2010.0000 is Party-checked SRAM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the total usage SRAM is -0x200000 ? or it's only the mapping?

compatible = "mmio-sram";
};

flash0: serial-flash@0 {
compatible = "serial-flash";
};

sysclk: system-clock {
compatible = "fixed-clock";
clock-frequency = <DT_FREQ_M(32)>;
#clock-cells = <0>;
};

clkmux: clock-controller {
compatible = "ti,mspm0-clock-mux";
mclk-div = <1>;
uclk-div = <1>;
#clock-cells = <1>;
};

clocks: clocks {
sysosc: sysosc {
compatible = "ti,mspm0-oscillator";
clock-frequency = <DT_FREQ_M(32)>;
#clock-cells = <0>;
};

lfosc: lfosc {
compatible = "fixed-clock";
clock-frequency = <32678>;
#clock-cells = <0>;
};

pll: pll {
compatible = "ti,mspm0-pll";
clocks = <&sysosc 0>;
p-div = <2>;
q-div = <5>;
clk1-div = <2>;
clk2x-div = <2>;
#clock-cells = <0>;
status = "okay";
};
};

soc {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

pinctrl: pin-controller@400a0000{
compatible = "ti,mspm0-pinctrl";
#address-cells = <1>;
#size-cells = <1>;
reg = <0x400a0000 0x4000>;

gpioa: gpio@400a0000 {
compatible = "ti,mspm0-gpio";
reg = <0x400a0000 0x2000>;
interrupts = <1 0>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the interrupt parent is nvic? interrupt-parent = <&nvic>; ?

status = "disabled";
gpio-controller;
#gpio-cells = <2>;
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

gpiob: gpio@400a2000 {
compatible = "ti,mspm0-gpio";
reg = <0x400a2000 0x2000>;
interrupts = <1 0>;
status = "disabled";
gpio-controller;
#gpio-cells = <2>;
};
};

uart0: uart@40108000 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if am not wrong, dtsi is sort based on address, not by the name here.

compatible = "ti,mspm0-uart";
reg = <0x40108000 0x2000>;
interrupts = <15 0>;
current-speed = <115200>;
clocks = <&clkmux MSPM0_CLOCK_BUS_ULPCLK>;
status = "disabled";
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

uart1: uart@40100000 {
compatible = "ti,mspm0-uart";
reg = <0x40100000 0x2000>;
interrupts = <13 0>;
current-speed = <115200>;
clocks = <&clkmux MSPM0_CLOCK_BUS_ULPCLK>;
status = "disabled";
};

uart2: uart@40102000 {
compatible = "ti,mspm0-uart";
reg = <0x40102000 0x2000>;
interrupts = <14 0>;
current-speed = <115200>;
clocks = <&clkmux MSPM0_CLOCK_BUS_ULPCLK>;
status = "disabled";
};
};
};

&nvic {
arm,num-irq-priority-bits = <2>;
};
4 changes: 4 additions & 0 deletions dts/arm/ti/mspm0g1x0x_g3x0x/mspm0g3106.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* SPDX-License-Identifier: Apache-2.0 */

#include <ti/mspm0g1x0x_g3x0x/mspm0g1x0x_g3x0x.dtsi>
#include <ti/mspm0g1x0x_g3x0x/mspm0gxxx6.dtsi>
4 changes: 4 additions & 0 deletions dts/arm/ti/mspm0g1x0x_g3x0x/mspm0g3107.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* SPDX-License-Identifier: Apache-2.0 */

#include <ti/mspm0g1x0x_g3x0x/mspm0g1x0x_g3x0x.dtsi>
#include <ti/mspm0g1x0x_g3x0x/mspm0gxxx7.dtsi>
4 changes: 4 additions & 0 deletions dts/arm/ti/mspm0g1x0x_g3x0x/mspm0g3506.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* SPDX-License-Identifier: Apache-2.0 */

#include <ti/mspm0g1x0x_g3x0x/mspm0g1x0x_g3x0x.dtsi>
#include <ti/mspm0g1x0x_g3x0x/mspm0gxxx6.dtsi>
4 changes: 4 additions & 0 deletions dts/arm/ti/mspm0g1x0x_g3x0x/mspm0g3507.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* SPDX-License-Identifier: Apache-2.0 */

#include <ti/mspm0g1x0x_g3x0x/mspm0g1x0x_g3x0x.dtsi>
#include <ti/mspm0g1x0x_g3x0x/mspm0gxxx7.dtsi>
14 changes: 14 additions & 0 deletions dts/arm/ti/mspm0g1x0x_g3x0x/mspm0gxxx6.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* SPDX-License-Identifier: Apache-2.0 */

#include <mem.h>
#include <ti/mspm0g1x0x_g3x0x/mspm0g1x0x_g3x0x.dtsi>

/ {
sram0: memory@20200000 {
reg = <0x20200000 DT_SIZE_K(32)>;
};

flash0: serial-flash@0 {
reg = <0x0 DT_SIZE_K(64)>;
};
};
14 changes: 14 additions & 0 deletions dts/arm/ti/mspm0g1x0x_g3x0x/mspm0gxxx7.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* SPDX-License-Identifier: Apache-2.0 */

#include <mem.h>
#include <ti/mspm0g1x0x_g3x0x/mspm0g1x0x_g3x0x.dtsi>

/ {
sram0: memory@20200000 {
reg = <0x20200000 DT_SIZE_K(32)>;
};

flash0: serial-flash@0 {
reg = <0x0 DT_SIZE_K(128)>;
};
};
43 changes: 43 additions & 0 deletions dts/bindings/clock/ti,mspm0-clock-mux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (c) 2024 Texas Instruments Inc.
# SPDX-License-Identifier: Apache-2.0

description: TI MSPM0 Clock Mux

compatible: "ti,mspm0-clock-mux"

include: [clock-controller.yaml, base.yaml]

properties:
"#clock-cells":
const: 1

uclk-div:
type: int
default: 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding description helps

description: |
Divider from MCLK (system clock) to ULPCLK (low power clock). ULPCLK must
be less than or equal to 40 MHz. Valid value is 1 when sourced from SYSOSC
or LFOSC. Valid values are 1 or 2 when sourced from a high speed clock
(such as PLL or external clock).
mclk-div:
type: int
default: 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto, description

description: |
Divider for MCLK (system clock) only when source with SYSOSC with a
frequency value of 4 MHz. Disabled otherwise. Valid values are 1-16.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not addressed

clock-source:
type: phandle
required: true
description: |
Clock Source for the system clock
clock-frequency:
required: true
type: int
description: |
default frequency in Hz for clock output
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
default frequency in Hz for clock output
Default frequency in Hz for clock output

clock-cells:
- bus
13 changes: 13 additions & 0 deletions dts/bindings/clock/ti,mspm0-oscillator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2024 Texas Instruments Inc.
# SPDX-License-Identifier: Apache-2.0

description: TI MSPM0 Oscillator

compatible: "ti,mspm0-oscillator"

include: [fixed-clock.yaml]

properties:
clock-frequency:
type: int
required: true
56 changes: 56 additions & 0 deletions dts/bindings/clock/ti,mspm0-pll.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright (c) 2024 Texas Instruments Inc.
# SPDX-License-Identifier: Apache-2.0

description: TI MSPM0 Phase Locked Loop

compatible: "ti,mspm0-pll"

include: [clock-controller.yaml, base.yaml]

properties:
clocks:
required: true
description: |
Clock reference source

"#clock-cells":
const: 0

p-div:
type: int
required: true
enum:
- 1
- 2
- 4
- 8
description: |
pdiv is the pre-divider of the output. ref_in / pdiv * qdiv = VCO

q-div:
type: int
required: true
description: |
qdiv functions as a multiplier value for the ref_in / pdiv * qdiv = VCO
Valid Range: 2 - 128

clk0-div:
type: int
description: |
CLK0 PLL output is only enabled if the divider is present. Use CLK0 on
the MSPM0 to output to the MCLK, UCLK, and CPUCLK
Valid Range: 1 - 16

clk1-div:
type: int
description: |
CLK1 PLL output is only enabled if the divider is present. Use CLK1 on
the MSPM0 to output to the CANCLK, FCC, or output via EXCLK
Valid Range: 1 - 16

clk2x-div:
type: int
description: |
CLK2X PLL output is only enabled if the divider is present. Use CLK2X on
the MSPM0 to output to the MCLK, UCLK, and CPUCLK instead of CLK0
Valid Range: 1 - 16
33 changes: 33 additions & 0 deletions include/zephyr/dt-bindings/clock/mspm0_clock.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2024 Texas Instruments Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_MSPM0_CLOCK_H
#define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_MSPM0_CLOCK_H

/* Clock bus references */
#define MSPM0_CLOCK_BUS_BUSCLK

#define MSPM0_CLOCK_BUS_LFCLK (0x02)
#define MSPM0_CLOCK_BUS_MFCLK (0x04)
#define MSPM0_CLOCK_BUS_ULPCLK (0x18)
#define MSPM0_CLOCK_BUS_MCLK (0x28)
#define MSPM0_CLOCK_BUS_MFPCLK (0x50)
#define MSPM0_CLOCK_BUS_CANCLK (0x51)

#define MSPM0_CLOCK_SEL_MASK (0x0E)

#define MSPM0_CLOCK_PRESCALE_DIV_1 (0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these prescale values aren't used.

#define MSPM0_CLOCK_PRESCALE_DIV_2 (1)
#define MSPM0_CLOCK_PRESCALE_DIV_3 (2)
#define MSPM0_CLOCK_PRESCALE_DIV_4 (3)
#define MSPM0_CLOCK_PRESCALE_DIV_5 (4)
#define MSPM0_CLOCK_PRESCALE_DIV_6 (5)
#define MSPM0_CLOCK_PRESCALE_DIV_7 (6)
#define MSPM0_CLOCK_PRESCALE_DIV_8 (7)

#define MSPM0_PRESCALE_MASK 0x07

#endif
30 changes: 30 additions & 0 deletions include/zephyr/dt-bindings/pinctrl/mspm0-pinctrl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2024 Texas Instruments
*
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef _MSPM0_DT_BINDINGS_PINCTRL_H_
#define _MSPM0_DT_BINDINGS_PINCTRL_H_

#define MSP_PORT_INDEX_BY_NAME(x) ((x == "PORTA") ? 0 : 1)

/* creates a concatination of the correct pin function based on the CM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* creates a concatination of the correct pin function based on the CM
/*
* Creates a concatination of the correct pin function based on the CM

* and the function suffix. Will evaluate to the pin function number above.
*/

#define MSPM0_PIN_FUNCTION_ANALOG (0x00000000)
#define MSPM0_PIN_FUNCTION_GPIO (0x00000001)
#define MSPM0_PIN_FUNCTION_2 (0x00000002)
#define MSPM0_PIN_FUNCTION_3 (0x00000003)
#define MSPM0_PIN_FUNCTION_4 (0x00000004)
#define MSPM0_PIN_FUNCTION_5 (0x00000005)
#define MSPM0_PIN_FUNCTION_6 (0x00000006)
#define MSPM0_PIN_FUNCTION_7 (0x00000007)
#define MSPM0_PIN_FUNCTION_8 (0x00000008)
#define MSPM0_PIN_FUNCTION_9 (0x00000009)
#define MSPM0_PIN_FUNCTION_10 (0x0000000A)

#define MSP_PINMUX(pincm, function) (((pincm - 1) << 0x10) | function)

#endif