Skip to content

Commit b7bc750

Browse files
committed
CCU/CCM base is different on T113S
1 parent 4390ca6 commit b7bc750

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

fel-spiflash.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ void fel_writel(feldev_handle *dev, uint32_t addr, uint32_t val);
8383
#define SUNIV_PLL6_CTL (0x01c20000 + 0x28)
8484
#define SUNIV_AHB_APB_CFG (0x01c20000 + 0x54)
8585

86-
#define H6_CCM_SPI0_CLK (0x03001000 + 0x940)
87-
#define H6_CCM_SPI_BGR (0x03001000 + 0x96C)
86+
#define H6_CCM_SPI0_CLK (ccm_base(dev) + 0x940)
87+
#define H6_CCM_SPI_BGR (ccm_base(dev) + 0x96C)
8888
#define H6_CCM_SPI0_GATE_RESET (1 << 0 | 1 << 16)
8989

9090
#define SUNIV_GPC_SPI0 (2)
@@ -156,6 +156,18 @@ static uint32_t spi_base(feldev_handle *dev)
156156
}
157157
}
158158

159+
static uint32_t ccm_base(feldev_handle *dev)
160+
{
161+
soc_info_t *soc_info = dev->soc_info;
162+
switch (soc_info->soc_id) {
163+
case 0x1859: /* D1/D1s/R528/T113-S3 */
164+
// CCU
165+
return 0x02001000;
166+
default:
167+
return 0x03001000;
168+
}
169+
}
170+
159171
/*
160172
* Configure pin function on a GPIO port
161173
*/

0 commit comments

Comments
 (0)