Skip to content

Commit

Permalink
Merge branch 'for-next/protonic'
Browse files Browse the repository at this point in the history
  • Loading branch information
saschahauer committed Oct 7, 2021
2 parents ab7647d + 1768de7 commit 89737fc
Show file tree
Hide file tree
Showing 8 changed files with 806 additions and 33 deletions.
150 changes: 118 additions & 32 deletions arch/arm/boards/protonic-imx6/board.c

Large diffs are not rendered by default.

81 changes: 81 additions & 0 deletions arch/arm/boards/protonic-imx6/flash-header-jozacp.imxcfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
soc imx6
loadaddr 0x80000000
ivtofs 0x400

#include "ddr3-defines.imxcfg"
#include "padsetup-ul.imxcfg"

/* Set Read data delay 3 delay units for all bits */
wm 32 0x021b081c 0x33333333
wm 32 0x021b0820 0x33333333

/* MDMISC No addr mirror, 1 WALAT, 5 RALAT, DDR3 mode */
wm 32 0x021b0018 0x00011740

/* CSCR: Configuration mode */
wm 32 0x021b001c 0x00008000

wm 32 0x021b000c MDCFG0_2G_400MHZ
wm 32 0x021b0010 MDCFG1_400MHZ
wm 32 0x021b0014 MDCFG2_400MHZ

/* MDRWD */
wm 32 0x021b002c 0x000026d2

wm 32 0x021b0030 MDOR_2G_400MHZ
wm 32 0x021b0008 MDOTC_400MHZ
wm 32 0x021b0004 MDPDC_400MHZ
wm 32 0x021b0040 0x00000047 /* MDASP_512MIB */
wm 32 0x021b0000 MDCTL_2G_16BIT

/* DDR3 MR config */
wm 32 0x021b001c DDR3_MR2_400MHZ_RTT_120

/*
* DDR3 chip MR3, n = 3, vvvv = 0 (no configurable function of interest).
*/
wm 32 0x021b001c 0x00008033

wm 32 0x021b001c DDR3_MR1_RTT_120_ODS_40
wm 32 0x021b001c DDR3_MR0_400MHZ

/*
* ZQ calibration, n = 0x10 (Precharge all):
* Bit 10 = 1: Start ZQ calibration
* REGISTER: 0x04008040
*/
wm 32 0x021b001c 0x04008040

/* MPZQHWCTRL */
wm 32 0x021b0800 0xa1390003 /* ZQ mode = 3 force calibration */

wm 32 0x021b0020 MDREF_64KHZ

wm 32 0x021b0818 0x00000117 /* MPODTCTRL_ODT_120 */

wm 32 0x021b083c MPDGCTRL0_CH0_400MHZ

/* MPRDDLCTL, MPWRDLCTL */
wm 32 0x021b0848 0x40404040 /* TODO. Read delay line conf. */
wm 32 0x021b0850 0x40404040 /* For now set all to 50%. */

/* MPWLDECTRL0 */
wm 32 0x021b080c 0x001f001f /* TODO. Write level delay control */

/* MPMUR0 */
wm 32 0x021b08b8 0x00000800 /* Force measurement on delay lines */

/* MDSCR */
wm 32 0x021b001c 0x00000000 /* Disable configuration req */

/* MAPSR */
wm 32 0x021b0404 0x00011007 /* 0x0001...? FIXME: Disable powersaving for now */

/* Enable all clocks */
wm 32 0x020c4068 0xffffffff
wm 32 0x020c406c 0xffffffff
wm 32 0x020c4070 0xffffffff
wm 32 0x020c4074 0xffffffff
wm 32 0x020c4078 0xffffffff
wm 32 0x020c407c 0xffffffff
wm 32 0x020c4080 0xffffffff
20 changes: 20 additions & 0 deletions arch/arm/boards/protonic-imx6/lowlevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ extern char __dtb_z_imx6dl_vicut1_start[];
extern char __dtb_z_imx6qp_prtwd3_start[];
extern char __dtb_z_imx6qp_vicutp_start[];
extern char __dtb_z_imx6ul_prti6g_start[];
extern char __dtb_z_imx6ull_jozacp_start[];

ENTRY_FUNCTION(start_imx6q_prti6q, r0, r1, r2)
{
Expand Down Expand Up @@ -189,3 +190,22 @@ ENTRY_FUNCTION(start_imx6ul_prti6g, r0, r1, r2)

imx6ul_barebox_entry(fdt);
}

ENTRY_FUNCTION(start_imx6ull_jozacp, r0, r1, r2)
{
void *fdt;

imx6ul_cpu_lowlevel_init();

/* Disconnect USDHC2 from SD card */
writel(0x5, 0x020e0178);
writel(0x5, 0x020e017c);
writel(0x5, 0x020e0180);
writel(0x5, 0x020e0184);
writel(0x5, 0x020e0188);
writel(0x5, 0x020e018c);

fdt = __dtb_z_imx6ull_jozacp_start + get_runtime_offset();

imx6ul_barebox_entry(fdt);
}
3 changes: 2 additions & 1 deletion arch/arm/dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ lwl-$(CONFIG_MACH_PROTONIC_IMX6) += \
imx6dl-vicut1.dtb.o \
imx6qp-prtwd3.dtb.o \
imx6qp-vicutp.dtb.o \
imx6ul-prti6g.dtb.o
imx6ul-prti6g.dtb.o \
imx6ull-jozacp.dtb.o
lwl-$(CONFIG_MACH_PROTONIC_IMX8M) += imx8mm-prt8mm.dtb.o
lwl-$(CONFIG_MACH_RADXA_ROCK) += rk3188-radxarock.dtb.o
lwl-$(CONFIG_MACH_PHYTEC_SOM_RK3288) += rk3288-phycore-som.dtb.o
Expand Down
11 changes: 11 additions & 0 deletions arch/arm/dts/imx6dl-prtvt7.dts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,14 @@

#include <arm/imx6dl-prtvt7.dts>
#include "imx6qdl-prti6q-emmc.dtsi"

&state_emmc {
magic = <0x72766467>;

brand {
reg = <0x1b0 0x4>;
type = "enum32";
names = "unbranded", "agco", "vermeer";
default = <0>;
};
};
47 changes: 47 additions & 0 deletions arch/arm/dts/imx6ull-jozacp.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/dts-v1/;

#include "imx6ull-jozacp.dtsi"

/ {
chosen {
stdout-path = &uart1;

environment@0 {
compatible = "barebox,environment";
device-path = &usdhc1, "partname:barebox-environment";
};
};

reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;

/* Address will be determined by the bootloader */
ramoops {
compatible = "ramoops";
};
};

reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;

/* Address will be determined by the bootloader */
ramoops {
compatible = "ramoops";
};
};
};

&usdhc1 {
#address-cells = <1>;
#size-cells = <1>;

partition@40000 {
label = "barebox-environment";
reg = <0x40000 0x80000>;
};
};
Loading

0 comments on commit 89737fc

Please sign in to comment.