Skip to contentSkip to conversation

k3-am62-pocketbeagle2: add board and variant support

PATCH Superseded [email protected] 4 participants 14 messages Jun 19 – Jun 25

Subsystems (2)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover k3-am62-pocketbeagle2: add board and variant support

From: Randolph Sapp <[email protected]>

Add initial board support for the PocketBeagle 2 from BeagleBoard.org. This is based on the current official series from Robert Nelson [1] and work from Bryan Brattlof [2] with some light modifications to protect against certain configurations changes.

This borrows a lot from Phytec's current DDR fixup logic, as that seems to be the most complete implementation of a dynamic DDR correction for K3 in tree currently. Thanks Wadim Egorov and Dominik Haller for setting that up.

Now that the various memory issues have been resolved we can clearly see at runtime that there's an issue with the current device. One of our reservations overlaps with the u-boot stack. To get around this we'll need to change the relocation address to something we know will not collide.

[1] https://github.com/beagleboard/u-boot/tree/v2026.01-am62-pocketbeagle2
[2] https://github.com/bryanbrattlof/beagleboot/tree/b4/pb2i

Bryan Brattlof (1):
arm: mach-k3: am62: add &main_uart6 to clock and pwr tree

Randolph Sapp (4):
board_f: add a board_setup_dest_addr function
k3-am62-pocketbeagle2: add initial board support
k3-am62-pocketbeagle2: add support for 1GB variant
k3-am62-pocketbeagle2: add support for efi capsules

 arch/arm/dts/Makefile                         |   1 +
 ...> k3-am62-pocketbeagle2-ddr4-1600MTs.dtsi} |  92 ++---
 .../arm/dts/k3-am62-pocketbeagle2-u-boot.dtsi | 336 ++++++++++++++++++
 arch/arm/dts/k3-am62-r5-pocketbeagle2.dts     |  35 ++
 arch/arm/mach-k3/am62x/Kconfig                |   1 +
 arch/arm/mach-k3/r5/am62x/clk-data.c          |  19 +-
 arch/arm/mach-k3/r5/am62x/dev-data.c          |   5 +-
 board/beagle/pocketbeagle2/Kconfig            |  86 +++++
 board/beagle/pocketbeagle2/MAINTAINERS        |  10 +
 board/beagle/pocketbeagle2/Makefile           |  11 +
 .../board-cfg.yaml                            |   0
 .../{beagleplay => pocketbeagle2}/pm-cfg.yaml |   0
 board/beagle/pocketbeagle2/pocketbeagle2.c    | 183 ++++++++++
 .../pocketbeagle2/pocketbeagle2.env}          |  23 +-
 .../beagle/pocketbeagle2/pocketbeagle2_ddr.h  |  50 +++
 .../pocketbeagle2}/rm-cfg.yaml                |   4 +-
 .../sec-cfg.yaml                              |   0
 common/board_f.c                              |   9 +
 ...onfig => am62_pocketbeagle2_a53_defconfig} |  25 +-
 ...config => am62_pocketbeagle2_r5_defconfig} |  16 +-
 doc/board/beagle/am62_pocketbeagle2.rst       | 279 +++++++++++++++
 doc/board/beagle/index.rst                    |   1 +
 include/configs/pocketbeagle2.h               |  39 ++
 23 files changed, 1142 insertions(+), 83 deletions(-)
 copy arch/arm/dts/{k3-am62x-sk-ddr4-1600MTs.dtsi => k3-am62-pocketbeagle2-ddr4-1600MTs.dtsi} (97%)
 create mode 100644 arch/arm/dts/k3-am62-pocketbeagle2-u-boot.dtsi
 create mode 100644 arch/arm/dts/k3-am62-r5-pocketbeagle2.dts
 create mode 100644 board/beagle/pocketbeagle2/Kconfig
 create mode 100644 board/beagle/pocketbeagle2/MAINTAINERS
 create mode 100644 board/beagle/pocketbeagle2/Makefile
 copy board/beagle/{beagleplay => pocketbeagle2}/board-cfg.yaml (100%)
 copy board/beagle/{beagleplay => pocketbeagle2}/pm-cfg.yaml (100%)
 create mode 100644 board/beagle/pocketbeagle2/pocketbeagle2.c
 copy board/{ti/am62x/am6254atl.env => beagle/pocketbeagle2/pocketbeagle2.env} (56%)
 create mode 100644 board/beagle/pocketbeagle2/pocketbeagle2_ddr.h
 copy board/{phytec/phycore_am62x => beagle/pocketbeagle2}/rm-cfg.yaml (99%)
 copy board/beagle/{beagleplay => pocketbeagle2}/sec-cfg.yaml (100%)
 copy configs/{am62x_beagleplay_a53_defconfig => am62_pocketbeagle2_a53_defconfig} (88%)
 copy configs/{am62x_beagleplay_r5_defconfig => am62_pocketbeagle2_r5_defconfig} (86%)
 create mode 100644 doc/board/beagle/am62_pocketbeagle2.rst
 create mode 100644 include/configs/pocketbeagle2.h
Signature · 1 line
2.54.0
#1 lore raw

PATCH v2 1/5 board_f: add a board_setup_dest_addr function

From: Randolph Sapp <[email protected]>

Add a weak definition for board_setup_dest_addr, as a way for specific boards to override the gd->relocaddr address before the relocation actually occurs.

---
 common/board_f.c | 9 +++++++++
 1 file changed, 9 insertions(+)
common/board_f.c +9 -0
index fdb3577fec09..d9d09ac94bf2 100644
@@ -328,6 +328,11 @@ __weak int arch_setup_dest_addr(void)
 	return 0;
 }
 
+__weak int board_setup_dest_addr(void)
+{
+	return 0;
+}
+
 static int setup_dest_addr(void)
 {
 	int ret;
@@ -362,6 +367,10 @@ static int setup_dest_addr(void)
 	if (ret)
 		return ret;
 
+	ret = board_setup_dest_addr();
+	if (ret)
+		return ret;
+
 	gd->initial_relocaddr = gd->relocaddr;
 	return 0;
 }
Signature · 1 line
2.54.0
#2 lore raw

Re: [PATCHv2 1/5] board_f: add a board_setup_dest_addr function

Hi Randolph

Quoted 9 lines · On Sat, 20 Jun 2026 at 02:17, <[email protected]> wrote:

From: Randolph Sapp <[email protected]>

Add a weak definition for board_setup_dest_addr, as a way for specific boards to override the gd->relocaddr address before the relocation actually occurs.

---

board_get_usable_ram_top() can be used instead.

Cheers
/Ilias

Quoted 33 lines
 common/board_f.c | 9 +++++++++
 1 file changed, 9 insertions(+)
common/board_f.c +9 -1
index fdb3577fec09..d9d09ac94bf2 100644
@@ -328,6 +328,11 @@ __weak int arch_setup_dest_addr(void)
        return 0;
 }
 
+__weak int board_setup_dest_addr(void)
+{
+       return 0;
+}
+
 static int setup_dest_addr(void)
 {
        int ret;
@@ -362,6 +367,10 @@ static int setup_dest_addr(void)
        if (ret)
                return ret;
 
+       ret = board_setup_dest_addr();
+       if (ret)
+               return ret;
+
        gd->initial_relocaddr = gd->relocaddr;
        return 0;
 }
--

2.54.0

#3 lore raw

Re: [PATCHv2 1/5] board_f: add a board_setup_dest_addr function

Quoted 10 lines · Ilias Apalodimas

Hi Randolph

Quoted 7 lines · On Sat, 20 Jun 2026 at 02:17, <[email protected]> wrote:

From: Randolph Sapp <[email protected]>

Add a weak definition for board_setup_dest_addr, as a way for specific boards to override the gd->relocaddr address before the relocation actually occurs.

Quoted 7 lines
Quoted 2 lines

---

board_get_usable_ram_top() can be used instead.

Cheers
/Ilias

It *could*. Just felt a little weird to artificially restrict the usable memory because the stack just barely runs into one of our reserved regions long enough to break a dt reserved-memory allocation.

Initially this was proposed because there are multiple runtimes with their own allocation techniques that could potentially take advantage of that space. If it's still preferable to use board_get_usable_ram_top though I will change it.

Quoted 33 lines
Quoted 33 lines
 common/board_f.c | 9 +++++++++
 1 file changed, 9 insertions(+)
common/board_f.c +9 -1
index fdb3577fec09..d9d09ac94bf2 100644
@@ -328,6 +328,11 @@ __weak int arch_setup_dest_addr(void)
        return 0;
 }
 
+__weak int board_setup_dest_addr(void)
+{
+       return 0;
+}
+
 static int setup_dest_addr(void)
 {
        int ret;
@@ -362,6 +367,10 @@ static int setup_dest_addr(void)
        if (ret)
                return ret;
 
+       ret = board_setup_dest_addr();
+       if (ret)
+               return ret;
+
        gd->initial_relocaddr = gd->relocaddr;
        return 0;
 }
--

2.54.0

#4 lore raw

Re: [PATCHv2 1/5] board_f: add a board_setup_dest_addr function

Hi Randolph

Quoted 15 lines · Randolph Sapp
Quoted 13 lines · Ilias Apalodimas

Hi Randolph

Quoted 9 lines · On Sat, 20 Jun 2026 at 02:17, <[email protected]> wrote:

From: Randolph Sapp <[email protected]>

Add a weak definition for board_setup_dest_addr, as a way for specific boards to override the gd->relocaddr address before the relocation actually occurs.

---

Quoted 8 lines
Quoted 4 lines

board_get_usable_ram_top() can be used instead.

Cheers
/Ilias

It *could*. Just felt a little weird to artificially restrict the usable memory because the stack just barely runs into one of our reserved regions long enough to break a dt reserved-memory allocation.

I am not sure I understand this without an example. We always relocate to ram_top for now and that's why that function exists. I've already started to clean up the relocations a bit [0]. I don't want to add more functions to tweak the reloc address unless necessary. Generally speaking the reloc address should not be board specific at all imho. If there are areas that we shouldn't use they need to be described in the DT and the core code should look at that. I am ok keeping one function to change this, but not more. We also have arch_setup_dest_addr() which isactually board specific (look at arch/powerpc/lib/stack.c which is the only place we define it).

Quoted 4 lines

Initially this was proposed because there are multiple runtimes with their own allocation techniques that could potentially take advantage of that space. If it's still preferable to use board_get_usable_ram_top though I will change it.

[0] https://lore.kernel.org/u-boot/[email protected]/

Thanks
/Ilias

Quoted 34 lines
Quoted 33 lines
Quoted 33 lines
 common/board_f.c | 9 +++++++++
 1 file changed, 9 insertions(+)
common/board_f.c +9 -1
index fdb3577fec09..d9d09ac94bf2 100644
@@ -328,6 +328,11 @@ __weak int arch_setup_dest_addr(void)
        return 0;
 }
 
+__weak int board_setup_dest_addr(void)
+{
+       return 0;
+}
+
 static int setup_dest_addr(void)
 {
        int ret;
@@ -362,6 +367,10 @@ static int setup_dest_addr(void)
        if (ret)
                return ret;
 
+       ret = board_setup_dest_addr();
+       if (ret)
+               return ret;
+
        gd->initial_relocaddr = gd->relocaddr;
        return 0;
 }
--

2.54.0

#5 lore raw

Re: [PATCHv2 1/5] board_f: add a board_setup_dest_addr function

Quoted 27 lines · Ilias Apalodimas

Hi Randolph

Quoted 15 lines · Randolph Sapp
Quoted 13 lines · Ilias Apalodimas

Hi Randolph

Quoted 9 lines · On Sat, 20 Jun 2026 at 02:17, <[email protected]> wrote:

From: Randolph Sapp <[email protected]>

Add a weak definition for board_setup_dest_addr, as a way for specific boards to override the gd->relocaddr address before the relocation actually occurs.

---

Quoted 8 lines
Quoted 4 lines

board_get_usable_ram_top() can be used instead.

Cheers
/Ilias

It *could*. Just felt a little weird to artificially restrict the usable memory because the stack just barely runs into one of our reserved regions long enough to break a dt reserved-memory allocation.

Quoted 10 lines

I am not sure I understand this without an example. We always relocate to ram_top for now and that's why that function exists. I've already started to clean up the relocations a bit [0]. I don't want to add more functions to tweak the reloc address unless necessary. Generally speaking the reloc address should not be board specific at all imho. If there are areas that we shouldn't use they need to be described in the DT and the core code should look at that. I am ok keeping one function to change this, but not more. We also have arch_setup_dest_addr() which isactually board specific (look at arch/powerpc/lib/stack.c which is the only place we define it).

Alright, I'll add a little information about the specific predicament we're in because of this board. Our ram_top is something like ~26MB away from a reserved memory region defined in device tree. After the relocation, before we can reserve the dt regions, we actually creep past 26MB of utilization. This makes the dt reservation fail in the LMB path, but later the utilization retracts. This lead me to find that some useful warnings were disabled [1] and other odd things were occurring as a result.

We can't even parse the dt without first reaching into one of the reserved regions. With everything using physical addresses we can't really relocate the active reservations to avoid this.

To be clear, I don't even like the solution I proposed here because it requires coordination between a device tree and a local configuration.

There just isn't enough wiggle room here when u-boot doesn't have a real stack size limit. We can't fully plan out a memory map ahead of time nor can we account for this at runtime. Please inform me if I'm missing something here, still fairly new to the way u-boot handles things.

Thanks for look at this Ilias. Hard to get these kind of discussions otherwise.

[1] https://lore.kernel.org/u-boot/[email protected]/

Quoted 43 lines
Quoted 4 lines

Initially this was proposed because there are multiple runtimes with their own allocation techniques that could potentially take advantage of that space. If it's still preferable to use board_get_usable_ram_top though I will change it.

[0] https://lore.kernel.org/u-boot/[email protected]/

Thanks
/Ilias

Quoted 34 lines
Quoted 33 lines
Quoted 33 lines
 common/board_f.c | 9 +++++++++
 1 file changed, 9 insertions(+)
common/board_f.c +9 -1
index fdb3577fec09..d9d09ac94bf2 100644
@@ -328,6 +328,11 @@ __weak int arch_setup_dest_addr(void)
        return 0;
 }
 
+__weak int board_setup_dest_addr(void)
+{
+       return 0;
+}
+
 static int setup_dest_addr(void)
 {
        int ret;
@@ -362,6 +367,10 @@ static int setup_dest_addr(void)
        if (ret)
                return ret;
 
+       ret = board_setup_dest_addr();
+       if (ret)
+               return ret;
+
        gd->initial_relocaddr = gd->relocaddr;
        return 0;
 }
--

2.54.0

#6 lore raw

Re: [PATCHv2 1/5] board_f: add a board_setup_dest_addr function

Hi Randolph

Quoted 40 lines · Randolph Sapp
Quoted 27 lines · Ilias Apalodimas

Hi Randolph

Quoted 15 lines · Randolph Sapp
Quoted 13 lines · Ilias Apalodimas

Hi Randolph

Quoted 9 lines · On Sat, 20 Jun 2026 at 02:17, <[email protected]> wrote:

From: Randolph Sapp <[email protected]>

Add a weak definition for board_setup_dest_addr, as a way for specific boards to override the gd->relocaddr address before the relocation actually occurs.

---

Quoted 8 lines
Quoted 4 lines

board_get_usable_ram_top() can be used instead.

Cheers
/Ilias

It *could*. Just felt a little weird to artificially restrict the usable memory because the stack just barely runs into one of our reserved regions long enough to break a dt reserved-memory allocation.

Quoted 10 lines

I am not sure I understand this without an example. We always relocate to ram_top for now and that's why that function exists. I've already started to clean up the relocations a bit [0]. I don't want to add more functions to tweak the reloc address unless necessary. Generally speaking the reloc address should not be board specific at all imho. If there are areas that we shouldn't use they need to be described in the DT and the core code should look at that. I am ok keeping one function to change this, but not more. We also have arch_setup_dest_addr() which isactually board specific (look at arch/powerpc/lib/stack.c which is the only place we define it).

Quoted 8 lines

Alright, I'll add a little information about the specific predicament we're in because of this board. Our ram_top is something like ~26MB away from a reserved memory region defined in device tree. After the relocation, before we can reserve the dt regions, we actually creep past 26MB of utilization. This makes the dt reservation fail in the LMB path, but later the utilization retracts. This lead me to find that some useful warnings were disabled [1] and other odd things were occurring as a result.

Thanks this helps.

Quoted 6 lines

We can't even parse the dt without first reaching into one of the reserved regions. With everything using physical addresses we can't really relocate the active reservations to avoid this.

To be clear, I don't even like the solution I proposed here because it requires coordination between a device tree and a local configuration.

I think the reality is that we will always have 'special' cases and we'll need a board function that tweaks the reloc address. But that should be the vast minority. I don't think we can solve this with a single commit. But cleaning up the core code will give as a pretty good idea of how many 'special' cases we actually have.

Quoted 5 lines

There just isn't enough wiggle room here when u-boot doesn't have a real stack size limit. We can't fully plan out a memory map ahead of time nor can we account for this at runtime. Please inform me if I'm missing something here, still fairly new to the way u-boot handles things.

Ok so from what I read board_get_usable_ram_top() does solve your problem, right?
I suggest you just define that and revisit the whole thing once I clean up a bit more.
For example, I don't see why we need arch_setup_dest_addr() and we just can't define board_get_usable_ram_top() for the affected ppc boards.

Quoted 2 lines

Thanks for look at this Ilias. Hard to get these kind of discussions otherwise.

YW, I do care about abstracting this nicely and reducing the board specific code So if you have more of these cases feel free to cc me.

Thanks
/Ilias

Quoted 47 lines

[1] https://lore.kernel.org/u-boot/[email protected]/

Quoted 43 lines
Quoted 4 lines

Initially this was proposed because there are multiple runtimes with their own allocation techniques that could potentially take advantage of that space. If it's still preferable to use board_get_usable_ram_top though I will change it.

[0] https://lore.kernel.org/u-boot/[email protected]/

Thanks
/Ilias

Quoted 34 lines
Quoted 33 lines
Quoted 33 lines
 common/board_f.c | 9 +++++++++
 1 file changed, 9 insertions(+)
common/board_f.c +9 -1
index fdb3577fec09..d9d09ac94bf2 100644
@@ -328,6 +328,11 @@ __weak int arch_setup_dest_addr(void)
        return 0;
 }
 
+__weak int board_setup_dest_addr(void)
+{
+       return 0;
+}
+
 static int setup_dest_addr(void)
 {
        int ret;
@@ -362,6 +367,10 @@ static int setup_dest_addr(void)
        if (ret)
                return ret;
 
+       ret = board_setup_dest_addr();
+       if (ret)
+               return ret;
+
        gd->initial_relocaddr = gd->relocaddr;
        return 0;
 }
--

2.54.0

#7 lore raw

Re: [PATCHv2 1/5] board_f: add a board_setup_dest_addr function

Hi,

Quoted 74 lines · Ilias Apalodimas

Hi Randolph

Quoted 40 lines · Randolph Sapp
Quoted 27 lines · Ilias Apalodimas

Hi Randolph

Quoted 15 lines · Randolph Sapp
Quoted 13 lines · Ilias Apalodimas

Hi Randolph

Quoted 9 lines · On Sat, 20 Jun 2026 at 02:17, <[email protected]> wrote:

From: Randolph Sapp <[email protected]>

Add a weak definition for board_setup_dest_addr, as a way for specific boards to override the gd->relocaddr address before the relocation actually occurs.

---

Quoted 8 lines
Quoted 4 lines

board_get_usable_ram_top() can be used instead.

Cheers
/Ilias

It *could*. Just felt a little weird to artificially restrict the usable memory because the stack just barely runs into one of our reserved regions long enough to break a dt reserved-memory allocation.

Quoted 10 lines

I am not sure I understand this without an example. We always relocate to ram_top for now and that's why that function exists. I've already started to clean up the relocations a bit [0]. I don't want to add more functions to tweak the reloc address unless necessary. Generally speaking the reloc address should not be board specific at all imho. If there are areas that we shouldn't use they need to be described in the DT and the core code should look at that. I am ok keeping one function to change this, but not more. We also have arch_setup_dest_addr() which isactually board specific (look at arch/powerpc/lib/stack.c which is the only place we define it).

Quoted 8 lines

Alright, I'll add a little information about the specific predicament we're in because of this board. Our ram_top is something like ~26MB away from a reserved memory region defined in device tree. After the relocation, before we can reserve the dt regions, we actually creep past 26MB of utilization. This makes the dt reservation fail in the LMB path, but later the utilization retracts. This lead me to find that some useful warnings were disabled [1] and other odd things were occurring as a result.

Thanks this helps.

Quoted 6 lines

We can't even parse the dt without first reaching into one of the reserved regions. With everything using physical addresses we can't really relocate the active reservations to avoid this.

To be clear, I don't even like the solution I proposed here because it requires coordination between a device tree and a local configuration.

I think the reality is that we will always have 'special' cases and we'll need a board function that tweaks the reloc address. But that should be the vast minority. I don't think we can solve this with a single commit. But cleaning up the core code will give as a pretty good idea of how many 'special' cases we actually have.

Quoted 5 lines

There just isn't enough wiggle room here when u-boot doesn't have a real stack size limit. We can't fully plan out a memory map ahead of time nor can we account for this at runtime. Please inform me if I'm missing something here, still fairly new to the way u-boot handles things.

Quoted 7 lines

Ok so from what I read board_get_usable_ram_top() does solve your problem, right?
I suggest you just define that and revisit the whole thing once I clean up a bit more.
For example, I don't see why we need arch_setup_dest_addr() and we just can't define board_get_usable_ram_top() for the affected ppc boards.

+1 that woud be my question too - we are trying to simplify things and avoid options only used by a few boards, where possible

Quoted 56 lines
Quoted 3 lines

Thanks for look at this Ilias. Hard to get these kind of discussions otherwise.

YW, I do care about abstracting this nicely and reducing the board specific code So if you have more of these cases feel free to cc me.

Thanks
/Ilias

Quoted 47 lines

[1] https://lore.kernel.org/u-boot/[email protected]/

Quoted 43 lines
Quoted 4 lines

Initially this was proposed because there are multiple runtimes with their own allocation techniques that could potentially take advantage of that space. If it's still preferable to use board_get_usable_ram_top though I will change it.

[0] https://lore.kernel.org/u-boot/[email protected]/

Thanks
/Ilias

Quoted 34 lines
Quoted 33 lines
Quoted 33 lines
 common/board_f.c | 9 +++++++++
 1 file changed, 9 insertions(+)
common/board_f.c +9 -1
index fdb3577fec09..d9d09ac94bf2 100644
@@ -328,6 +328,11 @@ __weak int arch_setup_dest_addr(void)
        return 0;
 }
 
+__weak int board_setup_dest_addr(void)
+{
+       return 0;
+}
+
 static int setup_dest_addr(void)
 {
        int ret;
@@ -362,6 +367,10 @@ static int setup_dest_addr(void)
        if (ret)
                return ret;
 
+       ret = board_setup_dest_addr();
+       if (ret)
+               return ret;
+
        gd->initial_relocaddr = gd->relocaddr;
        return 0;
 }
--

2.54.0

Regards,
Simon

#8 lore raw

PATCH v2 2/5 arm: mach-k3: am62: add &main_uart6 to clock and pwr tree

In reply to [email protected]

From: Bryan Brattlof <[email protected]>

The pocketbeagle2 uses the main_uart6 as the debug console. To get debug console prints at the R5 SPL stage, add the &main_uart6 to the R5 clk and dev data so we can configure the uart as early as possible during the bootup of the pocketbeagle2

---
 arch/arm/mach-k3/r5/am62x/clk-data.c | 19 +++++++++++++++----
 arch/arm/mach-k3/r5/am62x/dev-data.c |  5 +++--
 2 files changed, 18 insertions(+), 6 deletions(-)
arch/arm/mach-k3/r5/am62x/clk-data.c +15 -4
index d7bfed0e031c..05cced0b313b 100644
@@ -3,9 +3,9 @@
  * AM62X specific clock platform data
  *
  * This file is auto generated. Please do not hand edit and report any issues
- * to Dave Gerlach <[email protected]>.
+ * to Bryan Brattlof <[email protected]>.
  *
- * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
+ * Copyright (C) 2020-2025 Texas Instruments Incorporated - https://www.ti.com/
  */
 
 #include <linux/clk-provider.h>
@@ -125,6 +125,11 @@ static const char * const main_usart0_fclk_sel_out0_parents[] = {
 	"hsdiv4_16fft_main_1_hsdivout1_clk",
 };
 
+static const char * const main_usart6_fclk_sel_out0_parents[] = {
+	"usart_programmable_clock_divider_out6",
+	"hsdiv4_16fft_main_1_hsdivout1_clk",
+};
+
 static const struct clk_data clk_list[] = {
 	CLK_FIXED_RATE("osc_26_mhz", 26000000, 0),
 	CLK_FIXED_RATE("osc_25_mhz", 25000000, 0),
@@ -210,9 +215,11 @@ static const struct clk_data clk_list[] = {
 	CLK_MUX("main_gtcclk_sel_out0", main_gtcclk_sel_out0_parents, 8, 0x43008030, 0, 3, 0),
 	CLK_MUX("main_ospi_ref_clk_sel_out0", main_ospi_ref_clk_sel_out0_parents, 2, 0x108500, 0, 1, 0),
 	CLK_DIV_DEFFREQ("usart_programmable_clock_divider_out0", "hsdiv4_16fft_main_1_hsdivout0_clk", 0x108240, 0, 2, 0, 0, 48000000),
+	CLK_DIV_DEFFREQ("usart_programmable_clock_divider_out6", "hsdiv4_16fft_main_1_hsdivout0_clk", 0x108258, 0, 2, 0, 0, 48000000),
 	CLK_MUX("wkup_clkout_sel_out0", wkup_clkout_sel_out0_parents, 8, 0x43008020, 0, 3, 0),
 	CLK_MUX("wkup_clksel_out0", wkup_clksel_out0_parents, 2, 0x43008010, 0, 1, 0),
 	CLK_MUX("main_usart0_fclk_sel_out0", main_usart0_fclk_sel_out0_parents, 2, 0x108280, 0, 1, 0),
+	CLK_MUX("main_usart6_fclk_sel_out0", main_usart6_fclk_sel_out0_parents, 2, 0x108298, 0, 1, 0),
 	CLK_DIV("hsdiv4_16fft_mcu_0_hsdivout1_clk", "pllfracf_ssmod_16fft_mcu_0_foutvcop_clk", 0x4040084, 0, 7, 0, 0),
 	CLK_FIXED_RATE("mshsi2c_wkup_0_porscl", 0, 0),
 	CLK_DIV("sam62_pll_ctrl_wrap_main_0_chip_div24_clk_clk", "sam62_pll_ctrl_wrap_main_0_sysclkout_clk", 0x41011c, 0, 5, 0, 0),
@@ -336,6 +343,10 @@ static const struct dev_clk soc_dev_clk_data[] = {
 	DEV_CLK(157, 164, "clk_32k_rc_sel_out0"),
 	DEV_CLK(157, 165, "gluelogic_rcosc_clkout"),
 	DEV_CLK(157, 166, "gluelogic_hfosc0_clkout"),
+	DEV_CLK(158, 0, "main_usart6_fclk_sel_out0"),
+	DEV_CLK(158, 1, "usart_programmable_clock_divider_out6"),
+	DEV_CLK(158, 2, "hsdiv4_16fft_main_1_hsdivout1_clk"),
+	DEV_CLK(158, 5, "sam62_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
 	DEV_CLK(161, 0, "sam62_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
 	DEV_CLK(161, 1, "sam62_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
 	DEV_CLK(161, 2, "sam62_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
@@ -361,7 +372,7 @@ static const struct dev_clk soc_dev_clk_data[] = {
 
 const struct ti_k3_clk_platdata am62x_clk_platdata = {
 	.clk_list = clk_list,
-	.clk_list_cnt = 90,
+	.clk_list_cnt = 92,
 	.soc_dev_clk_data = soc_dev_clk_data,
-	.soc_dev_clk_data_cnt = 137,
+	.soc_dev_clk_data_cnt = 140,
 };
arch/arm/mach-k3/r5/am62x/dev-data.c +3 -2
index 59c95df2a887..ea1e76a8a758 100644
@@ -3,9 +3,9 @@
  * AM62X specific device platform data
  *
  * This file is auto generated. Please do not hand edit and report any issues
- * to Dave Gerlach <[email protected]>.
+ * to Bryan Brattlof <[email protected]>.
  *
- * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
+ * Copyright (C) 2020-2025 Texas Instruments Incorporated - https://www.ti.com/
  */
 
 #include "k3-dev.h"
@@ -61,6 +61,7 @@ static struct ti_dev soc_dev_list[] = {
 	PSC_DEV(36, &soc_lpsc_list[11]),
 	PSC_DEV(102, &soc_lpsc_list[11]),
 	PSC_DEV(146, &soc_lpsc_list[11]),
+	PSC_DEV(158, &soc_lpsc_list[11]),
 	PSC_DEV(13, &soc_lpsc_list[12]),
 	PSC_DEV(166, &soc_lpsc_list[13]),
 	PSC_DEV(135, &soc_lpsc_list[14]),
Signature · 1 line
2.54.0
#9 lore raw

PATCH v2 3/5 k3-am62-pocketbeagle2: add initial board support

In reply to [email protected]

From: Randolph Sapp <[email protected]>

Add initial board support for the PocketBeagle 2, based on Robert Nelson and Bryan Brattlof's work. Unify all debug consoles to main_uart6. Use DDR config v10.32 from our sysconfig tool [1] for Kingston's memory [2], (4Gb Desnity with a CL of 11 and CWL of 9). Add support for the SPL_TEXT_BASE config parameter. Ensure all files have a summary and SPDX identifier.

Also, use board_setup_dest_addr to fixup our relocaddr since otherwise the u-boot stack reservation will collide with the wkup_r5fss0_core0_memory_region.

[1] https://dev.ti.com/sysconfig
[2] https://mm.digikey.com/Volume0/opasdata/d220001/medias/docus/6465/D2516AN9EXGXN-TU.pdf

---
 arch/arm/dts/Makefile                         |   1 +
 ...> k3-am62-pocketbeagle2-ddr4-1600MTs.dtsi} |  92 +++---
 ...dtsi => k3-am62-pocketbeagle2-u-boot.dtsi} | 160 ++++++----
 arch/arm/dts/k3-am62-r5-pocketbeagle2.dts     |  35 +++
 arch/arm/mach-k3/am62x/Kconfig                |   1 +
 board/beagle/pocketbeagle2/Kconfig            |  60 ++++
 board/beagle/pocketbeagle2/MAINTAINERS        |  10 +
 board/beagle/pocketbeagle2/Makefile           |   9 +
 .../board-cfg.yaml                            |   0
 .../{beagleplay => pocketbeagle2}/pm-cfg.yaml |   0
 board/beagle/pocketbeagle2/pocketbeagle2.c    |  56 ++++
 .../pocketbeagle2/pocketbeagle2.env}          |  20 +-
 .../pocketbeagle2}/rm-cfg.yaml                |   4 +-
 .../sec-cfg.yaml                              |   0
 ...onfig => am62_pocketbeagle2_a53_defconfig} |  24 +-
 ...config => am62_pocketbeagle2_r5_defconfig} |  11 +-
 doc/board/beagle/am62_pocketbeagle2.rst       | 279 ++++++++++++++++++
 doc/board/beagle/index.rst                    |   1 +
 .../configs/{beagley_ai.h => pocketbeagle2.h} |   8 +-
 19 files changed, 634 insertions(+), 137 deletions(-)
 copy arch/arm/dts/{k3-am62x-sk-ddr4-1600MTs.dtsi => k3-am62-pocketbeagle2-ddr4-1600MTs.dtsi} (97%)
 copy arch/arm/dts/{k3-am67a-beagley-ai-u-boot.dtsi => k3-am62-pocketbeagle2-u-boot.dtsi} (53%)
 create mode 100644 arch/arm/dts/k3-am62-r5-pocketbeagle2.dts
 create mode 100644 board/beagle/pocketbeagle2/Kconfig
 create mode 100644 board/beagle/pocketbeagle2/MAINTAINERS
 create mode 100644 board/beagle/pocketbeagle2/Makefile
 copy board/beagle/{beagleplay => pocketbeagle2}/board-cfg.yaml (100%)
 copy board/beagle/{beagleplay => pocketbeagle2}/pm-cfg.yaml (100%)
 create mode 100644 board/beagle/pocketbeagle2/pocketbeagle2.c
 copy board/{ti/am62x/am62x.env => beagle/pocketbeagle2/pocketbeagle2.env} (64%)
 copy board/{phytec/phycore_am62x => beagle/pocketbeagle2}/rm-cfg.yaml (99%)
 copy board/beagle/{beagleplay => pocketbeagle2}/sec-cfg.yaml (100%)
 copy configs/{am62x_beagleplay_a53_defconfig => am62_pocketbeagle2_a53_defconfig} (87%)
 copy configs/{am62x_beagleplay_r5_defconfig => am62_pocketbeagle2_r5_defconfig} (89%)
 create mode 100644 doc/board/beagle/am62_pocketbeagle2.rst
 copy include/configs/{beagley_ai.h => pocketbeagle2.h} (57%)
arch/arm/dts/Makefile +1 -0
index 356612d78c04..f230416c5ec0 100644
@@ -1058,6 +1058,7 @@ dtb-$(CONFIG_SOC_K3_AM642) += k3-am642-r5-evm.dtb \
 			      k3-am642-r5-phycore-som-2gb.dtb
 
 dtb-$(CONFIG_SOC_K3_AM625) += k3-am625-r5-sk.dtb \
+			      k3-am62-r5-pocketbeagle2.dtb \
 			      k3-am625-r5-beagleplay.dtb \
 			      k3-am625-verdin-r5.dtb \
 			      k3-am625-r5-phycore-som-2gb.dtb
arch/arm/dts/k3-am62-pocketbeagle2-ddr4-1600MTs.dtsi renamed from arch/arm/dts/k3-am62x-sk-ddr4-1600MTs.dtsi +47 -45

229 lines not on this page · raw message

arch/arm/dts/k3-am62-pocketbeagle2-u-boot.dtsi renamed from arch/arm/dts/k3-am67a-beagley-ai-u-boot.dtsi +103 -57

308 lines not on this page · raw message

arch/arm/dts/k3-am62-r5-pocketbeagle2.dts new file +35 -0
new file mode 100644
index 000000000000..4489a559287b
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0-only OR MIT
+/*
+ * AM625 PocketBeagle 2 dts file for R5 SPL
+ * https://www.beagleboard.org/boards/pocketbeagle-2
+ *
+ * Copyright (C) 2022-2023 Texas Instruments Incorporated - https://www.ti.com/
+ * Copyright (C) 2022-2023 Robert Nelson, BeagleBoard.org Foundation
+ */
+
+#include "k3-am62-pocketbeagle2.dts"
+#include "k3-am62-pocketbeagle2-ddr4-1600MTs.dtsi"
+#include "k3-am62-ddr.dtsi"
+
+#include "k3-am62-pocketbeagle2-u-boot.dtsi"
+#include "k3-am625-r5.dtsi"
+
+/ {
+	aliases {
+		serial1 = &main_uart1;
+		serial2 = &main_uart6;
+		serial3 = &main_uart3;
+		serial4 = &main_uart4;
+		serial5 = &main_uart5;
+		serial6 = &main_uart2;
+		serial7 = &main_uart0;
+	};
+};
+
+&main_pktdma {
+	ti,sci = <&dm_tifs>;
+};
+
+&main_bcdma {
+	ti,sci = <&dm_tifs>;
+};
arch/arm/mach-k3/am62x/Kconfig +1 -0
index f7ad52db7d8d..87470248aa15 100644
@@ -69,6 +69,7 @@ config TARGET_VERDIN_AM62_R5
 endchoice
 
 source "board/beagle/beagleplay/Kconfig"
+source "board/beagle/pocketbeagle2/Kconfig"
 source "board/phytec/phycore_am62x/Kconfig"
 source "board/ti/am62x/Kconfig"
 source "board/toradex/verdin-am62/Kconfig"
board/beagle/pocketbeagle2/Kconfig new file +60 -0

60 lines not on this page · raw message

board/beagle/pocketbeagle2/MAINTAINERS new file +10 -0
new file mode 100644
index 000000000000..79bdd59af7e7
@@ -0,0 +1,10 @@
+POCKETBEAGLE2 BOARD
+M:	Nishanth Menon <[email protected]>
+M:	Robert Nelson <[email protected]>
+M:	Tom Rini <[email protected]>
+S:	Maintained
+N:	pocketbeagle2
+F:	board/beagle/pocketbeagle2/
+F:	include/configs/pocketbeagle2.h
+F:	configs/am62_pocketbeagle2_a53_defconfig
+F:	configs/am62_pocketbeagle2_r5_defconfig
board/beagle/pocketbeagle2/Makefile new file +9 -0
new file mode 100644
index 000000000000..3d42c160716e
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Makefile for AM625 PocketBeagle 2
+# https://www.beagleboard.org/boards/pocketbeagle-2
+#
+# Copyright (C) 2025 Texas Instruments Incorporated - https://www.ti.com/
+#
+
+obj-y += pocketbeagle2.o
board/beagle/pocketbeagle2/board-cfg.yaml renamed from board/beagle/beagleplay/board-cfg.yaml +0 -0
similarity index 100%
copy from board/beagle/beagleplay/board-cfg.yaml
copy to board/beagle/pocketbeagle2/board-cfg.yaml
board/beagle/pocketbeagle2/pm-cfg.yaml renamed from board/beagle/beagleplay/pm-cfg.yaml +0 -0
similarity index 100%
copy from board/beagle/beagleplay/pm-cfg.yaml
copy to board/beagle/pocketbeagle2/pm-cfg.yaml
board/beagle/pocketbeagle2/pocketbeagle2.c new file +56 -0

56 lines not on this page · raw message

board/beagle/pocketbeagle2/pocketbeagle2.env renamed from board/ti/am62x/am62x.env +7 -13
similarity index 64%
copy from board/ti/am62x/am62x.env
copy to board/beagle/pocketbeagle2/pocketbeagle2.env
index 60b5fd5e6ca7..816f365083e7 100644
@@ -10,23 +10,17 @@ rproc_fw_binaries= 0 /lib/firmware/am62-mcu-m4f0_0-fw
 
 name_kern=Image
 console=ttyS2,115200n8
-args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000
-	${mtdparts}
+args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02860000
 run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
+set_led_state_fail_load= led led-1 off; led led-2 on;
+	led led-3 off; led led-4 on
+set_led_state_start_load=led led-1 on; led led-2 off;
+	led led-3 on; led led-4 off
 
-boot_targets=mmc1 mmc0 usb pxe dhcp
+boot_targets=mmc1
 boot=mmc
 mmcdev=1
 bootpart=1:2
 bootdir=/boot
+bootmeths=script extlinux efi pxe
 rd_spec=-
-
-splashfile=ti_logo_414x97_32bpp.bmp.gz
-splashimage=0x80200000
-splashpos=m,m
-splashsource=sf
-
-#if CONFIG_BOOTMETH_ANDROID
-#include <env/ti/android.env>
-adtb_idx=0
-#endif
\ No newline at end of file
board/beagle/pocketbeagle2/rm-cfg.yaml renamed from board/phytec/phycore_am62x/rm-cfg.yaml +2 -2
similarity index 99%
copy from board/phytec/phycore_am62x/rm-cfg.yaml
copy to board/beagle/pocketbeagle2/rm-cfg.yaml
index f800fb28a692..26d99b03b800 100644
@@ -525,7 +525,7 @@ rm-cfg:
             reserved: 0
         -
             start_resource: 168
-            num_resource: 7
+            num_resource: 8
             type: 1802
             host_id: 30
             reserved: 0
@@ -555,7 +555,7 @@ rm-cfg:
             reserved: 0
         -
             start_resource: 909
-            num_resource: 625
+            num_resource: 626
             type: 1805
             host_id: 128
             reserved: 0
board/beagle/pocketbeagle2/sec-cfg.yaml renamed from board/beagle/beagleplay/sec-cfg.yaml +0 -0
similarity index 100%
copy from board/beagle/beagleplay/sec-cfg.yaml
copy to board/beagle/pocketbeagle2/sec-cfg.yaml
configs/am62_pocketbeagle2_a53_defconfig renamed from configs/am62x_beagleplay_a53_defconfig +11 -13
similarity index 87%
copy from configs/am62x_beagleplay_a53_defconfig
copy to configs/am62_pocketbeagle2_a53_defconfig
index c9bc7cd8d398..8964cb3b1955 100644
@@ -6,18 +6,23 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SOC_K3_AM625=y
-CONFIG_TARGET_AM625_A53_BEAGLEPLAY=y
+CONFIG_TARGET_AM62X_A53_POCKETBEAGLE2=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
-CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80b80000
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x82b00000
 CONFIG_DM_GPIO=y
-CONFIG_DEFAULT_DEVICE_TREE="ti/k3-am625-beagleplay"
+CONFIG_DEFAULT_DEVICE_TREE="ti/k3-am62-pocketbeagle2"
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
+CONFIG_TEXT_BASE=0x82f80000
+CONFIG_SPL_TEXT_BASE=0x82000000
+CONFIG_SPL_STACK_R_ADDR=0x83f80000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
-CONFIG_SPL_BSS_START_ADDR=0x80c80000
+CONFIG_K3_OPTEE_LOAD_ADDR=0x80080000
+CONFIG_SPL_BSS_START_ADDR=0x82c00000
+CONFIG_SPL_HAS_LOAD_FIT_ADDRESS=y
+CONFIG_SPL_LOAD_FIT_ADDRESS=0x82f80000
 CONFIG_SPL_BSS_MAX_SIZE=0x80000
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SIZE_LIMIT=0x40000
@@ -44,8 +49,6 @@ CONFIG_SPL_I2C=y
 CONFIG_SPL_DM_MAILBOX=y
 CONFIG_SPL_POWER_DOMAIN=y
 CONFIG_SPL_YMODEM_SUPPORT=y
-CONFIG_CMD_BOOTEFI_SELFTEST=y
-CONFIG_CMD_NVEDIT_EFI=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPIO_READ=y
 CONFIG_CMD_I2C=y
@@ -53,6 +56,7 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_EFIDEBUG=y
 CONFIG_CMD_PMIC=y
 CONFIG_CMD_REGULATOR=y
+CONFIG_CMD_CACHE=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_UPSTREAM=y
@@ -90,10 +94,6 @@ CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ADMA=y
 CONFIG_SPL_MMC_SDHCI_ADMA=y
 CONFIG_MMC_SDHCI_AM654=y
-CONFIG_PHY_REALTEK=y
-CONFIG_PHY_TI=y
-CONFIG_DM_ETH_PHY=y
-CONFIG_TI_AM65_CPSW_NUSS=y
 CONFIG_PHY=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
@@ -120,7 +120,5 @@ CONFIG_SYSRESET_TI_SCI=y
 CONFIG_EXT4_WRITE=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_LZO=y
-CONFIG_EFI_SET_TIME=y
 
-#include <configs/k3_efi_capsule.config>
 #include <configs/am62x_a53_usbdfu.config>
configs/am62_pocketbeagle2_r5_defconfig renamed from configs/am62x_beagleplay_r5_defconfig +8 -3
similarity index 89%
copy from configs/am62x_beagleplay_r5_defconfig
copy to configs/am62_pocketbeagle2_r5_defconfig
index 08b2c38b80de..90e577e8ce16 100644
@@ -3,15 +3,16 @@ CONFIG_ARCH_K3=y
 CONFIG_SYS_MALLOC_LEN=0x08000000
 CONFIG_SYS_MALLOC_F_LEN=0x9000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SOC_K3_AM625=y
-CONFIG_TARGET_AM625_R5_BEAGLEPLAY=y
+CONFIG_TARGET_AM62X_R5_POCKETBEAGLE2=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x43c3a7f0
 CONFIG_ENV_SIZE=0x20000
 CONFIG_DM_GPIO=y
 CONFIG_SPL_DM_SPI=y
-CONFIG_DEFAULT_DEVICE_TREE="k3-am625-r5-beagleplay"
+CONFIG_DEFAULT_DEVICE_TREE="k3-am62-r5-pocketbeagle2"
 CONFIG_DM_RESET=y
 CONFIG_SPL_SYS_MALLOC_F_LEN=0x7000
 CONFIG_SPL_MMC=y
@@ -34,7 +35,6 @@ CONFIG_SPL_SIZE_LIMIT_SUBTRACT_MALLOC=y
 CONFIG_SPL_MAX_SIZE=0x3B000
 CONFIG_SPL_PAD_TO=0x0
 CONFIG_SPL_SYS_REPORT_STACK_F_USAGE=y
-CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_SYS_MALLOC=y
@@ -62,6 +62,8 @@ CONFIG_ENV_RELOC_GD_ENV_ADDR=y
 CONFIG_NO_NET=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_REGMAP=y
+CONFIG_SPL_REGMAP=y
 CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_CLK=y
 CONFIG_SPL_CLK=y
@@ -97,3 +99,6 @@ CONFIG_SPL_TIMER=y
 CONFIG_OMAP_TIMER=y
 CONFIG_LIB_RATIONAL=y
 CONFIG_SPL_LIB_RATIONAL=y
+CONFIG_K3_OPTEE_LOAD_ADDR=0x80080000
+CONFIG_SPL_HAS_LOAD_FIT_ADDRESS=y
+CONFIG_SPL_LOAD_FIT_ADDRESS=0x82000000
doc/board/beagle/am62_pocketbeagle2.rst new file +279 -0

279 lines not on this page · raw message

doc/board/beagle/index.rst +1 -0
index e33d39fc677f..8bf099ae7be7 100644
@@ -10,6 +10,7 @@ ARM based boards
 .. toctree::
    :maxdepth: 2
 
+   am62_pocketbeagle2
    am62x_beagleplay
    am67a_beagley_ai.rst
    j721e_beagleboneai64
include/configs/pocketbeagle2.h renamed from include/configs/beagley_ai.h +4 -4
similarity index 57%
copy from include/configs/beagley_ai.h
copy to include/configs/pocketbeagle2.h
index a7072a094c58..dd6956aa8b90 100644
@@ -1,14 +1,14 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Configuration header file for BeagleY-AI
+ * Configuration header file for PocketBeagle 2
  *
  * Copyright (C) 2025 Texas Instruments Incorporated - https://www.ti.com/
  */
 
-#ifndef __CONFIG_BEAGLEY_AI_H
-#define __CONFIG_BEAGLEY_AI_H
+#ifndef __CONFIG_POCKETBEAGLE2_H
+#define __CONFIG_POCKETBEAGLE2_H
 
 /* Now for the remaining common defines */
 #include <configs/ti_armv7_common.h>
 
-#endif /* __CONFIG_BEAGLEY_AI_H */
+#endif /* __CONFIG_POCKETBEAGLE2_H */
Signature · 1 line
2.54.0
#10 lore raw

PATCH v2 4/5 k3-am62-pocketbeagle2: add support for 1GB variant

In reply to [email protected]

From: Randolph Sapp <[email protected]>

Take Phytec's current DDR fixup functions and utilize them to dynamically adjust for variants in the pocketbeagle2. There are currently 3 skews, two of which are both 512MB with the same memory configuration, and one which is 1GB using the same CWL and CL settings but a modified density [1].

Based off of Bryan Brattlof's patch [2].

[1] https://mm.digikey.com/Volume0/opasdata/d220001/medias/docus/5411/8G%20Bits%20DDR4%20SDRAM.pdf
[2] https://github.com/bryanbrattlof/beagleboot/commit/fb2f022e27427e990d7a33fd001ffb571e13cfc3

---
 board/beagle/pocketbeagle2/Kconfig            |  26 +++++
 board/beagle/pocketbeagle2/Makefile           |   2 +
 board/beagle/pocketbeagle2/pocketbeagle2.c    | 103 +++++++++++++++++-
 .../beagle/pocketbeagle2/pocketbeagle2_ddr.h  |  50 +++++++++
 configs/am62_pocketbeagle2_r5_defconfig       |   5 +-
 5 files changed, 184 insertions(+), 2 deletions(-)
 create mode 100644 board/beagle/pocketbeagle2/pocketbeagle2_ddr.h
board/beagle/pocketbeagle2/Kconfig +26 -0
index e957b8e8377e..a361fcebfc1d 100644
@@ -12,6 +12,7 @@ config TARGET_AM62X_A53_POCKETBEAGLE2
 	select ARM64
 	select BINMAN
 	select OF_SYSTEM_SETUP
+	imply TI_I2C_BOARD_DETECT
 
 config TARGET_AM62X_R5_POCKETBEAGLE2
 	bool "BeagleBoard.org AM62X PocketBeagle 2 running on R5"
@@ -23,6 +24,7 @@ config TARGET_AM62X_R5_POCKETBEAGLE2
 	select K3_DDRSS
 	select BINMAN
 	imply SYS_K3_SPL_ATF
+	imply TI_I2C_BOARD_DETECT
 
 endchoice
 
@@ -58,3 +60,27 @@ config SPL_LDSCRIPT
 source "board/ti/common/Kconfig"
 
 endif
+
+config POCKETBEAGLE2_AM62X_RAM_SIZE_FIX
+	bool "Set the PocketBeagle 2 RAM size instead of detecting it"
+	default false
+	help
+	  RAM size is automatically detected through the device revision stored
+	  in EEPROM. This overrides the detection logic with a fixed value.
+
+choice
+	prompt "PocketBeagle 2 RAM size"
+	depends on POCKETBEAGLE2_AM62X_RAM_SIZE_FIX
+	default POCKETBEAGLE2_AM62X_RAM_SIZE_512MB
+
+config POCKETBEAGLE2_AM62X_RAM_SIZE_512MB
+	bool "512MB RAM"
+	help
+	  Set RAM size fix to 512MB for the PocketBeagle 2.
+
+config POCKETBEAGLE2_AM62X_RAM_SIZE_1GB
+	bool "1GB RAM"
+	help
+	  Set RAM size fix to 1GB for the PocketBeagle 2.
+
+endchoice
board/beagle/pocketbeagle2/Makefile +2 -0
index 3d42c160716e..dd529fe6d75e 100644
@@ -7,3 +7,5 @@
 #
 
 obj-y += pocketbeagle2.o
+obj-${CONFIG_K3_DDRSS} += ../../phytec/common/k3/k3_ddrss_patch.o
+obj-${CONFIG_TI_I2C_BOARD_DETECT} += ../../ti/common/board_detect.o
board/beagle/pocketbeagle2/pocketbeagle2.c +102 -1

120 lines not on this page · raw message

board/beagle/pocketbeagle2/pocketbeagle2_ddr.h new file +50 -0

50 lines not on this page · raw message

configs/am62_pocketbeagle2_r5_defconfig +4 -1
index 90e577e8ce16..82919d559d5e 100644
@@ -14,7 +14,7 @@ CONFIG_DM_GPIO=y
 CONFIG_SPL_DM_SPI=y
 CONFIG_DEFAULT_DEVICE_TREE="k3-am62-r5-pocketbeagle2"
 CONFIG_DM_RESET=y
-CONFIG_SPL_SYS_MALLOC_F_LEN=0x7000
+CONFIG_SPL_SYS_MALLOC_F_LEN=0x8000
 CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_DRIVERS_MISC=y
@@ -41,6 +41,7 @@ CONFIG_SPL_SYS_MALLOC=y
 CONFIG_SPL_EARLY_BSS=y
 CONFIG_SPL_SYS_MMCSD_RAW_MODE=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x400
+CONFIG_SPL_I2C=y
 CONFIG_SPL_DM_MAILBOX=y
 CONFIG_SPL_DM_RESET=y
 CONFIG_SPL_POWER_DOMAIN=y
@@ -72,6 +73,8 @@ CONFIG_SPL_CLK_K3_PLL=y
 CONFIG_SPL_CLK_K3=y
 CONFIG_TI_SCI_PROTOCOL=y
 CONFIG_DA8XX_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_OMAP24XX=y
 CONFIG_DM_MAILBOX=y
 CONFIG_K3_SEC_PROXY=y
 CONFIG_SPL_MISC=y
Signature · 1 line
2.54.0
#11 lore raw

PATCH v2 5/5 k3-am62-pocketbeagle2: add support for efi capsules

In reply to [email protected]

From: Randolph Sapp <[email protected]>

Add support for EFI capsules for this device. One large caveat is that the partition holding boot binaries cannot be the ESP partition due to the following ROM limitations.

- The boot disk must be MBR
- The boot partition must be labeled 0x0c with a boot flag

A separate ESP partition should be provided for EFI capabilities.

---
 .../arm/dts/k3-am62-pocketbeagle2-u-boot.dtsi | 29 +++++++++++++++++++
 board/beagle/pocketbeagle2/pocketbeagle2.c    | 26 +++++++++++++++++
 board/beagle/pocketbeagle2/pocketbeagle2.env  |  4 +++
 configs/am62_pocketbeagle2_a53_defconfig      |  1 +
 include/configs/pocketbeagle2.h               | 25 ++++++++++++++++
 5 files changed, 85 insertions(+)
arch/arm/dts/k3-am62-pocketbeagle2-u-boot.dtsi +29 -0
index 452161115318..283e26380e48 100644
@@ -181,6 +181,17 @@
 		};
 	};
 };
+
+#include "k3-binman-capsule-r5.dtsi"
+
+// Capsule update GUIDs in string form. See pocketbeagle2.h
+#define POCKETBEAGLE2_TIBOOT3_IMAGE_GUID_STR "F0D53723-106E-5346-8A41-85EB2D07C720"
+
+&capsule_tiboot3 {
+	efi-capsule {
+		image-guid = POCKETBEAGLE2_TIBOOT3_IMAGE_GUID_STR;
+	};
+};
 #endif /* CONFIG_TARGET_AM62X_R5_POCKETBEAGLE2 */
 
 #if IS_ENABLED(CONFIG_TARGET_AM62X_A53_POCKETBEAGLE2)
@@ -304,4 +315,22 @@
 		};
 	};
 };
+
+#include "k3-binman-capsule.dtsi"
+
+// Capsule update GUIDs in string form. See pocketbeagle2.h
+#define POCKETBEAGLE2_SPL_IMAGE_GUID_STR "C73FDEA2-3964-58C8-8A25-E55102172E1D"
+#define POCKETBEAGLE2_UBOOT_IMAGE_GUID_STR "520E1012-DE6C-5992-B43A-95D53D8332F2"
+
+&capsule_tispl {
+	efi-capsule {
+		image-guid = POCKETBEAGLE2_SPL_IMAGE_GUID_STR;
+	};
+};
+
+&capsule_uboot {
+	efi-capsule {
+		image-guid = POCKETBEAGLE2_UBOOT_IMAGE_GUID_STR;
+	};
+};
 #endif /* CONFIG_TARGET_AM62X_A53_POCKETBEAGLE2 */
board/beagle/pocketbeagle2/pocketbeagle2.c +26 -0
index ea8d21310752..3ec142b1776a 100644
@@ -14,12 +14,38 @@
 #include <fdt_support.h>
 #include <spl.h>
 #include <asm/arch/k3-ddr.h>
+#include <efi_loader.h>
 
 #include "../../ti/common/board_detect.h"
 #include "pocketbeagle2_ddr.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
+struct efi_fw_image fw_images[] = {
+	{
+		.image_type_id = POCKETBEAGLE2_TIBOOT3_IMAGE_GUID,
+		.fw_name = u"POCKETBEAGLE2_TIBOOT3",
+		.image_index = 1,
+	},
+	{
+		.image_type_id = POCKETBEAGLE2_SPL_IMAGE_GUID,
+		.fw_name = u"POCKETBEAGLE2_SPL",
+		.image_index = 2,
+	},
+	{
+		.image_type_id = POCKETBEAGLE2_UBOOT_IMAGE_GUID,
+		.fw_name = u"POCKETBEAGLE2_UBOOT",
+		.image_index = 3,
+	}
+};
+
+struct efi_capsule_update_info update_info = {
+	.dfu_string = "mmc 1=tiboot3.bin fat 1 1;"
+		      "tispl.bin fat 1 1;u-boot.img fat 1 1",
+	.num_images = ARRAY_SIZE(fw_images),
+	.images = fw_images,
+};
+
 static int pocketbeagle2_get_ddr_size(void)
 {
 	// check config overrides first
board/beagle/pocketbeagle2/pocketbeagle2.env +4 -0
index 816f365083e7..930c5b466340 100644
@@ -24,3 +24,7 @@ bootpart=1:2
 bootdir=/boot
 bootmeths=script extlinux efi pxe
 rd_spec=-
+
+dfu_alt_info_ram=
+	tispl.bin ram 0x82000000 0x200000;
+	u-boot.img ram 0x82f80000 0x400000
configs/am62_pocketbeagle2_a53_defconfig +1 -0
index 8964cb3b1955..7428926a8ba6 100644
@@ -122,3 +122,4 @@ CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_LZO=y
 
 #include <configs/am62x_a53_usbdfu.config>
+#include <configs/k3_efi_capsule.config>
include/configs/pocketbeagle2.h +25 -0
index dd6956aa8b90..aed60d325742 100644
@@ -8,6 +8,31 @@
 #ifndef __CONFIG_POCKETBEAGLE2_H
 #define __CONFIG_POCKETBEAGLE2_H
 
+/**
+ * define POCKETBEAGLE2_TIBOOT3_IMAGE_GUID - firmware GUID for PocketBeagle 2
+ *                                           tiboot3.bin
+ * define POCKETBEAGLE2_SPL_IMAGE_GUID     - firmware GUID for PocketBeagle 2 SPL
+ * define POCKETBEAGLE2_UBOOT_IMAGE_GUID   - firmware GUID for PocketBeagle 2 UBOOT
+ *
+ * These GUIDs are used in capsules updates to identify the corresponding
+ * firmware object.
+ *
+ * Board developers using this as a starting reference should
+ * define their own GUIDs to ensure that firmware repositories (like
+ * LVFS) do not confuse them.
+ */
+#define POCKETBEAGLE2_TIBOOT3_IMAGE_GUID                                   \
+	EFI_GUID(0xF0D53723, 0x106E, 0x5346, 0x8A, 0x41, 0x85, 0xEB, 0x2D, \
+		 0x07, 0xC7, 0x20)
+
+#define POCKETBEAGLE2_SPL_IMAGE_GUID                                       \
+	EFI_GUID(0xC73FDEA2, 0x3964, 0x58C8, 0x8A, 0x25, 0xE5, 0x51, 0x02, \
+		 0x17, 0x2E, 0x1D)
+
+#define POCKETBEAGLE2_UBOOT_IMAGE_GUID                                     \
+	EFI_GUID(0x520E1012, 0xDE6C, 0x5992, 0xB4, 0x3A, 0x95, 0xD5, 0x3D, \
+		 0x83, 0x32, 0xF2)
+
 /* Now for the remaining common defines */
 #include <configs/ti_armv7_common.h>
 
Signature · 1 line
2.54.0
#12 lore raw
In reply to [email protected]

Hi Randolph, all,

Quoted 1 line

Add initial board support for the PocketBeagle 2 from BeagleBoard.org.

Thank you, this is very small, and best of all, it works for me, on top of master d57ea0d9edf5e5babffd280f7352f23a33a00948 from last Sunday. I slightly adjusted the board_setup_dest_addr() injection in the first patch in order to resolve a code conflict:

@@ -356,6 +361,8 @@ static int setup_dest_addr(void)
gd->relocaddr = gd->ram_top;
debug("Ram top: %08llX\n", (unsigned long long)gd->ram_top);

+ if (board_setup_dest_addr()) return board_setup_dest_addr();
+
return arch_setup_dest_addr();
}

I successfully booted this together with a version of the software ECDSA patch, but did not try to load a signed FIT image yet.

Marko

#13 lore raw
Quoted 1 line · Marko Mäkelä

I successfully booted this together with a version of the software ECDSA patch, but did not try to load a signed FIT image yet.

Is Linux flexible about the kernel and FDT load addresses, or is there a recommendation that I should follow? I see that earlier when I tested CONFIG_FIT_SIGNATURE based boot on a Phytec phyBOARD Lyra, I had used 0x81000000 and 0x83000000, respectively. I didn't test those addresses on the PocketBeagle 2 yet.

My initial experiment failed, because my image had specified the entry and load addresses 0x82000000 for the kernel, which is the same as the $loadaddr. It is thinkable that zlib inflate() returns -3 (Z_DATA_ERROR) because it is simply corrupting its input (data start: 0x820000c4) when decompressing it to 0x82000000 onwards.

Here is some output from a failing run:
=> load mmc 1:1 $loadaddr fitImage
15014068 bytes read in 180 ms (79.5 MiB/s)
=> bootm
…
Working FDT set to 88000000
Uncompressing Kernel Image to 82000000
Error: inflate() returned -3
gzip compressed: uncompress error -3
Must RESET board to recover

Below is the start of a succesful run when I invoke the image from a non-overlapping address:

=> load mmc 1:1 0x89000000 fitImage
15014068 bytes read in 179 ms (80 MiB/s)
=> setenv bootargs "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02860000 root=/dev/mmcblk1p3 ro rootfstype=ext4 fsck.repair=yes resume=/dev/mmcblk1p2 rootwait net.ifnames=0" => bootm 0x89000000
…
Verifying Hash Integrity ... sha256+ OK
Loading fdt from 0x89e430d4 to 0x88000000
Booting using the fdt blob at 0x88000000
Working FDT set to 88000000
Uncompressing Kernel Image to 82000000
Loading Device Tree to 00000000996b2000, end 00000000996c2d82 ... OK
Working FDT set to 996b2000

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 7.0.0 …

The kernel was configured as follows:

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig

It seemed to boot well into the user space of
https://www.beagleboard.org/distros/pocketbeagle-2-debian-13-5-2026-05-19-minimal-v6-12-x-ti

where I had simply replaced the bootloader files and added the signed fitImage to the root directory of the boot partition.

With best regards,

Marko