Hi Daniel,
The BSP33.0 uses the release/bsp33.0-2020.04 branch version
https://github.com/nxp-auto-linux/u-boot/tree/release/bsp33.0-2020.04
I found that the GPIO number of PH07 in this version is not 119 but 109.
#define SIUL2_0_BASE_ADDR 0x4009C000
#define SIUL2_1_BASE_ADDR 0x44010000
#define SIUL2_0_MSCR_BASE (SIUL2_0_BASE_ADDR + 0x00000240)
#define SIUL2_1_MSCR_BASE (SIUL2_1_BASE_ADDR + 0x00000400)
/* gpio output (open drain) */
#define SIUL2_MSCR_GPIO_OUT_OD (SIUL2_MSCR_S32_G1_MUX_ID_0 | \
SIUL2_MSCR_S32_G1_ODE | SIUL2_MSCR_S32_G1_OBE)
static inline void *s32g2_mscr_reg(void __iomem *base_addr, unsigned int offset)
{
uintptr_t addr;
addr = (uintptr_t)base_addr + offset * 4;
return (void *)addr;
}
/* MSCR 0-101 */
#define SIUL2_0_MSCRn(i) s32g2_mscr_reg((void __iomem *)SIUL2_0_MSCR_BASE, i)
/* MSCR 112-190 */
#define SIUL2_1_MSCRn(i) s32g2_mscr_reg((void __iomem *)SIUL2_1_MSCR_BASE, (i-112))
static inline unsigned s32g2_pad_to_gpio(unsigned pad)
{
if ((pad >=0) && (pad <= 101)) {
/* PAD 0-101 --> GPIO 0-101 */
return pad;
} else if ((pad >=112) && (pad <= 122)) {
/* PAD 112-122 --> GPIO 102-112 */
return (pad-10);
} else if ((pad >=144) && (pad <= 190)) {
/* PAD 144-190 --> GPIO 113-159 */
return (pad-31);
}
return 200;
}
#define S32G2_GPIO(i) s32g2_pad_to_gpio(i)
...
int board_late_init(void)
{
...
/* PH07 */
writel(SIUL2_MSCR_GPIO_OUT_OD, SIUL2_0_MSCRn(119));
gpio_request(S32G2_GPIO(119), "PH07");
gpio_direction_output(S32G2_GPIO(119), 0);
}
If the PH07 pin is not set in U-BOOT, the kernel can boot normally.
But as long as the PH07 pin is set in U-BOOT, it will cause a kernel panic
U-Boot 2020.04+g9cdfca686e (Jun 10 2022 - 11:46:41 +0000)
CPU: NXP S32G274A rev. 2.0
Model: NXP S32G274A-RDB2
DRAM: 3.5 GiB
MMC: FSL_SDHC: 0
Loading Environment from MMC... OK
Using external clock for PCIe0, CRNS
Configuring PCIe0 as RootComplex(x2)
Using external clock for PCIe1, CRNS
Frequency 100Mhz configured for PCIe1
Configuring PCIe1 as RootComplexSGMII(x2) [XPCS0 1G, XPCS1 1G]
ERROR: Invalid XPCS config on PCIe1
XPCS1 power-up failed
Setting PCI Device and Vendor IDs to 0x4002:0x1957
PCIe0: Link up! X1, Gen2
Device 'pcie@44100000': seq 1 is in use by 'pci_0:0.0'
Setting PCI Device and Vendor IDs to 0x4002:0x1957
PCIe1: Link up! X1, Gen3
BusDevFun VendorId DeviceId Device Class Sub-Class
______________________________________________________________________
pcie@40400000 RootComplex
| `-- 00:00.00 0x1957 0x4002 Bridge device 0x04
| |-- 01:00.000x1b4b 0x2b43 Network controller 0x00
| `-- 01:00.010x1b4b 0x2b44 Network controller 0x00
pcie@44100000 RootComplex
| `-- 02:00.00 0x1957 0x4002 Bridge device 0x04
| `-- 03:00.000x1344 0x6001 Mass storage controller 0x08
In: serial@401c8000
Out: serial@401c8000
Err: serial@401c8000
Board revision: RDB2/GLDBOX Revision D
Net: EQOS phy: rgmii @ 3
Warning: eth_eqos (eth0) using random MAC address - 62:91:7d:20:50:f3
eth0: eth_eqosSerDes 0 was not initialized
Emac 2 not initialized
Invalid sgmii configuration for emac index 2
Hit any key to stop autoboot: 0
SerDes 0 was not initialized
Emac 2 not initialized
Invalid sgmii configuration for emac index 2
switch to partitions #0, OK
mmc0 is current device
13824008 bytes read in 610 ms (21.6 MiB/s)
Booting from mmc ...
44079 bytes read in 18 ms (2.3 MiB/s)
## Flattened Device Tree blob at 83000000
Booting using the fdt blob at 0x83000000
Using Device Tree in place at 0000000083000000, end 000000008300dc2e
Invalid PCIe1 lanes config
Failed to set mode for PCIe1
Invalid SerDes1 mode
Failed to set mode for SerDes1
SerDes 0 was not initialized
Emac 2 not initialized
Invalid sgmii configuration for emac index 2
DT: Disabling PFE
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 5.10.109-rt65+g0bace7fde5f5 (oe-user@oe-host) (aarch64-fsl-linux-gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP PREEMPT Fri Jun 24 15:01:08 UTC 2022
[ 0.000000] Machine model: NXP S32G274A-RDB2
[ 0.000000] earlycon: linflex0 at MMIO 0x00000000401c8000 (options '115200n8')
[ 0.000000] printk: bootconsole [linflex0] enabled
[ 0.000000] SError Interrupt on CPU0, code 0xbf000002 -- SError
[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.10.109-rt65+g0bace7fde5f5 #1
[ 0.000000] Hardware name: NXP S32G274A-RDB2 (DT)
[ 0.000000] pstate: 60000085 (nZCv daIf -PAN -UAO -TCO BTYPE=--)
[ 0.000000] pc : setup_arch+0x164/0x58c
[ 0.000000] lr : setup_arch+0x15c/0x58c
[ 0.000000] sp : ffffffc010c93ef0
[ 0.000000] x29: ffffffc010c93ef0 x28: 0000000080b40018
[ 0.000000] x27: 00000000ffaa27f0 x26: 0000000000000000
[ 0.000000] x25: 00000000ffb2f400 x24: 00000000ffdf1298
[ 0.000000] x23: ffffffc010d33000 x22: ffffffc010c9e380
[ 0.000000] x21: fffffffefe600094 x20: ffffffc010ce7088
[ 0.000000] x19: ffffffc010000000 x18: 0000000000000030
[ 0.000000] x17: 0000000000001800 x16: 0000000000000000
[ 0.000000] x15: ffffffc010c9e7e8 x14: ffffffffffffffff
[ 0.000000] x13: 0000000000000000 x12: 0000000000000028
[ 0.000000] x11: 0000000000000015 x10: 0101010101010101
[ 0.000000] x9 : 3334ff6b6e6e6f5e x8 : 7f7f7f7f7f7f7f7f
[ 0.000000] x7 : 736d647164676e62 x6 : 000006161d090b74
[ 0.000000] x5 : 740b091d16060000 x4 : 0000000000000000
[ 0.000000] x3 : ce6ded8ca0000000 x2 : 000000000000000c
[ 0.000000] x1 : 0000000000000000 x0 : 0000000000000080
[ 0.000000] Kernel panic - not syncing:
[ 0.000000] Asynchronous SError Interrupt
[ 0.000000] ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]---
What could be the reason for this?
Thanks,
Peter