Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…oot-sunxi

For once this adds USB support for two SoCs: the H616 and the F1C100s
series. The rest is support for LPDDR3 DRAM chips on H616 boards.

Gitlab CI passed, and I booted that briefly on an H616 and an F1C200s
board. I don't have an H616 board with LPDDR3 DRAM, but reportedly that
works for Mikhail, and doesn't regress on my DDR3 boards.
  • Loading branch information
trini committed Jul 21, 2023
2 parents e7f7e2e + ecb896c commit 226ecf8
Show file tree
Hide file tree
Showing 13 changed files with 461 additions and 209 deletions.
12 changes: 7 additions & 5 deletions arch/arm/include/asm/arch-sunxi/dram_sun50i_h616.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ check_member(sunxi_mctl_ctl_reg, unk_0x4240, 0x4240);
struct dram_para {
u32 clk;
enum sunxi_dram_type type;
u8 cols;
u8 rows;
u8 ranks;
u8 bus_full_width;
u32 dx_odt;
u32 dx_dri;
u32 ca_dri;
Expand All @@ -163,6 +159,12 @@ struct dram_para {
u32 tpr12;
};

struct dram_config {
u8 cols;
u8 rows;
u8 ranks;
u8 bus_full_width;
};

static inline int ns_to_t(int nanoseconds)
{
Expand All @@ -171,6 +173,6 @@ static inline int ns_to_t(int nanoseconds)
return DIV_ROUND_UP(ctrl_freq * nanoseconds, 1000);
}

void mctl_set_timing_params(struct dram_para *para);
void mctl_set_timing_params(const struct dram_para *para);

#endif /* _SUNXI_DRAM_SUN50I_H616_H */
29 changes: 17 additions & 12 deletions arch/arm/mach-sunxi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ endif

config MACH_SUNXI_H3_H5
bool
select PHY_SUN4I_USB
select SUNXI_DE2
select SUNXI_DRAM_DW
select SUNXI_DRAM_DW_32BIT
Expand Down Expand Up @@ -236,7 +235,6 @@ config MACH_SUNIV
config MACH_SUN4I
bool "sun4i (Allwinner A10)"
select CPU_V7A
select PHY_SUN4I_USB
select DRAM_SUN4I
select SUNXI_GEN_SUN4I
select SUPPORT_SPL
Expand All @@ -247,7 +245,6 @@ config MACH_SUN5I
bool "sun5i (Allwinner A13)"
select CPU_V7A
select DRAM_SUN4I
select PHY_SUN4I_USB
select SUNXI_GEN_SUN4I
select SUPPORT_SPL
imply SPL_SYS_I2C_LEGACY
Expand All @@ -261,7 +258,6 @@ config MACH_SUN6I
select ARCH_SUPPORT_PSCI
select SPL_ARMV7_SET_CORTEX_SMPEN
select DRAM_SUN6I
select PHY_SUN4I_USB
select SPL_I2C
select SUN6I_PRCM
select SUNXI_GEN_SUN6I
Expand All @@ -277,7 +273,6 @@ config MACH_SUN7I
select ARCH_SUPPORT_PSCI
select SPL_ARMV7_SET_CORTEX_SMPEN
select DRAM_SUN4I
select PHY_SUN4I_USB
select SUNXI_GEN_SUN4I
select SUPPORT_SPL
select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
Expand All @@ -291,7 +286,6 @@ config MACH_SUN8I_A23
select CPU_V7_HAS_VIRT
select ARCH_SUPPORT_PSCI
select DRAM_SUN8I_A23
select PHY_SUN4I_USB
select SPL_I2C
select SUNXI_GEN_SUN6I
select SUPPORT_SPL
Expand All @@ -305,7 +299,6 @@ config MACH_SUN8I_A33
select CPU_V7_HAS_VIRT
select ARCH_SUPPORT_PSCI
select DRAM_SUN8I_A33
select PHY_SUN4I_USB
select SPL_I2C
select SUNXI_GEN_SUN6I
select SUPPORT_SPL
Expand All @@ -316,7 +309,6 @@ config MACH_SUN8I_A83T
bool "sun8i (Allwinner A83T)"
select CPU_V7A
select DRAM_SUN8I_A83T
select PHY_SUN4I_USB
select SPL_I2C
select SUNXI_GEN_SUN6I
select MMC_SUNXI_HAS_NEW_MODE
Expand Down Expand Up @@ -344,7 +336,6 @@ config MACH_SUN8I_R40
select SUPPORT_SPL
select SUNXI_DRAM_DW
select SUNXI_DRAM_DW_32BIT
select PHY_SUN4I_USB
imply SPL_SYS_I2C_LEGACY

config MACH_SUN8I_V3S
Expand Down Expand Up @@ -372,7 +363,6 @@ config MACH_SUN9I
config MACH_SUN50I
bool "sun50i (Allwinner A64)"
select ARM64
select PHY_SUN4I_USB
select SUN6I_PRCM
select SUNXI_DE2
select SUNXI_GEN_SUN6I
Expand All @@ -395,7 +385,6 @@ config MACH_SUN50I_H5
config MACH_SUN50I_H6
bool "sun50i (Allwinner H6)"
select ARM64
select PHY_SUN4I_USB
select DRAM_SUN50I_H6
select SUN50I_GEN_H6

Expand Down Expand Up @@ -442,7 +431,7 @@ config ARM_BOOT_HOOK_RMR
This allows both the SPL and the U-Boot proper to be entered in
either mode and switch to AArch64 if needed.

if SUNXI_DRAM_DW || DRAM_SUN50I_H6
if SUNXI_DRAM_DW || DRAM_SUN50I_H6 || DRAM_SUN50I_H616
config SUNXI_DRAM_DDR3
bool

Expand Down Expand Up @@ -487,6 +476,22 @@ config SUNXI_DRAM_H6_DDR3_1333
This option is the DDR3 timing used by the boot0 on H6 TV boxes
which use a DDR3-1333 timing.

config SUNXI_DRAM_H616_LPDDR3
bool "LPDDR3 DRAM chips on the H616 DRAM controller"
select SUNXI_DRAM_LPDDR3
depends on DRAM_SUN50I_H616
help
This option is the LPDDR3 timing used by the stock boot0 by
Allwinner.

config SUNXI_DRAM_H616_DDR3_1333
bool "DDR3-1333 boot0 timings on the H616 DRAM controller"
select SUNXI_DRAM_DDR3
depends on DRAM_SUN50I_H616
help
This option is the DDR3 timing used by the boot0 on H616 TV boxes
which use a DDR3-1333 timing.

config SUNXI_DRAM_DDR2_V3S
bool "DDR2 found in V3s chip"
select SUNXI_DRAM_DDR2
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-sunxi/dram_sun50i_h6.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ enum {
MBUS_QOS_HIGH,
MBUS_QOS_HIGHEST
};
inline void mbus_configure_port(u8 port,

static void mbus_configure_port(u8 port,
bool bwlimit,
bool priority,
u8 qos,
Expand Down
Loading

0 comments on commit 226ecf8

Please sign in to comment.