Imini Swan1 W28-MB-V1.0 调试记录

331 阅读3分钟

Imini Swan1 W28-MB-V1.0 调试记录

ethernet1对应gmac1 PHY外设复位引脚:

snps,reset-gpio = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>;
sdio_pwrseq: sdio-pwrseq {
		status = "okay";
		compatible = "mmc-pwrseq-simple";
		clocks = <&rk809 1>;
		clock-names = "ext_clock";
		post-power-on-delay-ms = <0xc8>;
		power-off-delay-us = <0xc8>;
		pinctrl-names = "default";
		pinctrl-0 = <&wifi_reg_on_h>;
		reset-gpios = <&gpio2 RK_PB1 GPIO_ACTIVE_LOW>;
	};

	wireless_wlan: wireless-wlan {
		compatible = "wlan-platdata";
		rockchip,grf = <&grf>;
		wifi_chip_type = "ap6255";
		status = "okay";
		pinctrl-names = "default";
		pinctrl-0 = <&wifi_host_wake_h>;
		sdio_vref = <0x708>;
		WIFI,host_wake_irq = <&gpio2 RK_PB2 GPIO_ACTIVE_HIGH>;
	};

	cashbox: cashbox {
		compatible = "rockchip,cashbox-gpio";
		pinctrl-names = "default";
		pinctrl-0 = <&cashbox_gpio_en>;
		ctl-gpio1 = <&gpio4 RK_PC2 GPIO_ACTIVE_HIGH>;
		ctl-gpio2 = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
		status = "okay";
	};

	usb_hub_ctrl: usb-hub-ctrl {
		compatible = "usb-hub-ctrl";
		pinctrl-names = "default";
		pinctrl-0 = <&hub_vcc_en_pin>;
		hub-vcc-pin = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
		host-b-vcc-pin = <&gpio4 RK_PC5 GPIO_ACTIVE_HIGH>;
		hub-rst-pin1 = <&gpio4 RK_PD0 GPIO_ACTIVE_HIGH>;
		hub-vcc-en-pin = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
		device-host-pin = <&gpio3 RK_PC4 GPIO_ACTIVE_LOW>;
		status = "okay";
	};

	neostra_gpio: neostra-gpio {
		compatible = "neostra,neostra-gpio";
		pinctrl-names = "default";
		rj11-vcc-pin = <&gpio4 RK_PC3 GPIO_ACTIVE_HIGH>;
		rj11txrx5v-pin = <&gpio4 RK_PD0 GPIO_ACTIVE_HIGH>;
		rj11txrx12v-pin = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>;
		status = "okay";
	};

	usbprinter_gpio: usbprinter-gpio {
		compatible = "neostra,usbprinter-gpio";
		pinctrl-names = "default";
		pinctrl-0 = <&usbprinter_pin>;
		hub-vcc-pin = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>;
		hub-rst-pin = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>;
		scanbox-vcc-pin = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>;
		printer-vcc-pin = <&gpio2 RK_PD7 GPIO_ACTIVE_HIGH>;
		status = "okay";
	};

	usbpwr5v0: usbpwr5v0 {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;	//<0x02 0x1b 0x00>
		pinctrl-names = "default";
		pinctrl-0 = <&usbpwr5v0_en>;
		regulator-name = "usbpwr5v0";
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <0x4c4b40>;
		regulator-max-microvolt = <0x4c4b40>;
		vin-supply = <&vcc12v_dcin>;
	};
&gmac1 {
	assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
	assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>;
	assigned-clock-rates = <0>, <125000000>;
	clock_in_out = "output";
	phy-mode = "rgmii";
	pinctrl-names = "default";
	pinctrl-0 = <&gmac1m1_miim
		     &gmac1m1_tx_bus2
		     &gmac1m1_rx_bus2
		     &gmac1m1_rgmii_clk
		     &gmac1m1_rgmii_bus>;
	snps,reset-gpio = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>;
	snps,reset-active-low;
	/* Reset time is 20ms, 100ms for rtl8211f */
	snps,reset-delays-us = <0 20000 100000>;
	tx_delay = <0x42>;
	rx_delay = <0x28>;
	phy-handle = <&rgmii_phy1>;
	status = "okay";
};

&mdio1 {
	rgmii_phy1: ethernet-phy@0 {
		compatible = "ethernet-phy-ieee802.3-c22";
		reg = <0>;
		realtek,led-data = <0x6d60>;
	};
};
&i2c5 {
	status = "okay";

	hym8563@51 {
		compatible = "haoyu,hym8563";
		status = "okay";
		reg = <0x51>;
	};
};
&sdmmc1 {
    max-frequency = <150000000>;
    supports-sdio;
    bus-width = <4>;
    disable-wp;
    cap-sd-highspeed;
    cap-sdio-irq;
    keep-power-in-suspend;
    pinctrl-names = "default";
    pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>;
    sd-uhs-sdr104;
    mmc-pwrseq = <&sdio_pwrseq>;
    non-removable;
    status = "okay";
};

&uart1 {
	pinctrl-names = "default";
 	pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn &uart1m0_rtsn>;
 	uart-has-rtscts;
 	status = "okay";
 
 	bluetooth {
 		compatible = "brcm,bcm43438-bt";
 		clocks = <&rk809 1>;
 		clock-names = "lpo";
		device-wakeup-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>;
		host-wakeup-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>;
		shutdown-gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&bt_host_wake &bt_wake &bt_enable>;
 		vbat-supply = <&vcc3v3_sys>;
 		vddio-supply = <&vcc_1v8>;
 	};
};
&pinctrl {

	ethernet {
		eth_phy_rst: eth_phy_rst {	//<0x03 0x08 0x00 0x13f>;
			rockchip,pins = <3 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	pmic {
		pmic_int: pmic_int {
			rockchip,pins =
				<0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
		};
	};

	usb {
		vcc5v0_usb_host_en: vcc5v0_usb_host_en {	//<0x00 0x06 0x00 0x13f>;
			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		vcc5v0_usb_otg_en: vcc5v0_usb_otg_en {	//<0x00 0x05 0x00 0x13f>;
			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	bt {
		bt_enable: bt_enable {
			rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		bt_host_wake: bt_host_wake {
			rockchip,pins = <2 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		bt_wake: bt_wake {
			rockchip,pins = <2 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
	
	wifi {
		wifi_reg_on_h: wifi_reg_on_h {
			rockchip,pins = <2 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		wifi_host_wake_h: wifi_host_wake_h {
			rockchip,pins = <2 RK_PB2 RK_FUNC_GPIO &pcfg_pull_down>;
		};
	};

	cashbox {
		cashbox_gpio_en: cashbox_gpio_en {	//<0x04 0x12 0x00 0x13f 0x04 0x1a 0x00 0x13f>
			rockchip,pins = <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>,
							<4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	usb_hub_ctrl {
		hub_vcc_en_pin: hub_vcc_en_pin {	//<0x00 0x15 0x00 0x13f 0x04 0x18 0x00 0x13f 0x04 0x19 0x00 0x13f>;
			rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>,
							<4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>,
							<4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	usbprinter_gpio {
			usbprinter_pin: usbprinter_pin {	//<0x03 0x04 0x00 0x13f 0x02 0x1e 0x00 0x13f 0x03 0x13 0x00 0x13f 0x02 0x1f 0x00 0x13f>;
				rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>,
								<2 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>,
								<3 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>,
								<2 RK_PD7 RK_FUNC_GPIO &pcfg_pull_none>;
			};
		};

	usbpwr5v0 {

		usbpwr5v0_en: usbpwr5v0_en {	//<0x02 0x1b 0x00 0x13f>;
			rockchip,pins = <0x02 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

};

rj10接口4个脚定义和控制

RJ10-4pin: 输出电源控制 LOW=0v,HIGH=5v
rj10-vcc-pin = <&gpio4 RK_PC3 GPIO_ACTIVE_HIGH>;
RJ10-2,3脚 的电压等级:HIGH=5V
rj10txrx5v-pin = <&gpio4 RK_PD0 GPIO_ACTIVE_HIGH>;
RJ-2,3 脚 的电压等级:HIGH=12V
rj10txrx12v-pin = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>;

综上三个引脚功能: RJ10的1脚为GND,2、3脚为TX、RX,4脚为电源,由rj10-vcc-pin控制。 而通信接口电平由rj10txrx5v-pin和rj10txrx12v-pin组合决定是5V还是12V。

USB接口定义和控制

板上的USB用5V开关电源变换器使能总控制:

hub-vcc-en-pin = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
gpiochip0 line 21

USB3.0端口HOST输出电源控制:

device-host-pin = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>;
gpiochip3 line 20

USB2.0端口输出电源控制

左边1#

hub-vcc-pin = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
gpiochip4 line 22

右边2#

host-b-vcc-pin =  = <&gpio4 RK_PC5 GPIO_ACTIVE_HIGH>;
gpiochip4 line 21

若要开机即可完成开启usb电源与端口,可在启动服务中打开引脚

nano /etc/custom_service/start_service.sh

加入以下语句即可

# For swan1-w28 board USB power and switch contrl 
# USB 5V Power buick ON
gpioset 0 21=1
# USB3.0 Port ON
gpioset 3 20=1
# USB2.0 Port ON
gpioset 4 21=1
gpioset 4 22=1

rj11插座6个脚定义及控制:

ctl-gpio1 = <&gpio4 RK_PC2 GPIO_ACTIVE_HIGH>;
ctl-gpio2 = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;

P1,P6=GND,P2,P5=ctl-gpio1漏极OC驱动输出,P3=固定12V,P4=ctl-gpio2输出HIGH=3V,