-
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.
Merge patch series "arm: Add Analog Devices SC5xx Machine Type"
Greg Malysa <greg.malysa@timesys.com> says: This series adds support for the ADI SC5xx machine type and includes two core drivers that are required for being able to boot any board--a UART driver, the gptimer driver which is used as a clock reference (CNTVCNT is not supported on the armv7 sc5xx SoCs) and the clock tree driver. Our corresponding Linux support relies on u-boot configuring the clocks correctly before booting, so it is not possible to boot any board without the CGU/CDU configuration happening here. There are also no board files, device trees, or defconfigs included here, but some common definitions that will be used to build board files currently are. The sc5xx SoCs themselves include many armv7 families (sc57x, sc58x, and sc594) all using an ARM Cortex-A5, and one armv8 family (sc598) indended to be a drop-in replacement for the SC594 in terms of peripherals, with a Cortex-A55 instead. Some of the configuration code in dmcinit and clkinit is quite scary and causes a lot of checkpatch violations. It is modified from code initially provided by ADI, but it has not been fully rewritten. There's a question of how important it is to clean up this code--it has some quality violations, but it has been in use (including in production) for over two years and is known to work for performing the low level SoC initialization, while a rewrite might introduce timing or sequence bugs that could take a significant amount of time to detect in the future.
- Loading branch information
Showing
43 changed files
with
5,027 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.