-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arch: arm: Add Analog Devices SC5xx machine type
Add support for the SC5xx machine type from Analog Devices. This includes support for the SC57x, SC58x, SC59x, and SC59x-64 SoCs, which have many common features such as common ADI IP blocks, and SHARC DSP cores. This commit introduces core functionality required for all boards using an SC5xx SoC, such as: - SPL configuration - Required CPU hooks such as reset - Boot ROM interaction to load the stage 2 bootloader in the reference configuration. Other options are possible but not officially supported at this time - SoC-common configuration expected to be reused by all boards - Early initialization for system clocks and DDR controller Co-developed-by: Greg Malysa <greg.malysa@timesys.com> Signed-off-by: Greg Malysa <greg.malysa@timesys.com> Co-developed-by: Ian Roberts <ian.roberts@timesys.com> Signed-off-by: Ian Roberts <ian.roberts@timesys.com> Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com> Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com> Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com> Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
- Loading branch information
1 parent
054eb87
commit 48a0b0b
Showing
26 changed files
with
3,041 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-or-later */ | ||
/* | ||
* (C) Copyright 2022 - Analog Devices, Inc. | ||
* | ||
* Written and/or maintained by Timesys Corporation | ||
* | ||
* Contact: Nathan Barrett-Morrison <nathan.morrison@timesys.com> | ||
* Contact: Greg Malysa <greg.malysa@timesys.com> | ||
*/ | ||
#ifndef ARCH_ADI_SC5XX_SC5XX_H | ||
#define ARCH_ADI_SC5XX_SC5XX_H | ||
|
||
#include <linux/types.h> | ||
|
||
#define TWI0_CLKDIV 0x31001400 // TWI0 SCL Clock Divider Register | ||
#define TWI1_CLKDIV 0x31001500 // TWI1 SCL Clock Divider Register | ||
#define TWI2_CLKDIV 0x31001600 // TWI2 SCL Clock Divider Register | ||
|
||
const char *sc5xx_get_boot_mode(u32 *bmode); | ||
void sc5xx_enable_rgmii(void); | ||
|
||
void sc5xx_enable_ns_sharc_access(uintptr_t securec0_base); | ||
void sc5xx_disable_spu0(uintptr_t spu0_start, uintptr_t spu0_end); | ||
void sc5xx_enable_pmu(void); | ||
|
||
/** | ||
* Per-SoC init function to be used to initialize hw-specific things. Examples: | ||
* enable PMU on armv7, enable coresight timer on armv8, etc. | ||
*/ | ||
void sc5xx_soc_init(void); | ||
|
||
/* | ||
* Reconfigure SPI memory map region for OSPI use. The adi-spi3 driver | ||
* does not use the memory map, while the OSPI driver requires it. Only | ||
* available on sc59x and sc59x-64 | ||
*/ | ||
void sc59x_remap_ospi(void); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-or-later */ | ||
/* | ||
* (C) Copyright 2022 - Analog Devices, Inc. | ||
* | ||
* Written and/or maintained by Timesys Corporation | ||
* | ||
* Contact: Nathan Barrett-Morrison <nathan.morrison@timesys.com> | ||
* Contact: Greg Malysa <greg.malysa@timesys.com> | ||
*/ | ||
|
||
#ifndef BOARD_ADI_COMMON_SOC_H | ||
#define BOARD_ADI_COMMON_SOC_H | ||
|
||
#include <phy.h> | ||
|
||
void fixup_dp83867_phy(struct phy_device *phydev); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-or-later */ | ||
/* | ||
* (C) Copyright 2022 - Analog Devices, Inc. | ||
* | ||
* Written and/or maintained by Timesys Corporation | ||
* | ||
* Contact: Nathan Barrett-Morrison <nathan.morrison@timesys.com> | ||
* Contact: Greg Malysa <greg.malysa@timesys.com> | ||
*/ | ||
#ifndef ARCH_ADI_SC5XX_SPL_H | ||
#define ARCH_ADI_SC5XX_SPL_H | ||
|
||
#include <linux/types.h> | ||
|
||
struct adi_boot_args { | ||
phys_addr_t addr; | ||
u32 flags; | ||
u32 cmd; | ||
}; | ||
|
||
extern u32 bmode; | ||
|
||
/** | ||
* This table stores the arguments to the rom boot function per bootmode, | ||
* and it is populated per SoC in the corresponding SoC support file (sc7x, sc58x, | ||
* and so on). | ||
*/ | ||
extern const struct adi_boot_args adi_rom_boot_args[8]; | ||
|
||
/** | ||
* Struct layout for the boot config is also specific to an SoC, so you should | ||
* only access it inside an SoC-specific boot hook function, which will be called | ||
* from the boot rom while going from SPL to proper u-boot | ||
*/ | ||
struct ADI_ROM_BOOT_CONFIG; | ||
int32_t adi_rom_boot_hook(struct ADI_ROM_BOOT_CONFIG *cfg, int32_t cause); | ||
|
||
typedef void (*adi_rom_boot_fn)(void *address, uint32_t flags, int32_t count, | ||
void *hook, uint32_t command); | ||
|
||
extern adi_rom_boot_fn adi_rom_boot; | ||
|
||
#endif |
Oops, something went wrong.