-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'for-next/rockchip' into next
- Loading branch information
Showing
28 changed files
with
1,162 additions
and
367 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
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 @@ | ||
sdram-init.bin |
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,3 @@ | ||
# SPDX-License-Identifier: GPL-2.0-only | ||
obj-y += board.o | ||
lwl-y += lowlevel.o |
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,88 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
/* | ||
* Board code for the WolfVision PF5 mainboard. | ||
* | ||
* Copyright (C) 2024 WolfVision GmbH. | ||
*/ | ||
#include <common.h> | ||
#include <deep-probe.h> | ||
#include <globalvar.h> | ||
#include <init.h> | ||
|
||
#include <boards/wolfvision/common.h> | ||
#include <mach/rockchip/bbu.h> | ||
|
||
#define PF5_IO_EXPANDER_FILENAME "rk3568-wolfvision-pf5-io-expander.dtbo" | ||
#define PF5_IO_EXPANDER_DATA __dtbo_rk3568_wolfvision_pf5_io_expander_start | ||
|
||
enum { | ||
PF5_HWID_CHANNEL_MAINBOARD = 1, | ||
PF5_HWID_CHANNEL_MODULE = 2, | ||
}; | ||
|
||
extern char PF5_IO_EXPANDER_DATA[]; | ||
|
||
static const struct wv_rk3568_extension pf5_extensions[] = { | ||
{ | ||
.adc_chan = PF5_HWID_CHANNEL_MAINBOARD, | ||
.name = "mainboard", | ||
.overlays = { | ||
[0] = { .name = "PF5 DC V1.0 A", }, | ||
[4] = { .name = "PF5 DC V1.1 A", }, | ||
}, | ||
}, | ||
{ | ||
.adc_chan = PF5_HWID_CHANNEL_MODULE, | ||
.name = "module", | ||
.overlays = { | ||
[0] = { .name = "PF5 IO Expander V1.0 A", | ||
.filename = PF5_IO_EXPANDER_FILENAME, | ||
.data = PF5_IO_EXPANDER_DATA, | ||
}, | ||
[16] = { .name = "no", }, | ||
}, | ||
}, | ||
}; | ||
|
||
static int pf5_probe(struct device *dev) | ||
{ | ||
char *pf5_overlays = NULL; | ||
int ret; | ||
|
||
barebox_set_model("WolfVision PF5"); | ||
barebox_set_hostname("PF5"); | ||
|
||
ret = wolfvision_register_ethaddr(); | ||
if (ret) | ||
pr_warning("failed to register MAC addresses\n"); | ||
|
||
rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0"); | ||
|
||
ret = wolfvision_rk3568_detect_hw( | ||
pf5_extensions, ARRAY_SIZE(pf5_extensions), &pf5_overlays); | ||
if (ret) | ||
pr_warning("failed to detect HW\n"); | ||
|
||
if (pf5_overlays) | ||
globalvar_set("of.overlay.filepattern", pf5_overlays); | ||
|
||
free(pf5_overlays); | ||
|
||
return 0; | ||
} | ||
|
||
static const struct of_device_id pf5_of_match[] = { | ||
{ | ||
.compatible = "wolfvision,rk3568-pf5", | ||
}, | ||
{ /* sentinel */ }, | ||
}; | ||
|
||
static struct driver_d pf5_board_driver = { | ||
.name = "board-wolfvision-pf5", | ||
.probe = pf5_probe, | ||
.of_compatible = pf5_of_match, | ||
}; | ||
coredevice_platform_driver(pf5_board_driver); | ||
|
||
BAREBOX_DEEP_PROBE_ENABLE(pf5_of_match); |
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,36 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
#include <common.h> | ||
#include <linux/sizes.h> | ||
#include <asm/barebox-arm-head.h> | ||
#include <asm/barebox-arm.h> | ||
#include <mach/rockchip/hardware.h> | ||
#include <mach/rockchip/atf.h> | ||
#include <debug_ll.h> | ||
#include <mach/rockchip/rockchip.h> | ||
|
||
extern char __dtb_rk3568_wolfvision_pf5_start[]; | ||
|
||
ENTRY_FUNCTION(start_rk3568_wolfvision_pf5, r0, r1, r2) | ||
{ | ||
/* | ||
* Enable vccio4 1.8V and vccio5 1.8V | ||
* FIXME: This is done by the io-domain driver as well, but there | ||
* currently is no mechanism to make sure the driver gets probed | ||
* before its consumers. Remove this setup once this issue is | ||
* resolved. | ||
*/ | ||
writel(RK_SETBITS(0x30), 0xfdc20140); | ||
|
||
/* | ||
* Image execution starts at 0x0, but this is used for ATF and | ||
* OP-TEE later, so move away from here. | ||
*/ | ||
if (current_el() == 3) | ||
relocate_to_adr_full(RK3568_BAREBOX_LOAD_ADDRESS); | ||
else | ||
relocate_to_current_adr(); | ||
|
||
setup_c(); | ||
|
||
rk3568_barebox_entry(__dtb_rk3568_wolfvision_pf5_start); | ||
} |
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
137 changes: 137 additions & 0 deletions
137
arch/arm/dts/rk3568-wolfvision-pf5-io-expander-upstream.dtso
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,137 @@ | ||
// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) | ||
/* | ||
* Device tree overlay for the WolfVision PF5 IO Expander board. | ||
* | ||
* Copyright (C) 2024 WolfVision GmbH. | ||
*/ | ||
|
||
/dts-v1/; | ||
/plugin/; | ||
|
||
#include <dt-bindings/clock/rk3568-cru.h> | ||
#include <dt-bindings/gpio/gpio.h> | ||
#include <dt-bindings/interrupt-controller/irq.h> | ||
#include <dt-bindings/pinctrl/rockchip.h> | ||
|
||
&{/} { | ||
gmac0_clkin: external-gmac0-clock { | ||
compatible = "fixed-clock"; | ||
clock-frequency = <50000000>; | ||
clock-output-names = "gmac0_clkin"; | ||
#clock-cells = <0>; | ||
}; | ||
|
||
usb_host_vbus: usb-host-vbus-regulator { | ||
compatible = "regulator-fixed"; | ||
enable-active-high; | ||
gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&usb_host_vbus_en>; | ||
regulator-name = "usb_host_vbus"; | ||
regulator-min-microvolt = <5000000>; | ||
regulator-max-microvolt = <5000000>; | ||
vin-supply = <&vcc5v_in>; | ||
}; | ||
|
||
vcc1v8_eth: vcc1v8-eth-regulator { | ||
compatible = "regulator-fixed"; | ||
enable-active-high; | ||
gpio = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&vcc1v8_eth_en>; | ||
regulator-always-on; | ||
regulator-boot-on; | ||
regulator-name = "1v8_eth"; | ||
regulator-min-microvolt = <1800000>; | ||
regulator-max-microvolt = <1800000>; | ||
vin-supply = <&vcc3v3_sys>; | ||
}; | ||
|
||
vcc3v3_eth: vcc3v3-eth-regulator { | ||
compatible = "regulator-fixed"; | ||
enable-active-low; | ||
gpio = <&gpio0 RK_PC0 GPIO_ACTIVE_LOW>; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&vcc3v3_eth_enn>; | ||
regulator-always-on; | ||
regulator-boot-on; | ||
regulator-name = "3v3_eth"; | ||
regulator-min-microvolt = <3300000>; | ||
regulator-max-microvolt = <3300000>; | ||
vin-supply = <&vcc3v3_sys>; | ||
}; | ||
}; | ||
|
||
&gmac0 { | ||
assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, | ||
<&cru SCLK_GMAC0>; | ||
assigned-clock-parents = <&cru SCLK_GMAC0_RMII_SPEED>, | ||
<&gmac0_clkin>; | ||
clock_in_out = "input"; | ||
phy-handle = <&dp83826>; | ||
phy-mode = "rmii"; | ||
phy-supply = <&vcc3v3_eth>; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&gmac0_miim | ||
&gmac0_clkinout | ||
&gmac0_rx_er | ||
&gmac0_rx_bus2 | ||
&gmac0_tx_bus2>; | ||
status = "okay"; | ||
}; | ||
|
||
&mdio0 { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
dp83826: ethernet-phy@0 { | ||
compatible = "ethernet-phy-ieee802.3-c22"; | ||
reg = <0x0>; | ||
interrupt-parent = <&gpio0>; | ||
interrupts = <RK_PD3 IRQ_TYPE_EDGE_FALLING>; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <ð_wake_intn ð_phy_rstn>; | ||
reset-assert-us = <1000>; | ||
reset-deassert-us = <2000>; | ||
reset-gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_LOW>; | ||
wakeup-source; | ||
}; | ||
}; | ||
|
||
&pinctrl { | ||
ethernet { | ||
eth_wake_intn: eth-wake-intn-pinctrl { | ||
rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>; | ||
}; | ||
|
||
eth_phy_rstn: eth-phy-rstn-pinctrl { | ||
rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>; | ||
}; | ||
|
||
vcc1v8_eth_en: vcc1v8-eth-en-pinctrl { | ||
rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; | ||
}; | ||
|
||
vcc3v3_eth_enn: vcc3v3-eth-enn-pinctrl { | ||
rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>; | ||
}; | ||
}; | ||
|
||
usb { | ||
usb_host_vbus_en: usb-host-vbus-en-pinctrl { | ||
rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>; | ||
}; | ||
}; | ||
}; | ||
|
||
&usb_host1_xhci { | ||
maximum-speed = "high-speed"; | ||
phys = <&usb2phy0_host>; | ||
phy-names = "usb2-phy"; | ||
status = "okay"; | ||
}; | ||
|
||
&usb2phy0_host { | ||
phy-supply = <&usb_host_vbus>; | ||
status = "okay"; | ||
}; |
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,11 @@ | ||
// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) | ||
/* | ||
* Device tree overlay for the WolfVision PF5 IO Expander board. | ||
* | ||
* Copyright (C) 2024 WolfVision GmbH. | ||
*/ | ||
|
||
/dts-v1/; | ||
/plugin/; | ||
|
||
#include "rk3568-wolfvision-pf5-io-expander-upstream.dtso" |
Oops, something went wrong.