Tom Rini | dec7ea0 | 2024-05-20 13:35:03 -0600 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | /* |
| 3 | * (C) Copyright 2024 - Analog Devices, Inc. |
| 4 | * |
| 5 | * Written and/or maintained by Timesys Corporation |
| 6 | * |
| 7 | * Contact: Nathan Barrett-Morrison <nathan.morrison@timesys.com> |
| 8 | * Contact: Greg Malysa <greg.malysa@timesys.com> |
| 9 | */ |
| 10 | |
| 11 | #include <asm/io.h> |
| 12 | #include <asm/arch-adi/sc5xx/sc5xx.h> |
| 13 | #include <asm/arch-adi/sc5xx/spl.h> |
| 14 | |
| 15 | #define REG_SPU0_SECUREC0 0x3108B980 |
| 16 | #define REG_PADS0_PCFG0 0x31004604 |
| 17 | #define REG_SPU0_SECUREP_START 0x3108BA00 |
| 18 | #define REG_SPU0_SECUREP_END 0x3108BD24 |
| 19 | |
| 20 | #define REG_SCB5_SPI2_OSPI_REMAP 0x30400000 |
| 21 | #define BITM_SCB5_SPI2_OSPI_REMAP_REMAP 0x00000003 |
| 22 | #define ENUM_SCB5_SPI2_OSPI_REMAP_OSPI0 0x00000001 |
| 23 | |
| 24 | adi_rom_boot_fn adi_rom_boot = (adi_rom_boot_fn)0x000000e9; |
| 25 | |
| 26 | void sc5xx_enable_rgmii(void) |
| 27 | { |
| 28 | writel((readl(REG_PADS0_PCFG0) | 0xc), REG_PADS0_PCFG0); |
| 29 | } |
| 30 | |
| 31 | void sc59x_remap_ospi(void) |
| 32 | { |
| 33 | clrsetbits_le32(REG_SCB5_SPI2_OSPI_REMAP, |
| 34 | BITM_SCB5_SPI2_OSPI_REMAP_REMAP, |
| 35 | ENUM_SCB5_SPI2_OSPI_REMAP_OSPI0); |
| 36 | } |
| 37 | |
| 38 | void sc5xx_soc_init(void) |
| 39 | { |
| 40 | sc5xx_enable_ns_sharc_access(REG_SPU0_SECUREC0); |
| 41 | sc5xx_disable_spu0(REG_SPU0_SECUREP_START, REG_SPU0_SECUREP_END); |
| 42 | sc5xx_enable_pmu(); |
| 43 | } |