Skip to content

Commit

Permalink
x96q improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
sicXnull committed Sep 20, 2024
1 parent 8bc31a2 commit de1a195
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ diff --git a/configs/x96q_lpddr3_defconfig b/configs/x96q_lpddr3_defconfig
+ new file mode 100755
+ index 000000000..306157b84
+++ b/configs/x96q_lpddr3_defconfig
@@ -0,0 +1,31 @@
@@ -0,0 +1,34 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h313-x96q-lpddr3"
Expand Down Expand Up @@ -45,12 +45,15 @@ diff --git a/configs/x96q_lpddr3_defconfig b/configs/x96q_lpddr3_defconfig
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_MUSB_GADGET=y
+CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x40
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
diff --git a/arch/arm/dts/sun50i-h313-x96q-lpddr3.dts b/arch/arm/dts/sun50i-h313-x96q-lpddr3.dts
new file mode 100644
index 000000000..306157b84
--- /dev/null
+++ b/arch/arm/dts/sun50i-h313-x96q-lpddr3.dts
@@ -0,0 +1,162 @@
@@ -0,0 +1,191 @@
+// SPDX-License-Identifier: (GPL-2.0+ or MIT)
+/*
+ * Author: [email protected]
Expand All @@ -65,14 +68,15 @@ index 000000000..306157b84
+#include <dt-bindings/leds/common.h>
+
+/ {
+ model = "hechuang,x96q LPDDR3";
+ model = "hechuang,x96-q LPDDR3 v1.3";
+ compatible = "hechuang,x96-q", "allwinner,sun50i-h616";
+
+ aliases {
+ mmc0 = &mmc0;
+ mmc1 = &mmc1;
+ mmc2 = &mmc2;
+ ethernet0 = &emac1;
+ ethernet1 = &wlan;
+ serial0 = &uart0;
+ };
+
Expand All @@ -99,6 +103,25 @@ index 000000000..306157b84
+ regulator-max-microvolt = <5000000>;
+ regulator-always-on;
+ };
+
+ reg_vcc_wifi: reg_vcc_wifi {
+ compatible = "regulator-fixed";
+ regulator-name = "vcc-wifi";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ gpio = <&pio 6 18 GPIO_ACTIVE_HIGH>; /* PG18 WL_REG_ON */
+ regulator-always-on;
+ enable-active-high;
+ status = "okay";
+ };
+
+ wifi_pwrseq: wifi_pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ clocks = <&rtc CLK_OSC32K_FANOUT>;
+ clock-names = "ext_clock";
+ pinctrl-names = "default";
+ //pinctrl-0 = <&clk_losc>; /* PG10 with MUX3 set */ - not implemented yet in uboot
+ };
+};
+
+&cpu0 {
Expand Down Expand Up @@ -133,9 +156,9 @@ index 000000000..306157b84
+};
+
+&mdio1 {
+ rmii_phy: ethernet-phy@0 {
+ rmii_phy: ethernet-phy@16 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <0>;
+ reg = <16>;
+ };
+};
+
Expand All @@ -148,9 +171,18 @@ index 000000000..306157b84
+
+&mmc1 {
+ vmmc-supply = <&reg_dldo2>;
+ broken-cd;
+ vqmmc-supply = <&reg_vcc_wifi>;
+ mmc-pwrseq = <&wifi_pwrseq>;
+ bus-width = <4>;
+ non-removable;
+ status = "okay";
+
+ wlan: wifi@1 {
+ reg = <1>;
+ interrupt-parent = <&pio>;
+ interrupts = <6 15 IRQ_TYPE_EDGE_RISING>; /* PG15 WL_HOSTWAKE*/
+ interrupt-names = "host-wake";
+ };
+};
+
+&mmc2 {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/arch/arm/dts/sun50i-h616.dtsi b/arch/arm/dts/sun50i-h616.dtsi
--- a/arch/arm/dts/sun50i-h616.dtsi
+++ b/arch/arm/dts/sun50i-h616.dtsi
@@ -324,7 +324,7 @@
pinctrl-names = "default";
pinctrl-0 = <&mmc2_pins>;
status = "disabled";
- max-frequency = <150000000>;
+ max-frequency = <12000000>;
cap-sd-highspeed;
cap-mmc-highspeed;
mmc-ddr-3_3v;
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
--- a/drivers/mmc/sunxi_mmc.c 2024-01-08 16:37:48.000000000 +0100
+++ b/drivers/mmc/sunxi_mmc.c 2024-03-08 10:51:44.771585037 +0100
@@ -542,7 +542,7 @@
cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;

cfg->f_min = 400000;
- cfg->f_max = 52000000;
+ cfg->f_max = 12000000;

if (mmc_resource_init(sdc_no) != 0)
return NULL;

0 comments on commit de1a195

Please sign in to comment.