您尚未登录。

楼主 # 2021-10-18 00:12:52

qianniao29
会员
注册时间: 2020-05-19
已发帖子: 29
积分: 105.5

用v3x做了个小板,分享一下

之前从晕哥那里买了两片v3x,做了个小板,打算搞个掌机玩玩。打样回来焊接了下,编了个uboot烧录sd卡,断断续续调试了几周,终于可以正常启动了。分享下原理图,后续再继续调试。由于本人的水平比较有限,也是业余搞搞,所以做得也比较业余,分享出来仅供大家讨论。
uboot_setup.png
20211018001424.jpg
Game_V3x_V1.pdf

最近编辑记录 qianniao29 (2021-10-18 00:17:41)

离线

楼主 #1 2021-10-18 09:14:57

qianniao29
会员
注册时间: 2020-05-19
已发帖子: 29
积分: 105.5

Re: 用v3x做了个小板,分享一下

使用buildroot-2021.08进行uboot、kernel和文件系统的构建


uboot的配置:v3x-game_defconfig

CONFIG_ARM=y
CONFIG_ARCH_SUNXI=y
CONFIG_DEFAULT_DEVICE_TREE="sun8i-v3x-game"
CONFIG_SPL=y
CONFIG_MACH_SUN8I_V3S=y
CONFIG_SUNXI_DRAM_DDR3_1333=y
CONFIG_DRAM_CLK=504
CONFIG_DRAM_ODT_EN=y
CONFIG_I2C0_ENABLE=y
CONFIG_SPL_I2C_SUPPORT=y
# CONFIG_NETDEVICES is not set
CONFIG_AXP209_POWER=y
CONFIG_AXP_DCDC2_VOLT=1250
CONFIG_AXP_DCDC3_VOLT=3300
CONFIG_CONS_INDEX=2

dts文件:

// SPDX-License-Identifier: (GPL-2.0+ OR X11)
/*
 * Copyright 2019 Icenowy Zheng <icenowy@aosc.io>
 */

/dts-v1/;
#include "sun8i-v3.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	model = "v3x handheld game console";
	compatible = "v3x,v3x-game", "allwinner,sun8i-s3";

	aliases {
		serial0 = &uart0;
		serial1 = &uart1;
		serial2 = &uart2;
	};

	chosen {
		stdout-path = "serial1:115200n8";
	};

	reg_vcc5v0: vcc5v0 {
		compatible = "regulator-fixed";
		regulator-name = "vcc5v0";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
	};

	reg_vcc_wifi: vcc-wifi {
		compatible = "regulator-fixed";
		regulator-name = "vcc-wifi";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&pio 1 2 GPIO_ACTIVE_LOW>; /* PB2 WIFI-EN */
		vin-supply = <&reg_dcdc3>;
		startup-delay-us = <200000>;
	};

	wifi_pwrseq: wifi_pwrseq {
		compatible = "mmc-pwrseq-simple";
		reset-gpios = <&pio 1 3 GPIO_ACTIVE_LOW>; /* PB3 WIFI-RST */
		post-power-on-delay-ms = <200>;
	};
};

&emac {
	phy-handle = <&int_mii_phy>;
	phy-mode = "mii";
	status = "okay";
};

&i2c0 {
	status = "okay";

	axp209: pmic@34 {
		compatible = "x-powers,axp203",
			     "x-powers,axp209";
		reg = <0x34>;
		interrupt-parent = <&gic>;
		interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
		interrupt-controller;
		#interrupt-cells = <1>;
	};
};

&lradc {
	vref-supply = <&reg_ldo2>;
	status = "okay";

	button-200 {
		label = "Setup";
		linux,code = <KEY_SETUP>;
		channel = <0>;
		voltage = <190000>;
	};
};

&mmc0 {
	vmmc-supply = <&reg_dcdc3>;
	bus-width = <4>;
	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
	status = "okay";
};

&mmc1 {
	vmmc-supply = <&reg_vcc_wifi>;
	vqmmc-supply = <&reg_dcdc3>;
	mmc-pwrseq = <&wifi_pwrseq>;
	bus-width = <4>;
	non-removable;
	status = "okay";
};

&pio {
	vcc-pd-supply = <&reg_dcdc3>;
	vcc-pe-supply = <&reg_ldo3>;
	uart1_pins: uart1-pins {
				pins = "PG6", "PG7";
				function = "uart1";
			};
};

#include "axp209.dtsi"

&ac_power_supply {
	status = "okay";
};

&reg_dcdc2 {
	regulator-always-on;
	regulator-min-microvolt = <1250000>;
	regulator-max-microvolt = <1250000>;
	regulator-name = "vdd-sys-cpu-ephy";
};

&reg_dcdc3 {
	regulator-always-on;
	regulator-min-microvolt = <3300000>;
	regulator-max-microvolt = <3300000>;
	regulator-name = "vcc-3v3";
};

&reg_ldo1 {
	regulator-name = "vdd-rtc";
};

&reg_ldo2 {
	regulator-always-on;
	regulator-min-microvolt = <3000000>;
	regulator-max-microvolt = <3000000>;
	regulator-name = "avcc";
};

&reg_ldo3 {
	regulator-min-microvolt = <2800000>;
	regulator-max-microvolt = <2800000>;
	regulator-name = "avdd-dovdd-2v8-csi";
	regulator-soft-start;
	regulator-ramp-delay = <1600>;
};

&reg_ldo4 {
	regulator-min-microvolt = <1800000>;
	regulator-max-microvolt = <1800000>;
	regulator-name = "dvdd-1v8-csi";
};

&spi0 {
	status = "okay";

	flash@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "winbond,w25q256", "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <40000000>;
	};
};

&uart1 {
	pinctrl-0 = <&uart1_pins>;
	pinctrl-names = "default";
	status = "okay";
};

&usb_otg {
	dr_mode = "host";
	status = "okay";
};

&usbphy {
	usb0_vbus-supply = <&reg_vcc5v0>;
	status = "okay";
};

最近编辑记录 qianniao29 (2021-10-19 00:00:56)

离线

#2 2021-10-18 10:07:23

sblpp
会员
注册时间: 2018-02-14
已发帖子: 164
积分: 64

Re: 用v3x做了个小板,分享一下

漂亮,芯片多少钱买的啊?
也想打个板学习学习。

离线

楼主 #3 2021-10-18 12:51:04

qianniao29
会员
注册时间: 2020-05-19
已发帖子: 29
积分: 105.5

Re: 用v3x做了个小板,分享一下

40多一片,咸鱼上能搜到

离线

楼主 #4 2021-10-18 23:58:09

qianniao29
会员
注册时间: 2020-05-19
已发帖子: 29
积分: 105.5

Re: 用v3x做了个小板,分享一下

简单编了个kernel,版本Linux 5.13.9,可以正常进入Linux。
使用configs下的suxi_deconfig
dts与uboot差不多,都是基于pinecube改的

// SPDX-License-Identifier: (GPL-2.0+ OR X11)
/*
 * Copyright 2019 Icenowy Zheng <icenowy@aosc.io>
 */

/dts-v1/;
#include "sun8i-v3.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	model = "v3x handheld game console";
	compatible = "v3x,v3x-game", "sochip,s3", "allwinner,sun8i-v3";

	aliases {
		serial0 = &uart0;
		serial1 = &uart1;
		serial2 = &uart2;
	};

	chosen {
		stdout-path = "serial1:115200n8";
	};

	reg_vcc5v0: vcc5v0 {
		compatible = "regulator-fixed";
		regulator-name = "vcc5v0";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
	};

	reg_vcc_wifi: vcc-wifi {
		compatible = "regulator-fixed";
		regulator-name = "vcc-wifi";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&pio 1 2 GPIO_ACTIVE_LOW>; /* PB2 WIFI-EN */
		vin-supply = <&reg_dcdc3>;
		startup-delay-us = <200000>;
	};

	wifi_pwrseq: wifi_pwrseq {
		compatible = "mmc-pwrseq-simple";
		reset-gpios = <&pio 1 3 GPIO_ACTIVE_LOW>; /* PB3 WIFI-RST */
		post-power-on-delay-ms = <200>;
	};
};

&emac {
	phy-handle = <&int_mii_phy>;
	phy-mode = "mii";
	status = "okay";
};

&i2c0 {
	status = "okay";

	axp209: pmic@34 {
		reg = <0x34>;
		interrupt-parent = <&nmi_intc>;
		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
	};
};


&lradc {
	vref-supply = <&reg_ldo2>;
	status = "okay";

	button-200 {
		label = "Setup";
		linux,code = <KEY_SETUP>;
		channel = <0>;
		voltage = <190000>;
	};
};

&mmc0 {
	vmmc-supply = <&reg_dcdc3>;
	bus-width = <4>;
	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
	status = "okay";
};

&mmc1 {
	vmmc-supply = <&reg_vcc_wifi>;
	vqmmc-supply = <&reg_dcdc3>;
	mmc-pwrseq = <&wifi_pwrseq>;
	bus-width = <4>;
	non-removable;
	status = "okay";
};

&pio {
	vcc-pd-supply = <&reg_dcdc3>;
	vcc-pe-supply = <&reg_ldo3>;
	uart1_pins: uart1-pins {
		pins = "PG6", "PG7";
		function = "uart1";
	};
};

#include "axp209.dtsi"

&ac_power_supply {
	status = "okay";
};

&reg_dcdc2 {
	regulator-always-on;
	regulator-min-microvolt = <1250000>;
	regulator-max-microvolt = <1250000>;
	regulator-name = "vdd-sys-cpu-ephy";
};

&reg_dcdc3 {
	regulator-always-on;
	regulator-min-microvolt = <3300000>;
	regulator-max-microvolt = <3300000>;
	regulator-name = "vcc-3v3";
};

&reg_ldo1 {
	regulator-name = "vdd-rtc";
};

&reg_ldo2 {
	regulator-always-on;
	regulator-min-microvolt = <3000000>;
	regulator-max-microvolt = <3000000>;
	regulator-name = "avcc";
};

&reg_ldo3 {
	regulator-min-microvolt = <2800000>;
	regulator-max-microvolt = <2800000>;
	regulator-name = "avdd-dovdd-2v8-csi";
	regulator-soft-start;
	regulator-ramp-delay = <1600>;
};

&reg_ldo4 {
	regulator-min-microvolt = <1800000>;
	regulator-max-microvolt = <1800000>;
	regulator-name = "dvdd-1v8-csi";
};

&spi0 {
	status = "okay";

	flash@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "winbond,w25q256", "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <40000000>;
	};
};

&uart1 {
	pinctrl-0 = <&uart1_pins>;
	pinctrl-names = "default";
	status = "okay";
};

&usb_otg {
	dr_mode = "host";
	status = "okay";
};

&usbphy {
	usb0_vbus-supply = <&reg_vcc5v0>;
	status = "okay";
};

离线

楼主 #5 2021-10-19 00:05:02

qianniao29
会员
注册时间: 2020-05-19
已发帖子: 29
积分: 105.5

Re: 用v3x做了个小板,分享一下

将uboot,kernel和文件系统烧录到sd卡,参照论坛上的方法:
    1) 删除TF卡所有分区
    2) 将uboot写入到sd卡8k偏移处(必须8K偏移, brom龟腚的)。
        sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
    3) 建立第一个分区,大小32M(可以随意填写), 格式FAT16, 把zImage, sun8i-v3s-licheepi-zero-dock.dtb拷贝到 这个分区
    4) 建立第二个分区,用尽剩余空间,格式ext4, 把buildroot产生的rootfs.tar解压到该分区根目录
        tar xvf output/images/rootfs.tar -C /挂载的tf卡第二个分区目录

下一步准备调试下网口和屏幕,困了,睡觉了。。。

启动log如下:

=> bootm 0x41000000 - 41800000
## Booting kernel from Legacy Image at 41000000 ...
   Image Name:   Linux-5.13.9
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4875264 Bytes = 4.6 MiB
   Load Address: 41000000
   Entry Point:  41000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 41800000
   Booting using the fdt blob at 0x41800000
   Loading Kernel Image
   Loading Device Tree to 42dfa000, end 42dffd26 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.13.9 (ymc@LAPTOP-Q3C3C9T3) (arm-linux-gnueabihf-gcc (GCC) 11.0.1 20210310 (experimental) [master revision 5987d8a79cda1069c774e5c302d5597310270026], GNU ld (Linaro_Binutils-2021.03) 2.36.50.20210310) #2 SMP Mon Oct 18 23:02:26 CST 2021
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: v3x handheld game console
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] cma: Reserved 16 MiB at 0x46c00000
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000040000000-0x0000000047ffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x0000000047ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x0000000047ffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: Using PSCI v0.1 Function IDs from DT
[    0.000000] percpu: Embedded 15 pages/cpu s31500 r8192 d21748 u61440
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS1,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw vt.global_cursor_default=0
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 101016K/131072K available (7168K kernel code, 849K rwdata, 1972K rodata, 1024K init, 240K bss, 13672K reserved, 16384K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] random: get_random_bytes called from start_kernel+0x348/0x4f0 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000001] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000020] Switching to timer-based delay loop, resolution 41ns
[    0.000216] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000502] Console: colour dummy device 80x30
[    0.000573] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000601] pid_max: default: 32768 minimum: 301
[    0.000736] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.000759] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001559] CPU: Testing write buffer coherency: ok
[    0.001912] /cpus/cpu@0 missing clock-frequency property
[    0.001961] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002664] Setting up static identity map for 0x40100000 - 0x40100060
[    0.002879] rcu: Hierarchical SRCU implementation.
[    0.003364] smp: Bringing up secondary CPUs ...
[    0.003389] smp: Brought up 1 node, 1 CPU
[    0.003404] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.003416] CPU: All CPU(s) started in HYP mode.
[    0.003423] CPU: Virtualization extensions available.
[    0.004010] devtmpfs: initialized
[    0.007386] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.007692] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.007735] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.008562] pinctrl core: initialized pinctrl subsystem
[    0.009780] NET: Registered protocol family 16
[    0.011230] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.012358] thermal_sys: Registered thermal governor 'step_wise'
[    0.012607] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.012644] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.029884] SCSI subsystem initialized
[    0.030670] usbcore: registered new interface driver usbfs
[    0.030739] usbcore: registered new interface driver hub
[    0.030807] usbcore: registered new device driver usb
[    0.031009] mc: Linux media interface: v0.10
[    0.031055] videodev: Linux video capture interface: v2.00
[    0.031183] pps_core: LinuxPPS API ver. 1 registered
[    0.031200] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.031225] PTP clock support registered
[    0.031827] Advanced Linux Sound Architecture Driver Initialized.
[    0.033026] clocksource: Switched to clocksource arch_sys_counter
[    0.043175] NET: Registered protocol family 2
[    0.043354] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.043861] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.043915] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.043943] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.043970] TCP: Hash tables configured (established 1024 bind 1024)
[    0.044100] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.044156] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.044387] NET: Registered protocol family 1
[    0.045500] RPC: Registered named UNIX socket transport module.
[    0.045539] RPC: Registered udp transport module.
[    0.045549] RPC: Registered tcp transport module.
[    0.045558] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.046999] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    0.053963] NFS: Registering the id_resolver key type
[    0.054055] Key type id_resolver registered
[    0.054067] Key type id_legacy registered
[    0.054198] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)
[    0.054219] io scheduler mq-deadline registered
[    0.054229] io scheduler kyber registered
[    0.059329] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.121490] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.123975] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pg not found, using dummy regulator
[    0.125075] printk: console [ttyS1] disabled
[    0.145376] 1c28400.serial: ttyS1 at MMIO 0x1c28400 (irq = 43, base_baud = 1500000) is a U6_16550A
[    0.763542] printk: console [ttyS1] enabled
[    0.772079] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pc not found, using dummy regulator
[    0.781078] sun6i-spi 1c68000.spi: Failed to request TX DMA channel
[    0.787421] sun6i-spi 1c68000.spi: Failed to request RX DMA channel
[    0.795185] libphy: Fixed MDIO Bus: probed
[    0.800543] dwmac-sun8i 1c30000.ethernet: IRQ eth_wake_irq not found
[    0.807003] dwmac-sun8i 1c30000.ethernet: IRQ eth_lpi not found
[    0.813041] dwmac-sun8i 1c30000.ethernet: No regulator found
[    0.818788] dwmac-sun8i 1c30000.ethernet: PTP uses main clock
[    0.824991] dwmac-sun8i 1c30000.ethernet: No HW DMA feature register supported
[    0.832234] dwmac-sun8i 1c30000.ethernet: RX Checksum Offload Engine supported
[    0.839510] dwmac-sun8i 1c30000.ethernet: COE Type 2
[    0.844494] dwmac-sun8i 1c30000.ethernet: TX Checksum insertion supported
[    0.851280] dwmac-sun8i 1c30000.ethernet: Normal descriptors
[    0.856951] dwmac-sun8i 1c30000.ethernet: Chain mode enabled
[    0.862617] dwmac-sun8i 1c30000.ethernet: device MAC address e2:f1:79:ff:18:86
[    0.870424] libphy: stmmac: probed
[    0.874983] dwmac-sun8i 1c30000.ethernet: Found internal PHY node
[    0.881548] libphy: mdio_mux: probed
[    0.885256] dwmac-sun8i 1c30000.ethernet: Switch mux to internal PHY
[    0.891650] dwmac-sun8i 1c30000.ethernet: Powering internal PHY
[    0.899379] libphy: mdio_mux: probed
[    0.903429] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.909967] ehci-platform: EHCI generic platform driver
[    0.915378] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.921601] ohci-platform: OHCI generic platform driver
[    0.927498] usb_phy_generic usb_phy_generic.0.auto: supply vcc not found, using dummy regulator
[    0.937562] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    0.943447] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[    0.952483] hub 1-0:1.0: USB hub found
[    0.956440] hub 1-0:1.0: 1 port detected
[    0.963163] sun6i-rtc 1c20400.rtc: registered as rtc0
[    0.968268] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01T00:03:03 UTC (183)
[    0.976416] sun6i-rtc 1c20400.rtc: RTC enabled
[    0.981063] i2c /dev entries driver
[    0.984866] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pb not found, using dummy regulator
[    0.995235] axp20x-i2c 0-0034: AXP20x variant AXP209 found
[    1.008193] input: axp20x-pek as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0034/axp20x-pek/input/input0
[    1.031497] random: fast init done
[    1.048188] vdd-rtc: supplied by regulator-dummy
[    1.053728] avcc: supplied by regulator-dummy
[    1.062695] avdd-dovdd-2v8-csi: Bringing 1300000uV into 2800000-2800000uV
[    1.075071] avdd-dovdd-2v8-csi: supplied by regulator-dummy
[    1.080789] dvdd-1v8-csi: Bringing 3300000uV into 1800000-1800000uV
[    1.089408] dvdd-1v8-csi: supplied by regulator-dummy
[    1.095347] ldo5: supplied by regulator-dummy
[    1.101967] vdd-sys-cpu-ephy: supplied by regulator-dummy
[    1.108280] vcc-3v3: supplied by regulator-dummy
[    1.116082] axp20x-i2c 0-0034: AXP20X driver loaded
[    1.122126] axp20x-ac-power-supply axp20x-ac-power-supply: DMA mask not set
[    1.130303] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.139554] sun4i-ss 1c15000.crypto: Die ID 3
[    1.144421] sun8i-v3s-pinctrl 1c20800.pinctrl: supply vcc-pf not found, using dummy regulator
[    1.156798] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    1.163231] usbcore: registered new interface driver usbhid
[    1.168825] usbhid: USB HID core driver
[    1.173181] axp20x-adc axp20x-adc: DMA mask not set
[    1.185377] NET: Registered protocol family 17
[    1.189959] Key type dns_resolver registered
[    1.194511] Registering SWP/SWPB emulation handler
[    1.206769] vcc-wifi: supplied by vcc-3v3
[    1.213993] input: 1c22800.lradc as /devices/platform/soc/1c22800.lradc/input/input1
[    1.222373] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    1.258446] ALSA device list:
[    1.261489]   No soundcards found.
[    1.267530] sunxi-mmc 1c10000.mmc: allocated mmc-pwrseq
[    1.279946] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.291661] mmc0: new high speed SDHC card at address aaaa
[    1.298463] mmcblk0: mmc0:aaaa SL08G 7.40 GiB 
[    1.305492]  mmcblk0: p1 p2
[    1.735596] sunxi-mmc 1c10000.mmc: initialized, max. request size: 16384 KB
[    1.757726] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null). Quota mode: disabled.
[    1.768082] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    1.780786] devtmpfs: mounted
[    1.785377] Freeing unused kernel memory: 1024K
[    1.790237] Run /sbin/init as init process
[    1.921714] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null). Quota mode: disabled.
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Starting mdev... OK
[    2.217175] random: crng init done
Saving random seed: OK
Starting network: OK

Welcome to Buildroot
buildroot login: 

最近编辑记录 qianniao29 (2021-10-19 00:05:26)

离线

#6 2021-10-19 00:20:14

哇酷小二
wechat微信:whycan_cn
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,378
积分: 1902
个人网站

Re: 用v3x做了个小板,分享一下

感谢楼主热心分享,到时候也可以试一试这个:


(V3s/V3x/S3/S3L/R11通吃)小智V3x开发板smallwitpi lite u-boot/linux/buildroot测试
https://whycan.com/t_7248.html

一键buildroot打包生成tfcard/spi flash固件

最近编辑记录 哇酷小二 (2021-10-19 00:21:08)





离线

楼主 #7 2021-10-21 21:05:28

qianniao29
会员
注册时间: 2020-05-19
已发帖子: 29
积分: 105.5

Re: 用v3x做了个小板,分享一下

哇酷小二 说:

感谢楼主热心分享,到时候也可以试一试这个:


(V3s/V3x/S3/S3L/R11通吃)小智V3x开发板smallwitpi lite u-boot/linux/buildroot测试
https://whycan.com/t_7248.html

一键buildroot打包生成tfcard/spi flash固件

试了这个,可以用,SD卡启动需要在driver中打开sd host驱动

离线

楼主 #8 2021-10-21 21:12:34

qianniao29
会员
注册时间: 2020-05-19
已发帖子: 29
积分: 105.5

Re: 用v3x做了个小板,分享一下

网口调试:
打开driver中的sun8i emac,编译报错
In function ‘parse_phy_pins’,
inlined from ‘sun8i_emac_eth_of_to_plat’ at drivers/net/sun8i_emac.c:972:3:
include/linux/compiler.h:346:45: error: call to ‘__compiletime_assert_0’ declared with attribute error: missing pinmux value for Ethernet pins
346 | compiletime_assert(condition, msg, compiletime_assert, __COUNTER)

修改sun8i_emac.c

static int parse_phy_pins(struct udevice *dev)
{
    ......

    if (IS_ENABLED(CONFIG_MACH_SUNXI_H3_H5))
        iomux = SUN8I_IOMUX_H3;
    else if (IS_ENABLED(CONFIG_MACH_SUN8I_R40))
        iomux = SUN8I_IOMUX_R40;
    else if (IS_ENABLED(CONFIG_MACH_SUN50I_H6))
        iomux = SUN8I_IOMUX_H6;
    else if (IS_ENABLED(CONFIG_MACH_SUN50I_H616))
        iomux = SUN8I_IOMUX_H616;
    else if (IS_ENABLED(CONFIG_MACH_SUN8I_A83T))
        iomux = SUN8I_IOMUX;
    else if (IS_ENABLED(CONFIG_MACH_SUN50I))
        iomux = SUN8I_IOMUX;
    //新增
    else if (IS_ENABLED(CONFIG_MACH_SUN8I_V3S))
        iomux = SUN8I_IOMUX;
    ......
}

修改sun8i-v3x-game.dts文件

&emac {
    compatible = "allwinner,sun8i-h3-emac"; //compatible = "allwinner,sun8i-v3s-emac";为compatible = "allwinner,sun8i-h3-emac";
    pinctrl-0 = <&emac_rgmii_pins>;
    phy-handle = <&int_mii_phy>;
    phy-mode = "mii";
    allwinner,leds-active-high; //led高电平点亮
    status = "okay";
};

2. 定义pin
emac_rgmii_pins: emac0@0 {
        allwinner,pins = "PD0", "PD1", "PD2", "PD3",
                       "PD4", "PD5", "PD7",
                       "PD8", "PD9", "PD10";
        function = "emac";
        drive-strength = <40>;

修改drivers/clk/sunxi/clk_v3s.c文件,增减CLK_BUS_EMAC,CLK_BUS_EPHY,RST_BUS_EMAC,RST_BUS_EPHY的定义

static struct ccu_clk_gate v3s_gates[] = {
	[CLK_BUS_MMC0]		= GATE(0x060, BIT(8)),
	[CLK_BUS_MMC1]		= GATE(0x060, BIT(9)),
	[CLK_BUS_MMC2]		= GATE(0x060, BIT(10)),
	[CLK_BUS_EMAC]		= GATE(0x060, BIT(17)),
	[CLK_BUS_SPI0]		= GATE(0x060, BIT(20)),
	[CLK_BUS_OTG]		= GATE(0x060, BIT(24)),

	[CLK_BUS_UART0]		= GATE(0x06c, BIT(16)),
	[CLK_BUS_UART1]		= GATE(0x06c, BIT(17)),
	[CLK_BUS_UART2]		= GATE(0x06c, BIT(18)),

	[CLK_BUS_EPHY]		= GATE(0x070, BIT(0)),

	[CLK_SPI0]		= GATE(0x0a0, BIT(31)),

	[CLK_USB_PHY0]          = GATE(0x0cc, BIT(8)),
};

static struct ccu_reset v3s_resets[] = {
	[RST_USB_PHY0]		= RESET(0x0cc, BIT(0)),

	[RST_BUS_MMC0]		= RESET(0x2c0, BIT(8)),
	[RST_BUS_MMC1]		= RESET(0x2c0, BIT(9)),
	[RST_BUS_MMC2]		= RESET(0x2c0, BIT(10)),
	[RST_BUS_EMAC]		= RESET(0x2c0, BIT(17)),
	[RST_BUS_SPI0]		= RESET(0x2c0, BIT(20)),
	[RST_BUS_OTG]		= RESET(0x2c0, BIT(24)),

	[RST_BUS_EPHY]		= RESET(0x2c8, BIT(2)),

	[RST_BUS_UART0]		= RESET(0x2d8, BIT(16)),
	[RST_BUS_UART1]		= RESET(0x2d8, BIT(17)),
	[RST_BUS_UART2]		= RESET(0x2d8, BIT(18)),
};

重新编译烧录,启动后设置板卡的mac和ip即可ping通电脑

setenv ethaddr 00:11:22:33:44:55
setenv ipaddr 192.168.1.110

离线

楼主 #9 2021-10-21 21:13:40

qianniao29
会员
注册时间: 2020-05-19
已发帖子: 29
积分: 105.5

Re: 用v3x做了个小板,分享一下

kernel不需要做修改,进去后就可以用

离线

#10 2021-10-24 12:00:52

vigour1000
会员
注册时间: 2018-11-19
已发帖子: 100
积分: 6

Re: 用v3x做了个小板,分享一下

该评论内容与本帖子无关,鼓励各位坑友积极发言讨论与帖子有关的内容!

离线

  • 不通过:与技术无关

#11 2021-10-27 20:41:22

lxj
会员
注册时间: 2021-10-27
已发帖子: 1
积分: 1

Re: 用v3x做了个小板,分享一下

该评论内容与本帖子无关,鼓励各位坑友积极发言讨论与帖子有关的内容!

离线

  • 不通过:与技术无关

#12 2021-11-12 15:13:14

CHSHIQING
会员
注册时间: 2020-11-27
已发帖子: 46
积分: 6

Re: 用v3x做了个小板,分享一下

这个芯片有点小贵,某鱼淘了两片正准备弄块板子

离线

#13 2022-02-02 23:23:17

sblpp
会员
注册时间: 2018-02-14
已发帖子: 164
积分: 64

Re: 用v3x做了个小板,分享一下

楼主请问 环境变量如何存储至SD卡上呢?
目前uboot貌似不支持savenv命令。

离线

#14 2022-03-14 09:46:02

lengyuefneg
会员
注册时间: 2021-07-18
已发帖子: 29
积分: 91.5

Re: 用v3x做了个小板,分享一下

sblpp 说:

楼主请问 环境变量如何存储至SD卡上呢?
目前uboot貌似不支持savenv命令。

这个在uboot里面配置一下就好了。

离线

#15 2022-06-24 06:13:49

LinuxGo
会员
注册时间: 2021-01-07
已发帖子: 88
积分: 120

Re: 用v3x做了个小板,分享一下

你好搂住,用axp这个电源方案 ,又没有遇到过系统插着串口线再上电,电源没有输出的问题?

离线

楼主 #16 2022-06-24 09:32:30

qianniao29
会员
注册时间: 2020-05-19
已发帖子: 29
积分: 105.5

Re: 用v3x做了个小板,分享一下

LinuxGo 说:

你好搂住,用axp这个电源方案 ,又没有遇到过系统插着串口线再上电,电源没有输出的问题?

记得有个文档上说,这个芯片的串口没有做放倒灌,所以断电后芯片可能没有复位,需要将串口连线断开,芯片才会复位。不知道你这个问题跟倒灌有没有关系。

离线

楼主 #17 2022-08-25 19:41:07

qianniao29
会员
注册时间: 2020-05-19
已发帖子: 29
积分: 105.5

Re: 用v3x做了个小板,分享一下

好久没来更新了,板子基本功能调试的差不多了,已初具雏形。屏幕调试花了挺长时间,调试记录见:https://whycan.com/t_8686.html
其他按键,esp8089,alsa音频参考论坛里的帖子调了调驱动。

_20220825193956.jpg

离线

#18 2023-01-18 13:53:08

Yavier
会员
注册时间: 2022-07-22
已发帖子: 5
积分: 5

Re: 用v3x做了个小板,分享一下

@qianniao29
请问uboot编译网口那,sun8i-v3x-game.dts这个文件在哪,我找了半天都没找到

离线

#19 2023-01-19 14:34:43

ftd
会员
注册时间: 2023-01-19
已发帖子: 2
积分: 2

Re: 用v3x做了个小板,分享一下

请问一下参考了什么资料呢

离线

楼主 #20 2023-02-03 21:12:49

qianniao29
会员
注册时间: 2020-05-19
已发帖子: 29
积分: 105.5

Re: 用v3x做了个小板,分享一下

Yavier 说:

@qianniao29
请问uboot编译网口那,sun8i-v3x-game.dts这个文件在哪,我找了半天都没找到


完整的dts文件:
uboot  sun8i-v3x-game.dts

// SPDX-License-Identifier: (GPL-2.0+ OR X11)
/*
 * Copyright 2019 Icenowy Zheng <icenowy@aosc.io>
 */

/dts-v1/;
#include "sun8i-v3.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	model = "v3x handheld game console";
	compatible = "v3x,v3x-game", "allwinner,sun8i-s3";

	aliases {
		serial0 = &uart0;
		serial1 = &uart1;
		serial2 = &uart2;
	};

	chosen {
		stdout-path = "serial1:115200n8";
	};

	reg_vcc5v0: vcc5v0 {
		compatible = "regulator-fixed";
		regulator-name = "vcc5v0";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
	};

	reg_vcc_wifi: vcc-wifi {
		compatible = "regulator-fixed";
		regulator-name = "vcc-wifi";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&pio 1 2 GPIO_ACTIVE_LOW>; /* PB2 WIFI-EN */
		vin-supply = <&reg_dcdc3>;
		startup-delay-us = <200000>;
	};

	wifi_pwrseq: wifi_pwrseq {
		compatible = "mmc-pwrseq-simple";
		reset-gpios = <&pio 1 3 GPIO_ACTIVE_LOW>; /* PB3 WIFI-RST */
		post-power-on-delay-ms = <200>;
	};
};

&emac {
	compatible = "allwinner,sun8i-h3-emac";
	pinctrl-0 = <&emac_rgmii_pins>;
	phy-handle = <&int_mii_phy>;
	phy-mode = "mii";
	allwinner,leds-active-high;
	status = "okay";
};

&i2c0 {
	status = "okay";

	axp209: pmic@34 {
		compatible = "x-powers,axp203",
			     "x-powers,axp209";
		reg = <0x34>;
		interrupt-parent = <&gic>;
		interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
		interrupt-controller;
		#interrupt-cells = <1>;
	};
};

&lradc {
	vref-supply = <&reg_ldo2>;
	status = "okay";

	button-200 {
		label = "Setup";
		linux,code = <KEY_SETUP>;
		channel = <0>;
		voltage = <190000>;
	};
};

&mmc0 {
	vmmc-supply = <&reg_dcdc3>;
	bus-width = <4>;
	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
	status = "okay";
};

&mmc1 {
	vmmc-supply = <&reg_vcc_wifi>;
	vqmmc-supply = <&reg_dcdc3>;
	mmc-pwrseq = <&wifi_pwrseq>;
	bus-width = <4>;
	non-removable;
	status = "okay";
};

&pio {
	vcc-pd-supply = <&reg_dcdc3>;
	vcc-pe-supply = <&reg_ldo3>;
	uart1_pins: uart1-pins {
				pins = "PG6", "PG7";
				function = "uart1";
			};
	emac_rgmii_pins: emac0@0 {
		allwinner,pins = "PD0", "PD1", "PD2", "PD3",
		               "PD4", "PD5", "PD7",
		               "PD8", "PD9", "PD10";
		function = "emac";
		drive-strength = <40>;
	};
};

#include "axp209.dtsi"

&ac_power_supply {
	status = "okay";
};

&reg_dcdc2 {
	regulator-always-on;
	regulator-min-microvolt = <1250000>;
	regulator-max-microvolt = <1250000>;
	regulator-name = "vdd-sys-cpu-ephy";
};

&reg_dcdc3 {
	regulator-always-on;
	regulator-min-microvolt = <3300000>;
	regulator-max-microvolt = <3300000>;
	regulator-name = "vcc-3v3";
};

&reg_ldo1 {
	regulator-name = "vdd-rtc";
};

&reg_ldo2 {
	regulator-always-on;
	regulator-min-microvolt = <3000000>;
	regulator-max-microvolt = <3000000>;
	regulator-name = "avcc";
};

&reg_ldo3 {
	regulator-min-microvolt = <2800000>;
	regulator-max-microvolt = <2800000>;
	regulator-name = "avdd-dovdd-2v8-csi";
	regulator-soft-start;
	regulator-ramp-delay = <1600>;
};

&reg_ldo4 {
	regulator-min-microvolt = <1800000>;
	regulator-max-microvolt = <1800000>;
	regulator-name = "dvdd-1v8-csi";
};

&spi0 {
	status = "okay";

	flash@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "winbond,w25q256", "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <40000000>;
	};
};

&uart1 {
	pinctrl-0 = <&uart1_pins>;
	pinctrl-names = "default";
	status = "okay";
};

&usb_otg {
	dr_mode = "host";
	status = "okay";
};

&usbphy {
	usb0_vbus-supply = <&reg_vcc5v0>;
	status = "okay";
};

kernel sun8i-v3x-game.dts

// SPDX-License-Identifier: (GPL-2.0+ OR X11)
/*
 * Copyright 2019 Icenowy Zheng <icenowy@aosc.io>
 */

/dts-v1/;
#include "sun8i-v3.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	model = "v3x handheld game console";
	compatible = "v3x,v3x-game", "sochip,s3", "allwinner,sun8i-v3";

	aliases {
		serial0 = &uart0;
		serial1 = &uart1;
		serial2 = &uart2;
		spi0 = "/spi@1c68000";
		spi1 = "/spi_gpio";
	};

	chosen {
		stdout-path = "serial1:115200n8";
	};

	reg_vcc5v0: vcc5v0 {
		compatible = "regulator-fixed";
		regulator-name = "vcc5v0";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
	};

    reg_vcc_wifi: vcc-wifi {
        compatible = "regulator-fixed";
        regulator-name = "vcc-wifi";
        regulator-min-microvolt = <3300000>;
        regulator-max-microvolt = <3300000>;
        regulator-always-on;
        gpio = <&pio 6 9 GPIO_ACTIVE_HIGH>; /* PG9 WIFI-EN */
        enable-active-high;
        vin-supply = <&reg_dcdc3>;
        startup-delay-us = <200000>;
    };

   wifi_pwrseq: wifi_pwrseq {
       compatible = "mmc-pwrseq-simple";
       reset-gpios = <&pio 6 8 GPIO_ACTIVE_LOW>; /* PG8 WIFI-RST */
       post-power-on-delay-ms = <200>;
	};

    reg_vcc_disp: vcc-lcd {
        compatible = "regulator-fixed";
        regulator-name = "display-power";
        regulator-min-microvolt = <3300000>;
        regulator-max-microvolt = <3300000>;
        /* Collides with LCD E */
        gpio = <&pio 3 20 GPIO_ACTIVE_LOW>; //PD20
        enable-active-low;
    };

	dma: dma-controller@01c02000 {
		compatible = "allwinner,sun8i-v3s-dma";
		reg = <0x01c02000 0x1000>;
		interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&ccu CLK_BUS_DMA>;
		resets = <&ccu RST_BUS_DMA>;
		#dma-cells = <1>;
	};

	ehci0: usb@01c1a000 {
		compatible = "allwinner,sun8i-v3s-ehci", "generic-ehci";
		reg = <0x01c1a000 0x100>;
		interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>;
		resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;
		status = "okay";
	};

	ohci0: usb@01c1a400 {
		compatible = "allwinner,sun8i-v3s-ohci", "generic-ohci";
		reg = <0x01c1a400 0x100>;
		interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>,
			 <&ccu CLK_USB_OHCI0>;
		resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;
		status = "okay";
	};

	pwm: pwm@1c21400 {
		compatible = "allwinner,sun8i-v3s-pwm",
			     "allwinner,sun7i-a20-pwm";
		reg = <0x01c21400 0x400>;
		clocks = <&osc24M>;
		#pwm-cells = <3>;
		pinctrl-names = "default";
		pinctrl-0 = <&pwm0_pins>;
		status = "okay";
	};

	codec: codec@01c22c00 {
		#sound-dai-cells = <0>;
		compatible = "allwinner,sun8i-v3s-codec";
		reg = <0x01c22c00 0x400>;
		interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_AC_DIG>;
		clock-names = "apb", "codec";
		resets = <&ccu RST_BUS_CODEC>;
		dmas = <&dma 15>, <&dma 15>;
		dma-names = "rx", "tx";
		allwinner,codec-analog-controls = <&codec_analog>;
		allwinner,audio-routing =
		"Headphone", "HP",
		"Headphone", "HPCOM";
		status = "okay";
	};

	codec_analog: codec-analog@01c23000 {
		compatible = "allwinner,sun8i-v3s-codec-analog";
		reg = <0x01c23000 0x4>;
	};

	backlight: backlight {
		compatible = "pwm-backlight";
		pwms = <&pwm 0 1000000 1>;
		brightness-levels = <0 30 40 50 60 70 100>;
		default-brightness-level = <6>;
	};

    spi_gpio {
        compatible = "spi-gpio";
        #address-cells = <1>;
        #size-cells = <0>;

        sck-gpios = <&pio 3 16 GPIO_ACTIVE_HIGH>; //PD16
        miso-gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; //PD19
        mosi-gpios = <&pio 3 21 GPIO_ACTIVE_HIGH>; //PD21
        cs-gpios = <&pio 3 18 GPIO_ACTIVE_LOW>; //PD18
        num-chipselects = <1>;
        status = "okay";

		panel: display@0 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0>; 
			compatible = "easyquick,lm040", "simple-panel";
			reset-gpios = <&pio 3 17 GPIO_ACTIVE_LOW>; //PD17
			vcc-supply = <&reg_vcc_disp>;
            iovcc-supply = <&reg_vcc_disp>;
            pixel_swap_rb = <0x1>;

	        spi-max-frequency = <200000>;

			port@0 {
				reg = <0>;
				backlight = <&backlight>;
				#address-cells = <1>;
				#size-cells = <0>;

				panel_input: endpoint@0 {
					reg = <0>;
					remote-endpoint = <&tcon0_out_lcd>;
				};
			};
		};
	};
	gpio_keys {
		compatible = "gpio-keys-polled";
	//	pinctrl-names = "default";
	//	pinctrl-0 = <&key_pins>;
		#address-cells = <1>;
		#size-cells = <0>;
		poll-interval = <20>;

		button@0 {
            label = "Key down";
            linux,code = <KEY_DOWN>;
            gpios = <&pio 2 6 GPIO_ACTIVE_LOW>; /* PC6 */
        };
        button@1 {
            label = "Key right";
            linux,code = <KEY_RIGHT>;
            gpios = <&pio 2 7 GPIO_ACTIVE_LOW>; /* PC7 */
        };
        button@2 {
            label = "Key left";
            linux,code = <KEY_LEFT>;
            gpios = <&pio 2 8 GPIO_ACTIVE_LOW>; /* PC8 */
        };
        button@3 {
            label = "Key up";
            linux,code = <KEY_UP>;
            gpios = <&pio 2 9 GPIO_ACTIVE_LOW>; /* PC9 */
        };
        button@4 {
            label = "Key b";
            linux,code = <KEY_B>;
            gpios = <&pio 3 12 GPIO_ACTIVE_LOW>; /* PD12 */
        };
        button@5 {
            label = "Key a";
            linux,code = <KEY_A>;
            gpios = <&pio 3 13 GPIO_ACTIVE_LOW>; /* PD13 */
        };
        button@6 {
            label = "Key enter";
            linux,code = <KEY_ENTER>;
            gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* PD14 */
        };
        button@7 {
            label = "Key menu";
            linux,code = <KEY_MENU>;
            gpios = <&pio 3 15 GPIO_ACTIVE_LOW>; /* PD15 */
        };
        button@8 {
            label = "Key y";
            linux,code = <KEY_Y>;
            gpios = <&pio 4 21 GPIO_ACTIVE_LOW>; /* PE21 */
        };
        button@9 {
            label = "Key x";
            linux,code = <KEY_X>;
            gpios = <&pio 4 22 GPIO_ACTIVE_LOW>; /* PE22 */
        };
	};

	mbus: dram-controller@1c62000 {
		compatible = "allwinner,sun8i-v3s-mbus";
		reg = <0x01c62000 0x1000>,
		      <0x01c63000 0x1000>;
		reg-names = "mbus", "dram";
		clocks = <&ccu CLK_MBUS>,
			 <&ccu CLK_DRAM>,
			 <&ccu CLK_BUS_DRAM>;
		clock-names = "mbus", "dram", "bus";
		#address-cells = <1>;
		#size-cells = <1>;
		dma-ranges = <0x00000000 0x40000000 0x80000000>;
		#interconnect-cells = <1>;
	};

	video-codec@1c0e000 {
		compatible = "allwinner,sun8i-v3s-video-engine";
		reg = <0x01c0e000 0x1000>;
		clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>,
			 <&ccu CLK_DRAM_VE>;
		clock-names = "ahb", "mod", "ram";
		resets = <&ccu RST_BUS_VE>;
		interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
		allwinner,sram = <&ve_sram 1>;
	};

};

&syscon {
	sram_c: sram@4000 {
		compatible = "mmio-sram";
		reg = <0x4000 0xb000>;
		#address-cells = <1>;
		#size-cells = <1>;
		ranges = <0 0x4000 0xb000>;

		ve_sram: sram-section@0 {
			compatible = "allwinner,sun8i-v3s-sram-c1",
				     "allwinner,sun4i-a10-sram-c1";
			reg = <0x0 0xb000>;
		};
	};
};

&emac {
	phy-handle = <&int_mii_phy>;
	allwinner,leds-active-high;
	phy-mode = "mii";
	status = "okay";
};

&i2c0 {
	status = "okay";

	axp209: pmic@34 {
		reg = <0x34>;
		interrupt-parent = <&pio>;
		interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>;  //PB5
	};
};

&lradc {
	vref-supply = <&reg_ldo2>;
	status = "okay";

	button-200 {
		label = "Menu";
		linux,code = <KEY_MENU>;
		channel = <0>;
		voltage = <191000>;
	};
    button-400 {
        label = "Back";
        linux,code = <KEY_BACK>;
        channel = <0>;
        voltage = <391000>;
    };
    button-600 {
        label = "Vol Down";
        linux,code = <KEY_VOLUMEDOWN>;
        channel = <0>;
        voltage = <600000>;
    };
    button-800 {
        label = "Vol Up";
        linux,code = <KEY_VOLUMEUP>;
        channel = <0>;
        voltage = <794000>;
    };
};

&mmc0 {
	vmmc-supply = <&reg_dcdc3>;
	bus-width = <4>;
	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
	cap-sd-highspeed;
	status = "okay";
};

&mmc1 {
	vmmc-supply = <&reg_vcc_wifi>;
	vqmmc-supply = <&reg_dcdc3>;
	mmc-pwrseq = <&wifi_pwrseq>;
	bus-width = <4>;
	cap-sdio-irq;
	non-removable;
	status = "okay";
};

&pio {
	uart1_pins: uart1-pins {
		pins = "PG6", "PG7";
		function = "uart1";
	};

	pwm0_pins: pwm0 {
		pins = "PB4";
		function = "pwm0";
	};

	lcd_rgb666_pins_a: lcd-rgb666-pe {
		pins = "PE0", "PE1", "PE2", "PE3", "PE4", "PE5",
		       "PE6", "PE7", "PE8", "PE9", "PE10", "PE11",
		       "PE12", "PE13", "PE14", "PE15", "PE16", "PE17",
		       "PE18", "PE19", "PE23", "PE24";
		function = "lcd";
	};
	key_pins: key_pins@0 {
        pins = "PC6", "PC7", "PC8", "PC9", 
               "PD12", "PD13", "PD14", "PD15",
               "PE21", "PE22";
        function = "gpio_in";
        allwinner,drive = <0>;
        allwinner,pull = <1>;
    };
};

#include "axp209.dtsi"

&axp209 {
    battery_cell: battery-cell {
        compatible = "simple-battery";
        constant-charge-current-max-microamp = <1200000>;
    };
};

&ac_power_supply {
	status = "okay";
};

&battery_power_supply {
    monitored-battery = <&battery_cell>;
    status = "okay";
};

&reg_dcdc2 {
	regulator-always-on;
	regulator-min-microvolt = <1250000>;
	regulator-max-microvolt = <1250000>;
	regulator-name = "vdd-sys-cpu-ephy";
};

&reg_dcdc3 {
	regulator-always-on;
	regulator-min-microvolt = <3300000>;
	regulator-max-microvolt = <3300000>;
	regulator-name = "vcc-3v3";
};

&reg_ldo1 {
	regulator-name = "vdd-rtc";
};

&reg_ldo2 {
	regulator-always-on;
	regulator-min-microvolt = <3000000>;
	regulator-max-microvolt = <3000000>;
	regulator-name = "avcc";
};

&reg_ldo3 {
	regulator-min-microvolt = <2800000>;
	regulator-max-microvolt = <2800000>;
	regulator-name = "avdd-dovdd-2v8-csi";
	regulator-soft-start;
	regulator-ramp-delay = <1600>;
};

&reg_ldo4 {
	regulator-min-microvolt = <1800000>;
	regulator-max-microvolt = <3300000>;
	regulator-name = "dvdd-1v8-csi";
};

&spi0 {
	status = "okay";

	flash@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "winbond,w25q256", "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <40000000>;
	};
};

&uart1 {
	pinctrl-0 = <&uart1_pins>;
	pinctrl-names = "default";
	status = "okay";
};

&usb_otg {
	dr_mode = "host";
	status = "okay";
};

&usbphy {
	usb0_vbus-supply = <&reg_vcc5v0>;
	status = "okay";
};


&de {
	status = "okay";
};

&tcon0 {
	pinctrl-names = "default";
	pinctrl-0 = <&lcd_rgb666_pins_a>;
	status = "okay";
};

&tcon0_out {
	tcon0_out_lcd: endpoint@0 {
		reg = <0>;
		remote-endpoint = <&panel_input>;
	};
};

最近编辑记录 qianniao29 (2023-02-03 21:15:36)

离线

楼主 #21 2023-02-03 21:16:45

qianniao29
会员
注册时间: 2020-05-19
已发帖子: 29
积分: 105.5

Re: 用v3x做了个小板,分享一下

ftd 说:

请问一下参考了什么资料呢

主要参考了论坛上v3s的相关资料,编译uboot,kernel,驱动之类的。

离线

#22 2023-02-09 15:20:47

wj8331585
会员
注册时间: 2023-02-07
已发帖子: 44
积分: 19

Re: 用v3x做了个小板,分享一下

请问还有空板吗?

离线

楼主 #23 2023-02-14 23:15:10

qianniao29
会员
注册时间: 2020-05-19
已发帖子: 29
积分: 105.5

Re: 用v3x做了个小板,分享一下

wj8331585 说:

请问还有空板吗?

有的,gerber文件已经放到GitHub了,或者你可以自己去打板。
开源帖: https://whycan.com/viewtopic.php?pid=86848#p86848

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn