应该是V4L2接口有变化,这个驱动是给linux 3.4用的(好像是
还要看看哪里出的问题
[09.578]ubi0 error: ubi_attach_mtd_dev: failed to attach mtd4, error -22
[09.585]UBI error: cannot attach mtd4
[09.588]UBI error: cannot initialize UBI, error -22
UBI init error 22
Please check, if the correct MTD partition is used (size big enough?)
[09.601]ubi part sys err !
[09.603]initialize sunxi spinand ubi failed
download_standard_gpt:write mbr sectors fail ret = 0
镜像的分区配置检查一下
XR32与XR871的文档差不多,目前不支持keil调试,如果急需量产请联系FAE,走企业通道可以获得更多支持。
XR871_phoenixMC_User_Guide-CN.pdf
XR871_FDCM_Developer_Guide-CN.pdf
XR871_Flash_Layout_Guide-CN.pdf
XR871_Flash_Support_Developer_Guide-CN.pdf
XR871_Image_Developer_Guide-CN.pdf
XR871_Memory_Layout_Developer_Guide-CN.pdf
同时有D1-H与D1s的配置文件。
改一下驱动
From 35d26bbc1975aa3b79bce8bcbcde15c0857093dd Mon Sep 17 00:00:00 2001
From: YuzukiTsuru <gloomyghost@gloomyghost.com>
Date: Tue, 5 Apr 2022 00:19:12 +0800
Subject: [PATCH] fix gpio keys sunxi driver
Signed-off-by: YuzukiTsuru <gloomyghost@gloomyghost.com>
---
gpio_keys.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 88 insertions(+), 6 deletions(-)
diff --git a/gpio_keys.c b/gpio_keys.c
index 9b8079c..077e50b 100644
--- a/gpio_keys.c
+++ b/gpio_keys.c
@@ -33,6 +33,22 @@
#include <linux/of_irq.h>
#include <linux/spinlock.h>
+#ifdef CONFIG_ARCH_SUNXI
+#include <linux/sunxi-gpio.h>
+#ifdef CONFIG_GPIOKEYS_AS_POWERKEY
+#include <linux/kthread.h>
+#include <linux/reboot.h>
+#include <linux/jiffies.h>
+struct long_press_key {
+ struct delayed_work long_work;
+ unsigned long start;
+ int press_sta;
+};
+
+static struct long_press_key long_press_key;
+#endif
+#endif
+
struct gpio_button_data {
const struct gpio_keys_button *button;
struct input_dev *input;
@@ -142,10 +158,14 @@ static void gpio_keys_disable_button(struct gpio_button_data *bdata)
*/
disable_irq(bdata->irq);
- if (bdata->gpiod)
+ if (bdata->gpiod) {
cancel_delayed_work_sync(&bdata->work);
- else
+#ifdef CONFIG_GPIOKEYS_AS_POWERKEY
+ cancel_delayed_work_sync(&long_press_key.long_work);
+#endif
+ } else {
del_timer_sync(&bdata->release_timer);
+ }
bdata->disabled = true;
}
@@ -355,12 +375,33 @@ static struct attribute_group gpio_keys_attr_group = {
.attrs = gpio_keys_attrs,
};
+#ifdef CONFIG_GPIOKEYS_AS_POWERKEY
+static void gpio_keys_long_press_func(struct work_struct *work)
+{
+ struct long_press_key *key = &long_press_key;
+ unsigned long end;
+ unsigned long diff_time;
+
+ end = jiffies;
+ diff_time = jiffies_to_msecs(end - key->start);
+ if ((key->press_sta == 1) && (diff_time >= 5000)) {
+ orderly_poweroff(true);
+ return;
+ } else {
+ return;
+ }
+}
+#endif
+
static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata)
{
const struct gpio_keys_button *button = bdata->button;
struct input_dev *input = bdata->input;
unsigned int type = button->type ?: EV_KEY;
int state;
+#ifdef CONFIG_GPIOKEYS_AS_POWERKEY
+ struct long_press_key *key = &long_press_key;
+#endif
state = gpiod_get_value_cansleep(bdata->gpiod);
if (state < 0) {
@@ -373,7 +414,29 @@ static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata)
if (state)
input_event(input, type, button->code, button->value);
} else {
+#ifdef CONFIG_GPIOKEYS_AS_POWERKEY
+ if (button->code != KEY_POWER) {
+ input_event(input, type, button->code, state);
+ } else {
+ if (state) {
+ key->start = jiffies;
+ key->press_sta = 1;
+ queue_delayed_work(system_wq, &key->long_work,
+ msecs_to_jiffies(5 * 1000));
+ } else if ((!state) && (key->start != 0)) {
+ key->press_sta = 0;
+ cancel_delayed_work(&key->long_work);
+ input_event(input, EV_KEY, button->code, 1);
+ input_sync(input);
+ udelay(5000);
+ input_event(input, EV_KEY, button->code, 0);
+ input_sync(input);
+ }
+ }
+#else
input_event(input, type, button->code, state);
+#endif
+
}
input_sync(input);
}
@@ -459,10 +522,14 @@ static void gpio_keys_quiesce_key(void *data)
{
struct gpio_button_data *bdata = data;
- if (bdata->gpiod)
+ if (bdata->gpiod) {
cancel_delayed_work_sync(&bdata->work);
- else
+#ifdef CONFIG_GPIOKEYS_AS_POWERKEY
+ cancel_delayed_work_sync(&long_press_key.long_work);
+#endif
+ } else {
del_timer_sync(&bdata->release_timer);
+ }
}
static int gpio_keys_setup_key(struct platform_device *pdev,
@@ -502,7 +569,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
bdata->gpiod = gpio_to_desc(button->gpio);
if (!bdata->gpiod)
return -EINVAL;
-
+#if 0
if (button->debounce_interval) {
error = gpiod_set_debounce(bdata->gpiod,
button->debounce_interval * 1000);
@@ -511,6 +578,9 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
bdata->software_debounce =
button->debounce_interval;
}
+#else
+ bdata->software_debounce = button->debounce_interval;
+#endif
if (button->irq) {
bdata->irq = button->irq;
@@ -526,6 +596,10 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
bdata->irq = irq;
}
+#ifdef CONFIG_GPIOKEYS_AS_POWERKEY
+ INIT_DELAYED_WORK(&long_press_key.long_work,
+ gpio_keys_long_press_func);
+#endif
INIT_DELAYED_WORK(&bdata->work, gpio_keys_gpio_work_func);
isr = gpio_keys_gpio_isr;
@@ -664,11 +738,15 @@ gpio_keys_get_devtree_pdata(struct device *dev)
i = 0;
for_each_available_child_of_node(node, pp) {
+#ifdef CONFIG_ARCH_SUNXI
+ struct gpio_config flags;
+#else
enum of_gpio_flags flags;
+#endif
button = &pdata->buttons[i++];
- button->gpio = of_get_gpio_flags(pp, 0, &flags);
+ button->gpio = of_get_gpio_flags(pp, 0, (enum of_gpio_flags *)&flags);
if (button->gpio < 0) {
error = button->gpio;
if (error != -ENOENT) {
@@ -679,7 +757,11 @@ gpio_keys_get_devtree_pdata(struct device *dev)
return ERR_PTR(error);
}
} else {
+#ifdef CONFIG_ARCH_SUNXI
+ button->active_low = flags.data & OF_GPIO_ACTIVE_LOW;
+#else
button->active_low = flags & OF_GPIO_ACTIVE_LOW;
+#endif
}
button->irq = irq_of_parse_and_map(pp, 0);
--
2.33.0
/etc/init.d/dbus restart
然后就好了
root@TinaLinux:/# bt_test -i -p a2dp-source
11964.769186: BTMG[bt_manager_enable:407]: bt manager version:Version:3.0.1.202110291544,builed time:Oct 29 2021-09:42:35
11964.769783: BTMG[bt_test_status_cb:82]: bt is turnning on.
hcidump_xr existed
Bluetooth init has been completed!!
11964.938952: [a2dp_sink_thread_process:318]: Couldn't read event: Bad message
11964.939616: [hfp_thread_process:711]: Couldn't read event: Bad message
bluetoothd[275]: Endpoint unregistered: sender=:1.1 path=/A2DP/SBC/Sink/1
bluetoothd[275]: Endpoint registered: sender=:1.3 path=/A2DP/SBC/Source/1
11965.263831: BTMG[bt_profile_global_init:355]: start bluealsa :1 times
11965.825855: BTMG[bt_test_adapter_power_state_cb:47]: Turn on bt successfully
11966.266042: BTMG[bt_test_status_cb:67]: BT is ON
scan 0[bt]1
[bt]#12145.074175: BTMG[bt_test_discovery_status_cb:91]: bt start scanning.
12145.074243: BTMG[btmg_gap_bluez_callback:1228]: Discovery started
12145.206434: BTMG[bt_test_dev_add_cb:115]: address:EC:FA:5C:63:37:94,name:MI BT18 BLE,class:0,icon:(null),address type:public,rssi:-86
[bt]#12147.415742: BTMG[bt_test_dev_add_cb:115]: address:A4:FC:77:29:EA:7A,name:KD-43X8500F,class:0,icon:(null),address type:public,rssi:-96
s
Invalid command
[bt]#
[bt]#sca12150.809068: BTMG[bt_test_dev_add_cb:115]: address:EC:FA:5C:DD:66:16,name:MI BT18,class:3408900,icon:audio-card,address type:public,rssi:-53
12150.862888: BTMG[bt_test_update_rssi_cb:139]: address:A4:FC:77:29:EA:7A,name:KD-43X8500F,rssi:-81
12150.872707: BTMG[bt_test_update_rssi_cb:139]: address:EC:FA:5C:DD:66:16,name:MI BT18,rssi:-25
12150.893906: BTMG[bt_test_update_rssi_cb:139]: address:EC:FA:5C:DD:66:16,name:MI BT18,rssi:-53
n12151.284176: BTMG[bt_test_update_rssi_cb:139]: address:EC:FA:5C:DD:66:16,name:MI BT18,rssi:-25
12151.334754: BTMG[bt_test_update_rssi_cb:139]: address:EC:FA:5C:DD:66:16,name:MI BT18,rssi:-55
12151.887915: BTMG[cmd_bt_discovery:86]: Unexpected argc: 0, see help
[bt]#
[bt]#scan 0
[bt]#12155.870176: BTMG[btmg_gap_bluez_callback:1232]: Discovery Stopped due to user input
12155.870297: BTMG[bt_test_discovery_status_cb:97]: stop scan by user.
[bt]#connect EC:FA:5C:DD:66:16
12190.724040: BTMG[bt_test_a2dp_source_connection_state_cb:296]: A2DP source connecting with device: EC:FA:5C:DD:66:16
addr:EC:FA:5C:DD:66:16,name:MI BT18,state:CONNECTED
bluetoothd[385]: Endpoint registered: sender=:1.4 path=/A2DP/SBC/Source/2
[bt]#bluetoothd[385]: Can't open input device: No such file or directory (2)
bluetoothd[385]: AVRCP: failed to init uinput for MI BT18
12192.076985: BTMG[bt_test_a2dp_source_connection_state_cb:298]: A2DP source connected with device: EC:FA:5C:DD:66:16
改了一下conf
root@TinaLinux:/# cat /etc/dbus-1/system.d/bluetooth.conf
<!-- This configuration file specifies the required security policies
for Bluetooth core daemon to work. -->
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- ../system.conf have denied everything, so we just punch some holes -->
<policy user="root">
<allow own="org.bluez"/>
<allow send_destination="org.bluez"/>
<allow send_type="method_call"/>
<allow send_type="method_return"/>
<allow send_interface="org.bluez.Agent1"/>
<allow send_interface="org.bluez.MediaEndpoint1"/>
<allow send_interface="org.bluez.MediaPlayer1"/>
<allow send_interface="org.bluez.ThermometerWatcher1"/>
<allow send_interface="org.bluez.AlertAgent1"/>
<allow send_interface="org.bluez.Profile1"/>
<allow send_interface="org.bluez.HeartRateWatcher1"/>
<allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
<allow send_interface="org.bluez.GattCharacteristic1"/>
<allow send_interface="org.bluez.GattDescriptor1"/>
<allow send_interface="org.freedesktop.DBus.ObjectManager"/>
<allow send_interface="org.freedesktop.DBus.Properties"/>
</policy>
<policy at_console="true">
<allow send_path="/"/>
<allow send_destination="org.bluez"/>
<allow send_destination="org.bluez.Manager"/>
<allow receive_sender="org.bluez.Manager"/>
<allow send_destination="org.bluez.Adapter"/>
<allow receive_sender="org.bluez.Adapter"/>
<allow send_destination="org.bluez.Device"/>
<allow receive_sender="org.bluez.Device"/>
<allow send_destination="org.bluez.Service"/>
<allow receive_sender="org.bluez.Service"/>
<allow send_destination="org.bluez.Database"/>
<allow receive_sender="org.bluez.Database"/>
<allow send_destination="org.bluez.Security"/>
<allow receive_sender="org.bluez.Security"/>
</policy>
<!-- allow users of lp group (printing subsystem) to
communicate with bluetoothd -->
<policy context="default">
<deny send_destination="org.bluez"/>
</policy>
</busconfig>
Failed to start message bus: Configuration file needs one or more <listen> elements giving addresses
@whycan
dbus报错
Unknown group "lp" in message bus configuration file
Failed to start message bus: Configuration file needs one or more <listen> elements giving addresses
首先按照帖子《D1 开发板使用 XR829 mesh fw 出现 code(56) 错误,如何解决》:
https://bbs.aw-ol.com/topic/361/share/1 配置了蓝牙,输出
root@TinaLinux:/# hciattach -n ttyS1 xradio >/dev/null 2>&1 &
root@TinaLinux:/# [ 341.203731]sunxi-rfkill soc@3000000:rfkill@0: set block: 1
[ 341.210080]sunxi-rfkill soc@3000000:rfkill@0: bt power off success
[ 341.237565]sunxi-rfkill soc@3000000:rfkill@0: set block: 0
[ 341.253736]sunxi-rfkill soc@3000000:rfkill@0: bt power on success
[ 341.280858][XR_BT_LPM] bluedroid_write_proc_btwake: bluedroid_write_proc_btwake 1
[ 341.289318][XR_BT_LPM] bluedroid_write_proc_btwake: wakeup bt device
[ 341.296571][XR_BT_LPM] bluedroid_write_proc_lpm: disable lpm mode
root@TinaLinux:/# hciconfig -a hci0 up
root@TinaLinux:/# hciconfig
hci0: Type: Primary Bus: UART
BD Address: 22:22:65:05:28:FE ACL MTU: 1021:8 SCO MTU: 255:4
UP RUNNING
RX bytes:1154 acl:0 sco:0 events:54 errors:0
TX bytes:744 acl:0 sco:0 commands:54 errors:0
然后bt_test -i -p a2dp-source
root@TinaLinux:/# bt_test -i -p a2dp-source
8163.127547: BTMG[bt_manager_enable:407]: bt manager version:Version:3.0.1.202110291544,builed time:Oct 29 2021-09:42:35
8163.128196: BTMG[bt_test_status_cb:82]: bt is turnning on.
Bluetooth init has been completed!!
ln: /var/lib/bluetooth: No such file or directory
bluetoothd[296]: Bluetooth daemon 5.54
D-Bus setup failed: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
bluetoothd[296]: Unable to get on D-Bus
bluealsa: Couldn't initialize controller thread: Bad file descriptor
8164.563437: BTMG[bt_profile_global_init:355]: start bluealsa :1 times
8164.572354: BTMG[bt_routine:68]: Couldn't obtain D-Bus connection: Could not connect: No such file or directory
8165.065054: BTMG[bt_manager_enable:449]: init connection to bluez failed!
[ 577.128339]sunxi-rfkill soc@3000000:rfkill@0: block state already is 1
stop bluetoothd and hciattach
8165.198016: BTMG[bt_test_status_cb:65]: BT is off
估计是我什么配置的问题,麻烦大佬分析一下
驱动文件
#include <asm/byteorder.h>
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/of_platform.h>
#include <linux/pm.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/videodev2.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
/* The driver uses random access I/O to the registers via I2C address 0x11. */
#define RDA5807_I2C_ADDR 0x11
/* Working current: 1.8, 2.1, 2.5 or 3.0 mA. */
#define RDA5807_INPUT_LNA_WC_18 (0 << 0)
#define RDA5807_INPUT_LNA_WC_21 (1 << 0)
#define RDA5807_INPUT_LNA_WC_25 (2 << 0)
#define RDA5807_INPUT_LNA_WC_30 (3 << 0)
/* Use antenna signal connected to LNAN and/or LNAP pin? */
#define RDA5807_LNA_PORT_N (1 << 2)
#define RDA5807_LNA_PORT_P (1 << 3)
/* Ouput analog audio on LOUT+ROUT pins */
#define RDA5807_OUTPUT_AUDIO_ANALOG (1 << 0)
/* Output digital audio using I2S on GPIO1-3 pins */
#define RDA5807_OUTPUT_AUDIO_I2S (1 << 1)
/* Output stereo indicator signal on GPIO3 pin */
#define RDA5807_OUTPUT_STEREO_INDICATOR (1 << 2)
struct rda5807_platform_data {
u8 input_flags;
u8 output_flags;
};
enum rda5807_reg {
RDA5807_REG_CHIPID = 0x00,
RDA5807_REG_CTRL = 0x02,
RDA5807_REG_CHAN = 0x03,
RDA5807_REG_IOCFG = 0x04,
RDA5807_REG_INTM_THRESH_VOL = 0x05,
RDA5807_REG_SEEK_RESULT = 0x0A,
RDA5807_REG_SIGNAL = 0x0B,
};
#define RDA5807_MASK_CTRL_DHIZ BIT(15)
#define RDA5807_MASK_CTRL_DMUTE BIT(14)
#define RDA5807_MASK_CTRL_MONO BIT(13)
#define RDA5807_MASK_CTRL_BASS BIT(12)
#define RDA5807_MASK_CTRL_SEEKUP BIT(9)
#define RDA5807_MASK_CTRL_SEEK BIT(8)
#define RDA5807_MASK_CTRL_SKMODE BIT(7)
#define RDA5807_MASK_CTRL_CLKMODE (7 << 4)
#define RDA5807_MASK_CTRL_SOFTRESET BIT(1)
#define RDA5807_MASK_CTRL_ENABLE BIT(0)
#define RDA5807_SHIFT_CHAN_WRCHAN 6
#define RDA5807_MASK_CHAN_WRCHAN (0x3FF << RDA5807_SHIFT_CHAN_WRCHAN)
#define RDA5807_MASK_CHAN_TUNE BIT(4)
#define RDA5807_SHIFT_CHAN_BAND 2
#define RDA5807_MASK_CHAN_BAND (0x3 << RDA5807_SHIFT_CHAN_BAND)
#define RDA5807_SHIFT_CHAN_SPACE 0
#define RDA5807_MASK_CHAN_SPACE (0x3 << RDA5807_SHIFT_CHAN_SPACE)
#define RDA5807_MASK_SEEKRES_COMPLETE BIT(14)
#define RDA5807_MASK_SEEKRES_FAIL BIT(13)
#define RDA5807_MASK_SEEKRES_STEREO BIT(10)
#define RDA5807_MASK_SEEKRES_READCHAN 0x3FF
#define RDA5807_MASK_DEEMPHASIS BIT(11)
#define RDA5807_SHIFT_VOLUME_DAC 0
#define RDA5807_MASK_VOLUME_DAC (0xF << RDA5807_SHIFT_VOLUME_DAC)
#define RDA5807_SHIFT_RSSI 9
#define RDA5807_MASK_RSSI (0x7F << RDA5807_SHIFT_RSSI)
#define RDA5807_FREQ_MIN_KHZ 76000
#define RDA5807_FREQ_MAX_KHZ 108000
static int rda5807_i2c_read(struct i2c_client *client, enum rda5807_reg reg)
{
__u8 reg_buf = reg;
__u16 val_buf;
struct i2c_msg msgs[] = {
{ /* write register number */
.addr = client->addr,
.flags = 0,
.len = sizeof(reg_buf),
.buf = ®_buf,
},
{ /* read register contents */
.addr = client->addr,
.flags = I2C_M_RD,
.len = sizeof(val_buf),
.buf = (__u8 *)&val_buf,
},
};
int err;
err = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
if (err < 0) return err;
if (err < ARRAY_SIZE(msgs)) return -EIO;
//dev_info(&client->dev, "reg[%02X] = %04X\n", reg, be16_to_cpu(val_buf));
return be16_to_cpu(val_buf);
}
static int rda5807_i2c_write(struct i2c_client *client, enum rda5807_reg reg,
u16 val)
{
__u8 buf[] = { reg, val >> 8, val & 0xFF };
struct i2c_msg msgs[] = {
{ /* write register number and contents */
.addr = client->addr,
.flags = 0,
.len = sizeof(buf),
.buf = buf,
},
};
int err;
err = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
if (err < 0) return err;
if (err < ARRAY_SIZE(msgs)) return -EIO;
//dev_info(&client->dev, "reg[%02X] := %04X\n", reg, val);
return 0;
}
struct rda5807_driver {
struct v4l2_ctrl_handler ctrl_handler;
struct video_device video_dev;
struct v4l2_device v4l2_dev;
struct i2c_client *i2c_client;
u8 input_flags;
u8 output_flags;
};
static const struct v4l2_file_operations rda5807_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = video_ioctl2,
};
static int rda5807_update_reg(struct rda5807_driver *radio,
enum rda5807_reg reg, u16 mask, u16 val)
{
int err = 0;
// TODO: Locking.
// Or do locking in the caller, in case we ever need to update
// two registers in one operation?
err = rda5807_i2c_read(radio->i2c_client, reg);
if (err >= 0) {
val |= ((u16)err & ~mask);
err = rda5807_i2c_write(radio->i2c_client, reg, val);
}
return err;
}
static int rda5807_set_enable(struct rda5807_driver *radio, int enabled)
{
u16 val = enabled ? RDA5807_MASK_CTRL_ENABLE : 0;
int err;
//dev_info(&radio->i2c_client->dev, "set enabled to %d\n", enabled);
err = rda5807_update_reg(radio, RDA5807_REG_CTRL,
RDA5807_MASK_CTRL_ENABLE, val);
if (err < 0)
return err;
/* Tuning is lost when the chip is disabled, so re-tune when enabled. */
if (enabled) {
err = rda5807_update_reg(radio, RDA5807_REG_CHAN,
RDA5807_MASK_CHAN_TUNE,
RDA5807_MASK_CHAN_TUNE);
/* following the rda5807 programming guide, we
* need to wait for 0.5 seconds before tune */
if (!err)
msleep(500);
}
return err;
}
static int rda5807_set_mute(struct rda5807_driver *radio, int muted)
{
u16 val = muted ? 0 : RDA5807_MASK_CTRL_DMUTE /* disable mute */;
//dev_info(&radio->i2c_client->dev, "set mute to %d\n", muted);
return rda5807_update_reg(radio, RDA5807_REG_CTRL,
RDA5807_MASK_CTRL_DMUTE, val);
}
static int rda5807_set_volume(struct rda5807_driver *radio, int volume)
{
//dev_info(&radio->i2c_client->dev, "set volume to %d\n", volume);
return rda5807_update_reg(radio, RDA5807_REG_INTM_THRESH_VOL,
RDA5807_MASK_VOLUME_DAC,
volume << RDA5807_SHIFT_VOLUME_DAC);
}
static int rda5807_set_preemphasis(struct rda5807_driver *radio,
enum v4l2_preemphasis preemp)
{
//dev_info(&radio->i2c_client->dev, "set preemphasis to %d\n", preemp);
return rda5807_update_reg(radio, RDA5807_REG_IOCFG,
RDA5807_MASK_DEEMPHASIS,
preemp == V4L2_PREEMPHASIS_50_uS
? RDA5807_MASK_DEEMPHASIS : 0);
}
static int rda5807_get_frequency(struct rda5807_driver *radio)
{
u32 freq_khz;
u16 val;
int err;
err = rda5807_i2c_read(radio->i2c_client, RDA5807_REG_SEEK_RESULT);
if (err < 0)
return err;
val = err;
freq_khz = 50 * (val & RDA5807_MASK_SEEKRES_READCHAN)
+ RDA5807_FREQ_MIN_KHZ;
//dev_info(&radio->i2c_client->dev, "get freq of %u kHz\n", freq_khz);
return freq_khz;
}
static int rda5807_set_frequency(struct rda5807_driver *radio, u32 freq_khz)
{
u16 mask = 0;
u16 val = 0;
//dev_info(&radio->i2c_client->dev, "set freq to %u kHz\n", freq_khz);
if (freq_khz < RDA5807_FREQ_MIN_KHZ)
return -ERANGE;
if (freq_khz > RDA5807_FREQ_MAX_KHZ)
return -ERANGE;
/* select widest band */
mask |= RDA5807_MASK_CHAN_BAND;
val |= 2 << RDA5807_SHIFT_CHAN_BAND;
/* select 50 kHz channel spacing */
mask |= RDA5807_MASK_CHAN_SPACE;
val |= 2 << RDA5807_SHIFT_CHAN_SPACE;
/* select frequency */
mask |= RDA5807_MASK_CHAN_WRCHAN;
val |= ((freq_khz - RDA5807_FREQ_MIN_KHZ + 25) / 50)
<< RDA5807_SHIFT_CHAN_WRCHAN;
/* start tune operation */
mask |= RDA5807_MASK_CHAN_TUNE;
val |= RDA5807_MASK_CHAN_TUNE;
return rda5807_update_reg(radio, RDA5807_REG_CHAN, mask, val);
}
static int rda5807_seek_frequency(struct rda5807_driver *radio,
int upward, int wrap)
{
u16 mask = 0;
u16 val = 0;
int ret, count = 0;
/* TODO: Seek threshold is configurable. How should the driver handle
* this configuration?
*/
/* seek up or down? */
mask |= RDA5807_MASK_CTRL_SEEKUP;
if (upward)
val |= RDA5807_MASK_CTRL_SEEKUP;
/* wrap around at band limit? */
mask |= RDA5807_MASK_CTRL_SKMODE;
if (!wrap)
val |= RDA5807_MASK_CTRL_SKMODE;
/* seek command */
mask |= RDA5807_MASK_CTRL_SEEK;
val |= RDA5807_MASK_CTRL_SEEK;
ret = rda5807_update_reg(radio, RDA5807_REG_CTRL, mask, val);
if (ret < 0)
return ret;
while (1) {
/*
* The programming guide says we should wait for 35 ms for each
* frequency tested.
*/
msleep(35);
ret = rda5807_i2c_read(radio->i2c_client,
RDA5807_REG_SEEK_RESULT);
if (ret < 0)
return ret;
/* Seek done? */
if (ret & RDA5807_MASK_SEEKRES_COMPLETE)
return 0;
/*
* Channel spacing is 100 kHz.
* TODO: Should we support configurable spacing?
*/
count++;
if (count > (RDA5807_FREQ_MAX_KHZ - RDA5807_FREQ_MIN_KHZ) / 100)
return -ETIMEDOUT;
}
}
static inline struct rda5807_driver *ctrl_to_radio(struct v4l2_ctrl *ctrl)
{
return container_of(ctrl->handler, struct rda5807_driver, ctrl_handler);
}
static int rda5807_s_ctrl(struct v4l2_ctrl *ctrl)
{
struct rda5807_driver *radio = ctrl_to_radio(ctrl);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE: {
/* Disable the radio while muted, to save power.
* TODO: We can't seek while the radio is disabled;
* is that a problem?
*/
int err1 = rda5807_set_enable(radio, !ctrl->val);
int err2 = rda5807_set_mute(radio, ctrl->val);
return err1 ? err1 : err2;
}
case V4L2_CID_AUDIO_VOLUME:
return rda5807_set_volume(radio, ctrl->val);
case V4L2_CID_TUNE_PREEMPHASIS:
return rda5807_set_preemphasis(radio, ctrl->val);
default:
return -EINVAL;
}
}
static const struct v4l2_ctrl_ops rda5807_ctrl_ops = {
.s_ctrl = rda5807_s_ctrl,
};
static int rda5807_vidioc_querycap(struct file *file, void *fh,
struct v4l2_capability *cap)
{
*cap = (struct v4l2_capability) {
.driver = "rda5807",
.card = "RDA5807 FM receiver",
.bus_info = "I2C",
.device_caps = V4L2_CAP_RADIO | V4L2_CAP_TUNER
| V4L2_CAP_HW_FREQ_SEEK,
};
cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
return 0;
}
static int rda5807_vidioc_g_audio(struct file *file, void *fh,
struct v4l2_audio *a)
{
if (a->index != 0)
return -EINVAL;
*a = (struct v4l2_audio) {
.name = "Radio",
.capability = V4L2_AUDCAP_STEREO,
.mode = 0,
};
return 0;
}
static int rda5807_vidioc_g_tuner(struct file *file, void *fh,
struct v4l2_tuner *a)
{
struct rda5807_driver *radio = video_drvdata(file);
int err;
u16 seekres, signal;
__u32 rxsubchans;
if (a->index != 0)
return -EINVAL;
err = rda5807_i2c_read(radio->i2c_client, RDA5807_REG_SEEK_RESULT);
if (err < 0)
return err;
seekres = (u16)err;
if ((seekres & (RDA5807_MASK_SEEKRES_COMPLETE
| RDA5807_MASK_SEEKRES_FAIL))
== RDA5807_MASK_SEEKRES_COMPLETE)
/* mono/stereo known */
rxsubchans = seekres & RDA5807_MASK_SEEKRES_STEREO
? V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO;
else
/* mono/stereo unknown */
rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
err = rda5807_i2c_read(radio->i2c_client, RDA5807_REG_SIGNAL);
if (err < 0)
return err;
signal = ((u16)err & RDA5807_MASK_RSSI) >> RDA5807_SHIFT_RSSI;
*a = (struct v4l2_tuner) {
.name = "FM",
.type = V4L2_TUNER_RADIO,
.capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO,
/* unit is 1/16 kHz */
.rangelow = RDA5807_FREQ_MIN_KHZ * 16,
.rangehigh = RDA5807_FREQ_MAX_KHZ * 16,
.rxsubchans = rxsubchans,
/* TODO: Implement forced mono (RDA5807_MASK_CTRL_MONO). */
.audmode = V4L2_TUNER_MODE_STEREO,
.signal = signal << (16 - 7),
.afc = 0, /* automatic frequency control */
};
return 0;
}
static int rda5807_vidioc_g_frequency(struct file *file, void *fh,
struct v4l2_frequency *a)
{
struct rda5807_driver *radio = video_drvdata(file);
int freq_khz;
if (a->tuner != 0)
return -EINVAL;
/* This ioctl ignores the type field. */
freq_khz = rda5807_get_frequency(radio);
if (freq_khz < 0)
return freq_khz;
a->frequency = (__u32)freq_khz * 16;
return 0;
}
static int rda5807_vidioc_s_frequency(struct file *file, void *fh,
const struct v4l2_frequency *a)
{
struct rda5807_driver *radio = video_drvdata(file);
if (a->tuner != 0)
return -EINVAL;
if (a->type != V4L2_TUNER_RADIO)
return -EINVAL;
return rda5807_set_frequency(radio, (a->frequency * 625) / 10000);
}
static int rda5807_vidioc_s_hw_freq_seek(struct file *file, void *fh,
const struct v4l2_hw_freq_seek *a)
{
struct rda5807_driver *radio = video_drvdata(file);
if (a->tuner != 0)
return -EINVAL;
if (a->type != V4L2_TUNER_RADIO)
return -EINVAL;
return rda5807_seek_frequency(radio, a->seek_upward, a->wrap_around);
}
static const struct v4l2_ioctl_ops rda5807_ioctl_ops = {
.vidioc_querycap = rda5807_vidioc_querycap,
.vidioc_g_audio = rda5807_vidioc_g_audio,
.vidioc_g_tuner = rda5807_vidioc_g_tuner,
.vidioc_g_frequency = rda5807_vidioc_g_frequency,
.vidioc_s_frequency = rda5807_vidioc_s_frequency,
.vidioc_s_hw_freq_seek = rda5807_vidioc_s_hw_freq_seek,
};
static const char *rda5807_name = "RDA5807 FM receiver";
static const u16 rda5807_lna_current[] = { 1800, 2100, 2500, 3000 };
static int rda5807_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct device_node *np = client->dev.of_node;
struct rda5807_platform_data *pdata = client->dev.platform_data;
struct rda5807_driver *radio;
int err;
u16 val;
radio = devm_kzalloc(&client->dev, sizeof(*radio), GFP_KERNEL);
if (!radio) {
dev_err(&client->dev, "Failed to allocate driver data\n");
return -ENOMEM;
}
radio->i2c_client = client;
/* Configuration. */
if (IS_ENABLED(CONFIG_OF) && np) {
u16 lna_current = 2500;
size_t i;
radio->input_flags = 0;
of_property_read_u16(np, "lna-current", &lna_current);
for (i = 0; i < ARRAY_SIZE(rda5807_lna_current); i++)
if (rda5807_lna_current[i] == lna_current)
radio->input_flags = i;
if (of_property_read_bool(np, "lnan"))
radio->input_flags |= RDA5807_LNA_PORT_N;
if (of_property_read_bool(np, "lnap"))
radio->input_flags |= RDA5807_LNA_PORT_P;
if (of_property_read_bool(np, "i2s-out"))
radio->output_flags |= RDA5807_OUTPUT_AUDIO_I2S;
if (of_property_read_bool(np, "analog-out"))
radio->output_flags |= RDA5807_OUTPUT_AUDIO_ANALOG;
} else if (pdata) {
radio->input_flags = pdata->input_flags;
radio->output_flags = pdata->output_flags;
} else {
radio->input_flags = RDA5807_INPUT_LNA_WC_25;
radio->output_flags = 0;
}
if (!(radio->input_flags & (RDA5807_LNA_PORT_N | RDA5807_LNA_PORT_P)))
dev_warn(&client->dev, "Both LNA inputs disabled\n");
err = rda5807_i2c_read(client, RDA5807_REG_CHIPID);
if (err < 0) {
dev_err(&client->dev, "Failed to read chip ID (%d)\n", err);
return err;
}
val = err;
if ((val & 0xFF00) != 0x5800) {
dev_err(&client->dev, "Chip ID mismatch: "
"expected 58xx, got %04X\n", val);
return -ENODEV;
}
dev_info(&client->dev, "Found FM radio receiver\n");
// TODO: Resetting the chip would be good.
/* Initialize controls. */
v4l2_ctrl_handler_init(&radio->ctrl_handler, 3);
v4l2_ctrl_new_std(&radio->ctrl_handler, &rda5807_ctrl_ops,
V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1);
v4l2_ctrl_new_std(&radio->ctrl_handler, &rda5807_ctrl_ops,
V4L2_CID_AUDIO_VOLUME, 0, 15, 1, 8);
/* TODO: V4L2_CID_TUNE_PREEMPHASIS is based on V4L2_CID_FM_TX_CLASS_BASE
* which suggests it is a transmit control rather than a receive
* control. The register bit we change is called "de-emphasis",
* but there is no de-emphasis control in V4L2.
*/
v4l2_ctrl_new_std_menu(&radio->ctrl_handler, &rda5807_ctrl_ops,
V4L2_CID_TUNE_PREEMPHASIS,
V4L2_PREEMPHASIS_75_uS,
BIT(V4L2_PREEMPHASIS_DISABLED),
V4L2_PREEMPHASIS_50_uS);
err = radio->ctrl_handler.error;
if (err) {
dev_err(&client->dev, "Failed to init controls handler (%d)\n",
err);
goto err_ctrl_free;
}
strlcpy(radio->v4l2_dev.name, rda5807_name,
sizeof(radio->v4l2_dev.name));
err = v4l2_device_register(NULL, &radio->v4l2_dev);
if (err < 0) {
dev_err(&client->dev, "Failed to register v4l2 device (%d)\n",
err);
goto err_ctrl_free;
}
radio->video_dev = (struct video_device) {
.name = "RDA5807 FM receiver",
.v4l2_dev = &radio->v4l2_dev,
.ctrl_handler = &radio->ctrl_handler,
.fops = &rda5807_fops,
.ioctl_ops = &rda5807_ioctl_ops,
.release = video_device_release_empty,
//.lock = &radio->lock,
};
i2c_set_clientdata(client, radio);
video_set_drvdata(&radio->video_dev, radio);
err = video_register_device(&radio->video_dev, VFL_TYPE_RADIO, -1);
if (err < 0) {
dev_err(&client->dev, "Failed to register video device (%d)\n",
err);
goto err_ctrl_free;
}
/* Configure chip inputs. */
err = rda5807_update_reg(radio, RDA5807_REG_INTM_THRESH_VOL,
0xF << 4, (radio->input_flags & 0xF) << 4);
if (err < 0) {
dev_warn(&client->dev, "Failed to configure inputs (%d)\n",
err);
}
/* Configure chip outputs. */
val = 0;
if (radio->output_flags & RDA5807_OUTPUT_AUDIO_I2S) {
val |= BIT(6);
}
err = rda5807_update_reg(radio, RDA5807_REG_IOCFG, 0x003F, val);
if (err < 0) {
dev_warn(&client->dev, "Failed to configure outputs (%d)\n",
err);
}
val = 0;
if (radio->output_flags & RDA5807_OUTPUT_AUDIO_ANALOG) {
val |= BIT(15);
}
err = rda5807_update_reg(radio, RDA5807_REG_CTRL, BIT(15), val);
if (err < 0) {
dev_warn(&client->dev, "Failed to configure outputs (%d)\n",
err);
}
err = v4l2_ctrl_handler_setup(&radio->ctrl_handler);
if (err < 0) {
dev_err(&client->dev, "Failed to set default control values"
" (%d)\n", err);
goto err_video_unreg;
}
return 0;
err_video_unreg:
video_unregister_device(&radio->video_dev);
err_ctrl_free:
v4l2_ctrl_handler_free(&radio->ctrl_handler);
/*err_radio_rel:*/
video_device_release_empty(&radio->video_dev);
return err;
}
static int rda5807_i2c_remove(struct i2c_client *client)
{
struct rda5807_driver *radio = i2c_get_clientdata(client);
video_unregister_device(&radio->video_dev);
v4l2_ctrl_handler_free(&radio->ctrl_handler);
video_device_release_empty(&radio->video_dev);
return 0;
}
#ifdef CONFIG_PM_SLEEP
static int rda5807_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct rda5807_driver *radio = i2c_get_clientdata(client);
return rda5807_set_enable(radio, 0);
}
static int rda5807_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct rda5807_driver *radio = i2c_get_clientdata(client);
struct v4l2_ctrl *mute_ctrl = v4l2_ctrl_find(&radio->ctrl_handler,
V4L2_CID_AUDIO_MUTE);
s32 mute_val = v4l2_ctrl_g_ctrl(mute_ctrl);
int enabled = !mute_val;
if (enabled)
return rda5807_set_enable(radio, enabled);
else
return 0;
}
static SIMPLE_DEV_PM_OPS(rda5807_pm_ops, rda5807_suspend, rda5807_resume);
#define RDA5807_PM_OPS (&rda5807_pm_ops)
#else
#define RDA5807_PM_OPS NULL
#endif
static const struct i2c_device_id rda5807_id[] = {
{ "radio-rda5807", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, rda5807_id);
#ifdef CONFIG_OF
static const struct of_device_id rda5807_dt_ids[] = {
{ .compatible = "rdamicro,rda5807" },
{ }
};
MODULE_DEVICE_TABLE(of, rda5807_dt_ids);
#endif
static struct i2c_driver rda5807_i2c_driver = {
.probe = rda5807_i2c_probe,
.remove = rda5807_i2c_remove,
.id_table = rda5807_id,
.driver = {
.name = "radio-rda5807",
.owner = THIS_MODULE,
.pm = RDA5807_PM_OPS,
.of_match_table = of_match_ptr(rda5807_dt_ids),
},
};
module_i2c_driver(rda5807_i2c_driver);
MODULE_AUTHOR("Maarten ter Huurne <maarten@treewalker.org>");
MODULE_DESCRIPTION("RDA5807 FM tuner driver");
MODULE_LICENSE("GPL");
[ 3.184258]sunxi-i2c sunxi-i2c2: sunxi-i2c2 supply twi not found, using dummy regulator
[ 3.202392]sunxi-i2c sunxi-i2c2: probe success
[ 3.208113]sunxi-i2c sunxi-i2c3: sunxi-i2c3 supply twi not found, using dummy regulator
[ 3.226532]radio-rda5807 3-0011: Found FM radio receiver
[ 3.232603]------------[ cut here ]------------
[ 3.237743]WARNING: CPU: 0 PID: 13 at drivers/media/v4l2-core/v4l2-dev.c:863 __video_register_device+0x5e/0xbda
[ 3.249124]Modules linked in:
[ 3.252491]CPU: 0 PID: 13 Comm: kworker/0:1 Not tainted 5.4.61 #206
[ 3.259582]Workqueue: events deferred_probe_work_func
[ 3.265235]sepc: ffffffe00032362c ra : ffffffe00034d6a2 sp : ffffffe003963710
[ 3.273275] gp : ffffffe0007131dc tp : ffffffe003940ac0 t0 : ffffffe002e66540
[ 3.281339] t1 : 0000000000000000 t2 : 000000007d547100 s0 : ffffffe003963790
[ 3.289342] s1 : ffffffe002e66108 a0 : ffffffe002e66108 a1 : 0000000000000002
[ 3.297354] a2 : ffffffffffffffff a3 : 0000000000000001 a4 : 0000000000000000
[ 3.305411] a5 : ffffffe002e66540 a6 : 0000000000000000 a7 : 0000000000000000
[ 3.313421] s2 : 0000000000000000 s3 : 0000000000000000 s4 : 0000000000000000
[ 3.321480] s5 : ffffffe002e52800 s6 : 0000000000000001 s7 : ffffffe002e66540
[ 3.329547] s8 : ffffffe000626e70 s9 : fffffffffffffff7 s10: ffffffe000626e48
[ 3.337561] s11: 0000000000000000 t3 : ffffffffffffffff t4 : ffffffe000704be8
[ 3.345583] t5 : 0000000000000038 t6 : ffffffe002e664c4
[ 3.351490]sstatus: 0000000200000120 sbadaddr: 0000000000000000 scause: 0000000000000003
[ 3.360611]---[ end trace 67bd5ac7bc0e652e ]---
[ 3.365682]radio-rda5807 3-0011: Failed to register video device (-22)
[ 3.373112]radio-rda5807: probe of 3-0011 failed with error -22
[ 3.379816]sunxi-i2c sunxi-i2c3: probe success
amixer -D hw:audiocodec cset name='Headphone Switch' 1 # 开启耳机输出
amixer -D hw:audiocodec cset name='Headphone Volume' 3 # 设定音量
tplayerdemo badapple_1080p_x265.mp4 # 播放视频
首先,修改一下系统,参考 https://bbs.aw-ol.com/topic/1002/
打开 lichee/brandy-2.0/u-boot-2018/drivers/sunxi_flash/mmc/sdmmc.c
文件,把 return sdmmc_init_for_sprite(0, 2)
改为 return sdmmc_init_for_sprite(0, 0)
int sunxi_sprite_mmc_probe(void)
{
#ifndef CONFIG_MACH_SUN50IW11
- return sdmmc_init_for_sprite(0, 2);
+ return sdmmc_init_for_sprite(0, 0);
#else
int workmode = uboot_spare_head.boot_data.work_mode;
if (workmode == WORK_MODE_CARD_PRODUCT)
return -1;
else
return sdmmc_init_for_sprite(0, 0);
#endif
}
SD卡先刷入一个系统。
然后启动系统,进入Uboot倒计时,终止它启动内核
按住板子上的FEL键(左边那一个),命令行输入efex
,输入完efex后6秒就可以松开了。
就可以愉快刷写了。
Windows10有一点奇怪,他会自己从网络上安装驱动。这本来没什么坏处,但是对于全志的驱动,他会自动安装成其他设备使用的驱动,导致驱动不匹配。使用驱动安装器安装后虽然有官方驱动但是不是首选驱动。所以要手动更换驱动。
找到资源管理器里的USB Device(VID_1f3a_PID_efe8)
,如果没见到就是板子没进入FEL模式。
右键,更新驱动程序
浏览我的电脑查找
让我从计算机上的可用驱动列表中选取
从磁盘安装
浏览
选择 AW_Driver
里的usbdrv.inf
文件
确定
下一页
安装完成,关闭窗口
然后就可以烧写固件了
@daming123 设备树也要改一下
board.dts
/*
* Allwinner Technology CO., Ltd. sun20iw1p1 fpga.
*
* fpga support.
*/
/dts-v1/;
/memreserve/ 0x42000000 0x100000; /* dsp used 1MB */
#include "sun20iw1p1.dtsi"
/{
compatible = "allwinner,d1-h", "arm,sun20iw1p1", "allwinner,sun20iw1p1";
aliases {
dsp0 = &dsp0;
dsp0_gpio_int= &dsp0_gpio_int;
gmac0 = &gmac0;
};
dsp0: dsp0 {
compatible = "allwinner,sun20iw1-dsp";
status = "okay";
};
dsp0_gpio_int: dsp0_gpio_int {
compatible = "allwinner,sun20iw1-dsp-gpio-int";
pin-group = "PB", "PC", "PD", "PE";
status = "disabled";
};
reg_vdd_cpu: vdd-cpu {
compatible = "sunxi-pwm-regulator";
pwms = <&pwm 0 5000 1>;
regulator-name = "vdd_cpu";
regulator-min-microvolt = <810000>;
regulator-max-microvolt = <1160000>;
regulator-ramp-delay = <25>;
regulator-always-on;
regulator-boot-on;
status = "okay";
};
reg_usb1_vbus: usb1-vbus {
compatible = "regulator-fixed";
regulator-name = "usb1-vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-enable-ramp-delay = <1000>;
gpio = <&pio PD 19 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
};
&CPU0 {
cpu-supply = <®_vdd_cpu>;
};
&pio {
sdc0_pins_a: sdc0@0 {
allwinner,pins = "PF0", "PF1", "PF2",
"PF3", "PF4", "PF5";
allwinner,function = "sdc0";
allwinner,muxsel = <2>;
allwinner,drive = <3>;
allwinner,pull = <1>;
pins = "PF0", "PF1", "PF2",
"PF3", "PF4", "PF5";
function = "sdc0";
drive-strength = <30>;
bias-pull-up;
power-source = <3300>;
};
sdc0_pins_b: sdc0@1 {
pins = "PF0", "PF1", "PF2",
"PF3", "PF4", "PF5";
function = "sdc0";
drive-strength = <30>;
bias-pull-up;
power-source = <1800>;
};
sdc0_pins_c: sdc0@2 {
pins = "PF0", "PF1", "PF2",
"PF3", "PF4", "PF5";
function = "gpio_in";
};
/* TODO: add jtag pin */
sdc0_pins_d: sdc0@3 {
pins = "PF2", "PF4";
function = "uart0";
drive-strength = <10>;
bias-pull-up;
};
sdc0_pins_e: sdc0@4 {
pins = "PF0", "PF1", "PF3",
"PF5";
function = "jtag";
drive-strength = <10>;
bias-pull-up;
};
sdc1_pins_a: sdc1@0 {
pins = "PG0", "PG1", "PG2",
"PG3", "PG4", "PG5";
function = "sdc1";
drive-strength = <30>;
bias-pull-up;
};
sdc1_pins_b: sdc1@1 {
pins = "PG0", "PG1", "PG2",
"PG3", "PG4", "PG5";
function = "gpio_in";
};
sdc2_pins_a: sdc2@0 {
allwinner,pins = "PC2", "PC3", "PC4",
"PC5", "PC6", "PC7";
allwinner,function = "sdc2";
allwinner,muxsel = <3>;
allwinner,drive = <3>;
allwinner,pull = <1>;
pins = "PC2", "PC3", "PC4",
"PC5", "PC6", "PC7";
function = "sdc2";
drive-strength = <30>;
bias-pull-up;
};
sdc2_pins_b: sdc2@1 {
pins = "PC2", "PC3", "PC4",
"PC5", "PC6", "PC7";
function = "gpio_in";
};
wlan_pins_a:wlan@0 {
pins = "PG11";
function = "clk_fanout1";
};
uart0_pins_a: uart0_pins@0 { /* For nezha board */
pins = "PB8", "PB9";
function = "uart0";
drive-strength = <10>;
bias-pull-up;
};
uart0_pins_b: uart0_pins@1 { /* For nezha board */
pins = "PB8", "PB9";
function = "gpio_in";
};
uart1_pins_a: uart1_pins@0 { /* For EVB1 board */
pins = "PG6", "PG7", "PG8", "PG9";
function = "uart1";
drive-strength = <10>;
bias-pull-up;
};
uart1_pins_b: uart1_pins { /* For EVB1 board */
pins = "PG6", "PG7", "PG8", "PG9";
function = "gpio_in";
};
uart2_pins_a: uart2_pins@0 { /* For EVB1 board */
pins = "PC0", "PC1";
function = "uart2";
drive-strength = <10>;
bias-pull-up;
};
uart2_pins_b: uart2_pins@1 { /* For EVB1 board */
pins = "PC0", "PC1";
function = "gpio_in";
};
uart3_pins_a: uart3_pins@0 { /* For EVB1 board */
pins = "PD10", "PD11";
function = "uart3";
muxsel = <5>;
drive-strength = <10>;
bias-pull-up;
};
twi0_pins_a: twi0@0 {
pins = "PB10", "PB11"; /*sck sda*/
function = "twi0";
drive-strength = <10>;
};
twi0_pins_b: twi0@1 {
pins = "PB10", "PB11";
function = "gpio_in";
};
twi1_pins_a: twi1@0 {
pins = "PB4", "PB5";
function = "twi1";
drive-strength = <10>;
};
twi1_pins_b: twi1@1 {
pins = "PB4", "PB5";
function = "gpio_in";
};
twi2_pins_a: twi2@0 {
pins = "PB0", "PB1";
function = "twi2";
drive-strength = <10>;
};
twi2_pins_b: twi2@1 {
pins = "PB0", "PB1";
function = "gpio_in";
};
twi3_pins_a: twi3@0 {
pins = "PB6", "PB7";
function = "twi3";
drive-strength = <10>;
};
twi3_pins_b: twi3@1 {
pins = "PB6", "PB7";
function = "gpio_in";
};
gmac_pins_a: gmac@0 {
pins = "PE0", "PE1", "PE2", "PE3",
"PE4", "PE5", "PE6", "PE7",
"PE8", "PE9", "PE10", "PE11",
"PE12", "PE13", "PE14", "PE15";
function = "gmac0";
muxsel = <8>; /* for uboot driver */
drive-strength = <10>;
};
gmac_pins_b: gmac@1 {
pins = "PE0", "PE1", "PE2", "PE3",
"PE4", "PE5", "PE6", "PE7",
"PE8", "PE9", "PE10", "PE11",
"PE12", "PE13", "PE14", "PE15";
function = "gpio_in";
};
dmic_pins_a: dmic@0 {
/* DMIC_PIN: CLK, DATA0, DATA1, DATA2 */
pins = "PE17", "PB11", "PB10", "PD17";
function = "dmic";
drive-strength = <20>;
bias-disable;
};
dmic_pins_b: dmic@1 {
pins = "PE17", "PB11", "PB10", "PD17";
function = "io_disabled";
drive-strength = <20>;
bias-disable;
};
daudio0_pins_a: daudio0@0 {
/* MCLK, BCLK, LRCK */
pins = "PE17", "PE16", "PE15";
function = "i2s0";
drive-strength = <20>;
bias-disable;
};
daudio0_pins_b: daudio0@1 {
/* DIN0 */
pins = "PE14";
function = "i2s0_din";
drive-strength = <20>;
bias-disable;
};
daudio0_pins_c: daudio0@2 {
/* DOUT0 */
pins = "PE13";
function = "i2s0_dout";
drive-strength = <20>;
bias-disable;
};
daudio0_pins_d: daudio0_sleep@0 {
pins = "PE17", "PE16", "PE15", "PE14", "PE13";
function = "io_disabled";
drive-strength = <20>;
bias-disable;
};
daudio1_pins_a: daudio1@0 {
/* MCLK, LRCK, BCLK */
pins = "PG11", "PG12", "PG13";
function = "i2s1";
drive-strength = <20>;
bias-disable;
};
daudio1_pins_b: daudio1@1 {
/* DIN0 */
pins = "PG14";
function = "i2s1_din";
drive-strength = <20>;
bias-disable;
};
daudio1_pins_c: daudio1@2 {
/* DOUT0 */
pins = "PG15";
function = "i2s1_dout";
drive-strength = <20>;
bias-disable;
};
daudio1_pins_d: daudio1_sleep@0 {
pins = "PG11", "PG12", "PG13", "PG14", "PG15";
function = "io_disabled";
drive-strength = <20>;
bias-disable;
};
daudio2_pins_a: daudio2@0 {
/* I2S_PIN: MCLK, BCLK, LRCK */
pins = "PB7", "PB5", "PB6";
function = "i2s2";
drive-strength = <20>;
bias-disable;
};
daudio2_pins_b: daudio2@1 {
/* I2S_PIN: DOUT0 */
pins = "PB4";
function = "i2s2_dout";
drive-strength = <20>;
bias-disable;
};
daudio2_pins_c: daudio2@2 {
/* I2S_PIN: DIN0 */
pins = "PB3";
function = "i2s2_din";
drive-strength = <20>;
bias-disable;
};
daudio2_pins_d: daudio2_sleep@0 {
pins = "PB7", "PB5", "PB6", "PB4", "PB3";
function = "io_disabled";
drive-strength = <20>;
bias-disable;
};
spdif_pins_a: spdif@0 {
/* SPDIF_PIN: SPDIF_OUT */
pins = "PB0";
function = "spdif";
drive-strength = <20>;
bias-disable;
};
spdif_pins_b: spdif_sleep@0 {
pins = "PB0";
function = "io_disabled";
drive-strength = <20>;
bias-disable;
};
spi0_pins_a: spi0@0 {
pins = "PC2", "PC4", "PC5"; /* clk, mosi, miso */
function = "spi0";
muxsel = <2>;
drive-strength = <10>;
};
spi0_pins_b: spi0@1 {
pins = "PC3", "PC7", "PC6";
function = "spi0";
muxsel = <2>;
drive-strength = <10>;
bias-pull-up; /* cs, hold, wp should be pulled up */
};
spi0_pins_c: spi0@2 {
pins = "PC2", "PC3", "PC4", "PC5","PC6", "PC7";
function = "gpio_in";
muxsel = <0>;
drive-strength = <10>;
};
spi1_pins_a: spi1@0 {
pins = "PD11", "PD12", "PD13"; /* clk, mosi, miso */
function = "spi1";
drive-strength = <10>;
};
spi1_pins_b: spi1@1 {
pins = "PD10", "PD14", "PD15";
function = "spi1";
drive-strength = <10>;
bias-pull-up; /* cs, hold, wp should be pulled up */
};
spi1_pins_c: spi1@2 {
pins = "PD10", "PD11", "PD12", "PD13","PD14", "PD15";
function = "gpio_in";
drive-strength = <10>;
};
ledc_pins_a: ledc@0 {
pins = "PC0";
function = "ledc";
drive-strength = <10>;
};
ledc_pins_b: ledc@1 {
pins = "PC0";
function = "gpio_in";
};
pwm0_pin_a: pwm0@0 {
pins = "PD16";
function = "pwm0";
drive-strength = <10>;
bias-pull-up;
};
pwm0_pin_b: pwm0@1 {
pins = "PD16";
function = "gpio_in";
bias-disable;
};
pwm2_pin_a: pwm2@0 {
pins = "PD18";
function = "pwm2";
drive-strength = <10>;
bias-pull-up;
};
pwm2_pin_b: pwm2@1 {
pins = "PD18";
function = "gpio_out";
};
/*
pwm7_pin_a: pwm7@0 {
pins = "PD22";
function = "pwm7";
drive-strength = <10>;
bias-pull-up;
};
pwm7_pin_b: pwm7@1 {
pins = "PD22";
function = "gpio_in";
};
*/
s_cir0_pins_a: s_cir@0 {
pins = "PB12";
function = "ir";
drive-strength = <10>;
bias-pull-up;
};
s_cir0_pins_b: s_cir@1 {
pins = "PB12";
function = "gpio_in";
};
ir1_pins_a: ir1@0 {
pins = "PB0";
function = "ir";
drive-strength = <10>;
bias-pull-up;
};
ir1_pins_b: ir1@1 {
pins = "PB0";
function = "gpio_in";
};
};
&uart0 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&uart0_pins_a>;
pinctrl-1 = <&uart0_pins_b>;
status = "okay";
};
&uart1 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&uart1_pins_a>;
pinctrl-1 = <&uart1_pins_b>;
status = "okay";
};
&uart2 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&uart2_pins_a>;
pinctrl-1 = <&uart2_pins_b>;
status = "disabled";
};
&uart3 {
compatible = "allwinner,sun20iw1-dsp-uart";
pinctrl-names = "default", "sleep";
pinctrl-0 = <&uart3_pins_a>;
pinctrl-1 = <&uart3_pins_a>;
status = "okay";
};
&soc {
card0_boot_para@2 {
/*
* Avoid dtc compiling warnings.
* @TODO: Developer should modify this to the actual value
*/
reg = <0x0 0x2 0x0 0x0>;
device_type = "card0_boot_para";
card_ctrl = <0x0>;
card_high_speed = <0x1>;
card_line = <0x4>;
pinctrl-0 = <&sdc0_pins_a>;
};
card2_boot_para@3 {
/*
* Avoid dtc compiling warnings.
* @TODO: Developer should modify this to the actual value
*/
reg = <0x0 0x3 0x0 0x0>;
device_type = "card2_boot_para";
card_ctrl = <0x2>;
card_high_speed = <0x1>;
card_line = <0x4>;
pinctrl-0 = <&sdc2_pins_a>;
/*pinctrl-0 = <&sdc0_pins_a>;*/
/*sdc_ex_dly_used = <0x2>;*/
sdc_io_1v8 = <0x1>;
/*sdc_type = "tm4";*/
sdc_tm4_hs200_max_freq = <150>;
sdc_tm4_hs400_max_freq = <100>;
sdc_ex_dly_used = <2>;
/*sdc_tm4_win_th = <8>;*/
/*sdc_dis_host_caps = <0x180>;*/
};
rfkill: rfkill@0 {
compatible = "allwinner,sunxi-rfkill";
chip_en;
power_en;
pinctrl-0 = <&wlan_pins_a>;
pinctrl-names = "default";
status = "okay";
wlan: wlan@0 {
compatible = "allwinner,sunxi-wlan";
clock-names = "32k-fanout1";
clocks = <&ccu CLK_FANOUT1_OUT>;
wlan_busnum = <0x1>;
wlan_regon = <&pio PG 12 GPIO_ACTIVE_HIGH>;
wlan_hostwake = <&pio PG 10 GPIO_ACTIVE_HIGH>;
/*wlan_power = "VCC-3V3";*/
/*wlan_power_vol = <3300000>;*/
/*interrupt-parent = <&pio>;
interrupts = < PG 10 IRQ_TYPE_LEVEL_HIGH>;*/
wakeup-source;
};
bt: bt@0 {
compatible = "allwinner,sunxi-bt";
clock-names = "32k-fanout1";
clocks = <&ccu CLK_FANOUT1_OUT>;
/*bt_power_num = <0x01>;*/
/*bt_power = "axp803-dldo1";*/
/*bt_io_regulator = "axp803-dldo1";*/
/*bt_io_vol = <3300000>;*/
/*bt_power_vol = <330000>;*/
bt_rst_n = <&pio PG 18 GPIO_ACTIVE_LOW>;
status = "okay";
};
};
btlpm: btlpm@0 {
compatible = "allwinner,sunxi-btlpm";
uart_index = <0x1>;
bt_wake = <&pio PG 16 GPIO_ACTIVE_HIGH>;
bt_hostwake = <&pio PG 17 GPIO_ACTIVE_HIGH>;
status = "okay";
};
addr_mgt: addr_mgt@0 {
compatible = "allwinner,sunxi-addr_mgt";
type_addr_wifi = <0x0>;
type_addr_bt = <0x0>;
type_addr_eth = <0x0>;
status = "okay";
};
};
&sdc2 {
non-removable;
bus-width = <4>;
mmc-ddr-1_8v;
mmc-hs200-1_8v;
no-sdio;
no-sd;
ctl-spec-caps = <0x308>;
cap-mmc-highspeed;
sunxi-power-save-mode;
sunxi-dis-signal-vol-sw;
mmc-bootpart-noacc;
max-frequency = <150000000>;
/*vmmc-supply = <®_dcdc1>;*/
/*emmc io vol 3.3v*/
/*vqmmc-supply = <®_aldo1>;*/
/*emmc io vol 1.8v*/
/*vqmmc-supply = <®_eldo1>;*/
status = "disabled";
};
&sdc0 {
bus-width = <4>;
cd-gpios = <&pio PF 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
/*non-removable;*/
/*broken-cd;*/
cd-inverted;
/*data3-detect;*/
/*card-pwr-gpios = <&pio PH 14 1 1 2 0xffffffff>;*/
cd-used-24M;
cap-sd-highspeed;
/*sd-uhs-sdr50;*/
/*sd-uhs-ddr50;*/
/*sd-uhs-sdr104;*/
no-sdio;
no-mmc;
sunxi-power-save-mode;
/*sunxi-dis-signal-vol-sw;*/
max-frequency = <150000000>;
ctl-spec-caps = <0x8>;
/*vmmc-supply = <®_dcdc1>;*/
/*vqmmc33sw-supply = <®_dcdc1>;*/
/*vdmmc33sw-supply = <®_dcdc1>;*/
/*vqmmc18sw-supply = <®_eldo1>;*/
/*vdmmc18sw-supply = <®_eldo1>;*/
status = "okay";
};
&sdc1 {
bus-width = <4>;
no-mmc;
no-sd;
cap-sd-highspeed;
/*sd-uhs-sdr12*/
/*sd-uhs-sdr25;*/
/*sd-uhs-sdr50;*/
/*sd-uhs-ddr50;*/
/*sd-uhs-sdr104;*/
/*sunxi-power-save-mode;*/
/*sunxi-dis-signal-vol-sw;*/
cap-sdio-irq;
keep-power-in-suspend;
ignore-pm-notify;
max-frequency = <150000000>;
ctl-spec-caps = <0x8>;
status = "okay";
};
/*
tvd configuration
used (create device, 0: do not create device, 1: create device)
agc_auto_enable (0: agc manual mode,agc_manual_value is valid; 1: agc auto mode)
agc_manual_value (agc manual value, default value is 64)
cagc_enable (cagc 0: disable, 1: enable)
fliter_used (3d fliter 0: disable, 1: enable)
support two PMU power (tvd_power0, tvd_power1)
support two GPIO power (tvd_gpio0, tvd_gpio1)
NOTICE: If tvd need pmu power or gpio power,params need be configured under [tvd]
tvd_sw (the switch of all tvd driver.)
tvd_interface (0: cvbs, 1: ypbpr,)
tvd_format (0:TVD_PL_YUV420 , 1: MB_YUV420, 2: TVD_PL_YUV422)
tvd_system (0:ntsc, 1:pal)
tvd_row (total row number in multi channel mode 1-2)
tvd_column (total column number in multi channel mode 1-2)
tvd_channelx_en (0:disable, 1~4:position in multi channel mode,In single channel
mode,mean enable)
tvd_row*tvd_column is the total tvd channel number to be used in multichannel mode
+--------------------+--------------------+
| | |
| | |
| 1 | 2 |
| | |
| | |
+--------------------+--------------------+
| | |
| | |
| 3 | 4 |
| | |
| | |
+--------------------+--------------------+
*/
&tvd {
tvd_sw = <1>;
tvd_interface = <0>;
tvd_format = <0>;
tvd_system = <1>;
tvd_row = <1>;
tvd_column = <1>;
tvd_channel0_en = <1>;
tvd_channel1_en = <0>;
tvd_channel2_en = <0>;
tvd_channel3_en = <0>;
/*tvd_gpio0 = <&pio PD 22 GPIO_ACTIVE_HIGH>;*/
/*tvd_gpio1 = <&pio PD 23 GPIO_ACTIVE_HIGH>;*/
/*tvd_gpio2 = <&pio PD 24 GPIO_ACTIVE_HIGH>;*/
/* dc1sw-supply = <®_dc1sw>;*/
/* eldo3-supply = <®_eldo3>;*/
/*tvd_power0 = "dc1sw"*/
/*tvd_power1 = "eldo3"*/
};
&tvd0 {
used = <1>;
agc_auto_enable = <1>;
agc_manual_value = <64>;
cagc_enable = <1>;
fliter_used = <1>;
};
/* Audio Driver modules */
&sunxi_rpaf_dsp0 {
status = "okay";
};
/* if audiocodec is used, sdc0 and uart0 should be closed to enable PA. */
&codec {
/* MIC and headphone gain setting */
mic1gain = <0x13>;
mic2gain = <0x13>;
mic3gain = <0x13>;
/* ADC/DAC DRC/HPF func enabled */
/* 0x1:DAP_HP_EN; 0x2:DAP_SPK_EN; 0x3:DAP_HPSPK_EN */
adcdrc_cfg = <0x0>;
adchpf_cfg = <0x1>;
dacdrc_cfg = <0x0>;
dachpf_cfg = <0x0>;
/* Volume about */
digital_vol = <0x00>;
lineout_vol = <0x1a>;
headphonegain = <0x03>;
/* Pa enabled about */
pa_level = <0x01>;
pa_pwr_level = <0x01>;
pa_msleep_time = <0x78>;
/* gpio-spk = <&pio PF 2 GPIO_ACTIVE_HIGH>; */
/* gpio-spk-pwr = <&pio PF 4 GPIO_ACTIVE_HIGH>; */
/* regulator about */
/* avcc-supply = <®_aldo1>; */
/* hpvcc-supply = <®_eldo1>; */
status = "okay";
};
&sndcodec {
hp_detect_case = <0x01>;
jack_enable = <0x01>;
status = "okay";
};
&dummy_cpudai {
/* CMA config about */
playback_cma = <128>;
capture_cma = <256>;
status = "okay";
};
&dmic {
pinctrl-names = "default","sleep";
pinctrl-0 = <&dmic_pins_a>;
pinctrl-1 = <&dmic_pins_b>;
status = "okay";
};
&sounddmic {
status = "okay";
};
&dmic_codec {
status = "okay";
};
/*-----------------------------------------------------------------------------
* pcm_lrck_period 16/32/64/128/256
* (set 0x20 for HDMI audio out)
* slot_width_select 16bits/20bits/24bits/32bits
* (set 0x20 for HDMI audio out)
* frametype 0 --> short frame = 1 clock width;
* 1 --> long frame = 2 clock width;
* tdm_config 0 --> pcm
* 1 --> i2s
* (set 0x01 for HDMI audio out)
* mclk_div 0 --> not output
* 1/2/4/6/8/12/16/24/32/48/64/96/128/176/192
* (set mclk as external codec clk source, freq is pll_audio/mclk_div)
* pinctrl_used 0 --> I2S/PCM use for internal (e.g. HDMI)
* 1 --> I2S/PCM use for external audio
* daudio_type: 0 --> external audio type
* 1 --> HDMI audio type
*---------------------------------------------------------------------------*/
&daudio0 {
mclk_div = <0x01>;
frametype = <0x00>;
tdm_config = <0x01>;
sign_extend = <0x00>;
msb_lsb_first = <0x00>;
pcm_lrck_period = <0x80>;
slot_width_select = <0x20>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&daudio0_pins_a &daudio0_pins_b &daudio0_pins_c>;
pinctrl-1 = <&daudio0_pins_d>;
pinctrl_used = <0x0>;
status = "disabled";
};
/*-----------------------------------------------------------------------------
* simple-audio-card,name name of sound card, e.g.
* "snddaudio0" --> use for external audio
* "sndhdmi" --> use for HDMI audio
* sound-dai "snd-soc-dummy" --> use for I2S
* "hdmiaudio" --> use for HDMI audio
* "ac108" --> use for external audio of ac108
*---------------------------------------------------------------------------*/
&sounddaudio0 {
/* simple-audio-card,format = "i2s"; */
/* simple-audio-card,frame-master = <&daudio0_master>; */
/* simple-audio-card,bitclock-master = <&daudio0_master>; */
/* simple-audio-card,bitclock-inversion; */
/* simple-audio-card,frame-inversion; */
status = "disabled";
daudio0_master: simple-audio-card,codec {
/* sound-dai = <&ac108>; */
};
};
&daudio1 {
mclk_div = <0x01>;
frametype = <0x00>;
tdm_config = <0x01>;
sign_extend = <0x00>;
msb_lsb_first = <0x00>;
pcm_lrck_period = <0x80>;
slot_width_select = <0x20>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&daudio1_pins_a &daudio1_pins_b &daudio1_pins_c>;
pinctrl-1 = <&daudio1_pins_d>;
pinctrl_used = <0x0>;
status = "disabled";
};
&sounddaudio1 {
status = "disabled";
daudio1_master: simple-audio-card,codec {
/* sound-dai = <&ac108>; */
};
};
&daudio2 {
mclk_div = <0x00>;
frametype = <0x00>;
tdm_config = <0x01>;
sign_extend = <0x00>;
tx_data_mode = <0x00>;
rx_data_mode = <0x00>;
msb_lsb_first = <0x00>;
pcm_lrck_period = <0x20>;
slot_width_select = <0x20>;
asrc_function_en = <0x00>;
pinctrl-names = "default", "sleep";
/*pinctrl-0 = <&daudio2_pins_a &daudio2_pins_b &daudio2_pins_c>;*/
/*pinctrl-1 = <&daudio2_pins_d>;*/
/* HDMI audio, no need pin */
pinctrl-0;
pinctrl-1;
pinctrl_used = <0x0>;
daudio_type = <0x1>;
status = "okay";
};
/* if HDMI audio is used, daudio2 should be enable. */
&hdmiaudio {
status = "okay";
};
&sounddaudio2 {
status = "okay";
simple-audio-card,name = "sndhdmi";
daudio2_master: simple-audio-card,codec {
sound-dai = <&hdmiaudio>;
};
};
&spdif {
pinctrl-names = "default","sleep";
pinctrl-0 = <&spdif_pins_a>;
pinctrl-1 = <&spdif_pins_b>;
status = "disabled";
};
&soundspdif {
status = "disabled";
};
/*
*usb_port_type: usb mode. 0-device, 1-host, 2-otg.
*usb_detect_type: usb hotplug detect mode. 0-none, 1-vbus/id detect, 2-id/dpdm detect.
*usb_detect_mode: 0-thread scan, 1-id gpio interrupt.
*usb_id_gpio: gpio for id detect.
*usb_det_vbus_gpio: gpio for id detect. gpio or "axp_ctrl";
*usb_wakeup_suspend:0-SUPER_STANDBY, 1-USB_STANDBY.
*/
&usbc0 {
device_type = "usbc0";
usb_port_type = <0x2>;
usb_detect_type = <0x1>;
usb_detect_mode = <0>;
usb_id_gpio = <&pio PD 21 GPIO_ACTIVE_HIGH>;
enable-active-high;
usb_det_vbus_gpio = <&pio PD 20 GPIO_ACTIVE_HIGH>;
usb_wakeup_suspend = <0>;
usb_serial_unique = <0>;
usb_serial_number = "20080411";
rndis_wceis = <1>;
status = "okay";
};
&ehci0 {
drvvbus-supply = <®_usb1_vbus>;
};
&ohci0 {
drvvbus-supply = <®_usb1_vbus>;
};
&usbc1 {
device_type = "usbc1";
usb_regulator_io = "nocare";
usb_wakeup_suspend = <0>;
status = "okay";
};
&ehci1 {
status = "okay";
};
&ohci1 {
status = "okay";
};
&twi0 {
clock-frequency = <400000>;
pinctrl-0 = <&twi0_pins_a>;
pinctrl-1 = <&twi0_pins_b>;
pinctrl-names = "default", "sleep";
status = "disabled";
eeprom@50 {
compatible = "atmel,24c16";
reg = <0x50>;
status = "disabled";
};
};
&twi1 {
clock-frequency = <400000>;
pinctrl-0 = <&twi1_pins_a>;
pinctrl-1 = <&twi1_pins_b>;
pinctrl-names = "default", "sleep";
status = "disabled";
};
&twi2 {
clock-frequency = <400000>;
pinctrl-0 = <&twi2_pins_a>;
pinctrl-1 = <&twi2_pins_b>;
pinctrl-names = "default", "sleep";
dmas = <&dma 45>, <&dma 45>;
dma-names = "tx", "rx";
status = "okay";
/* pcf8574-usage:
* only use gpio0~7, 0 means PP0.
* pin set:
* gpios = <&pcf8574 0 GPIO_ACTIVE_LOW>;
* interrupt set:
* interrupt-parent = <&pcf8574>;
* interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
*/
pcf8574: gpio@38 {
compatible = "nxp,pcf8574";
reg = <0x38>;
gpio_base = <2020>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
interrupt-parent = <&pio>;
interrupts = <PB 2 IRQ_TYPE_EDGE_FALLING>;
status = "okay";
};
ctp@14 {
compatible = "allwinner,goodix";
device_type = "ctp";
reg = <0x14>;
status = "disabled";
ctp_name = "gt9xxnew_ts";
ctp_twi_id = <0x2>;
ctp_twi_addr = <0x14>;
ctp_screen_max_x = <0x320>;
ctp_screen_max_y = <0x500>;
ctp_revert_x_flag = <0x0>;
ctp_revert_y_flag = <0x1>;
ctp_exchange_x_y_flag = <0x0>;
ctp_int_port = <&pio PG 14 GPIO_ACTIVE_HIGH>;
ctp_wakeup = <&pio PG 15 GPIO_ACTIVE_HIGH>;
};
};
&twi3 {
clock-frequency = <400000>;
pinctrl-0 = <&twi3_pins_a>;
pinctrl-1 = <&twi3_pins_b>;
pinctrl-names = "default", "sleep";
status = "disabled";
};
&gmac0 {
phy-mode = "rgmii";
use_ephy25m = <1>;
pinctrl-0 = <&gmac_pins_a>;
pinctrl-1 = <&gmac_pins_b>;
pinctrl-names = "default", "sleep";
phy-rst = <&pio PE 16 GPIO_ACTIVE_HIGH>;
tx-delay = <3>; /*2~4*/
rx-delay = <0>;
status = "okay";
};
&spi0 {
clock-frequency = <100000000>;
pinctrl-0 = <&spi0_pins_a &spi0_pins_b>;
pinctrl-1 = <&spi0_pins_c>;
pinctrl-names = "default", "sleep";
/*spi-supply = <®_dcdc1>;*/
spi_slave_mode = <0>;
spi0_cs_number = <1>;
spi0_cs_bitmap = <1>;
status = "disabled";
spi-nand@0 {
compatible = "spi-nand";
spi-max-frequency=<0x5F5E100>;
reg = <0x0>;
spi-rx-bus-width=<0x04>;
spi-tx-bus-width=<0x04>;
status="disabled";
};
};
&spi1 {
clock-frequency = <100000000>;
pinctrl-0 = <&spi1_pins_a &spi1_pins_b>;
pinctrl-1 = <&spi1_pins_c>;
pinctrl-names = "default", "sleep";
spi_slave_mode = <0>;
spi1_cs_number = <1>;
spi1_cs_bitmap = <1>;
spi_dbi_enable = <1>;
status = "disabled";
spi_board1@0 {
device_type = "spi-dbi";
compatible = "sunxi,spidbi";
spi-max-frequency = <0x5f5e100>;
reg = <0x0>;
spi-rx-bus-width = <0x4>;
spi-tx-bus-width = <0x4>;
status = "okay";
};
/* spi_board1@0 {
device_type = "spi_board1";
compatible = "rohm,dh2228fv";
spi-max-frequency = <0x5f5e100>;
reg = <0x0>;
spi-rx-bus-width = <0x4>;
spi-tx-bus-width = <0x4>;
status = "disabled";
}; */
};
&ledc {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&ledc_pins_a>;
pinctrl-1 = <&ledc_pins_b>;
led_count = <12>;
output_mode = "GRB";
reset_ns = <84>;
t1h_ns = <800>;
t1l_ns = <320>;
t0h_ns = <300>;
t0l_ns = <800>;
wait_time0_ns = <84>;
wait_time1_ns = <84>;
wait_data_time_ns = <600000>;
status = "okay";
};
&keyboard0 {
key0 = <210 0x160>;
wakeup-source;
status = "okay";
};
/*----------------------------------------------------------------------------------
disp init configuration
disp_mode (0:screen0<screen0,fb0>)
screenx_output_type (0:none; 1:lcd; 2:tv; 3:hdmi;5:vdpo)
screenx_output_mode (used for hdmi output, 0:480i 1:576i 2:480p 3:576p 4:720p50)
(5:720p60 6:1080i50 7:1080i60 8:1080p24 9:1080p50 10:1080p60)
screenx_output_format (for hdmi, 0:RGB 1:yuv444 2:yuv422 3:yuv420)
screenx_output_bits (for hdmi, 0:8bit 1:10bit 2:12bit 2:16bit)
screenx_output_eotf (for hdmi, 0:reserve 4:SDR 16:HDR10 18:HLG)
screenx_output_cs (for hdmi, 0:undefined 257:BT709 260:BT601 263:BT2020)
screenx_output_dvi_hdmi (for hdmi, 0:undefined 1:dvi mode 2:hdmi mode)
screen0_output_range (for hdmi, 0:default 1:full 2:limited)
screen0_output_scan (for hdmi, 0:no data 1:overscan 2:underscan)
screen0_output_aspect_ratio (for hdmi, 8-same as original picture 9-4:3 10-16:9 11-14:9)
fbx format (4:RGB655 5:RGB565 6:RGB556 7:ARGB1555 8:RGBA5551 9:RGB888 10:ARGB8888 12:ARGB4444)
fbx pixel sequence (0:ARGB 1:BGRA 2:ABGR 3:RGBA)
fb0_scaler_mode_enable(scaler mode enable, used FE)
fbx_width,fbx_height (framebuffer horizontal/vertical pixels, fix to output resolution while equal 0)
lcdx_backlight (lcd init backlight,the range:[0,256],default:197
lcdx_yy (lcd init screen bright/contrast/saturation/hue, value:0~100, default:50/50/57/50)
lcd0_contrast (LCD contrast, 0~100)
lcd0_saturation (LCD saturation, 0~100)
lcd0_hue (LCD hue, 0~100)
framebuffer software rotation setting:
disp_rotation_used: (0:disable; 1:enable,you must set fbX_width to lcd_y,
set fbX_height to lcd_x)
degreeX: (X:screen index; 0:0 degree; 1:90 degree; 3:270 degree)
degreeX_Y: (X:screen index; Y:layer index 0~15; 0:0 degree; 1:90 degree; 3:270 degree)
devX_output_type : config output type in bootGUI framework in UBOOT-2018.
(0:none; 1:lcd; 2:tv; 4:hdmi;)
devX_output_mode : config output resolution(see include/video/sunxi_display2.h) of bootGUI framework in UBOOT-2018
devX_screen_id : config display index of bootGUI framework in UBOOT-2018
devX_do_hpd : whether do hpd detectation or not in UBOOT-2018
chn_cfg_mode : Hardware DE channel allocation config. 0:single display with 6
channel, 1:dual display with 4 channel in main display and 2 channel in second
display, 2:dual display with 3 channel in main display and 3 channel in second
in display.
----------------------------------------------------------------------------------*/
&disp {
disp_init_enable = <1>;
disp_mode = <0>;
screen0_output_type = <1>;
screen0_output_mode = <4>;
screen1_output_type = <3>;
screen1_output_mode = <10>;
screen1_output_format = <0>;
screen1_output_bits = <0>;
screen1_output_eotf = <4>;
screen1_output_cs = <257>;
screen1_output_dvi_hdmi = <2>;
screen1_output_range = <2>;
screen1_output_scan = <0>;
screen1_output_aspect_ratio = <8>;
dev0_output_type = <1>;
dev0_output_mode = <4>;
dev0_screen_id = <0>;
dev0_do_hpd = <0>;
dev1_output_type = <4>;
dev1_output_mode = <10>;
dev1_screen_id = <1>;
dev1_do_hpd = <1>;
def_output_dev = <0>;
hdmi_mode_check = <1>;
fb0_format = <0>;
fb0_width = <0>;
fb0_height = <0>;
fb1_format = <0>;
fb1_width = <0>;
fb1_height = <0>;
chn_cfg_mode = <1>;
disp_para_zone = <1>;
/*VCC-LCD*/
/* dc1sw-supply = <®_dc1sw>;*/
/*VCC-DSI*/
/* eldo3-supply = <®_eldo3>;*/
/*VCC-PD*/
/* dcdc1-supply = <®_dcdc1>;*/
};
/*----------------------------------------------------------------------------------
;lcd0 configuration
;lcd_if: 0:hv(sync+de); 1:8080; 2:ttl; 3:lvds; 4:dsi; 5:edp; 6:extend dsi
;lcd_hv_if 0:Parallel RGB; 8:Serial RGB; 10:Dummy RGB; 11: RGB Dummy;12:CCIR656
;lcd_hv_clk_phase 0:0 degree;1:90 degree;2:180 degree;3:270 degree
;lcd_hv_sync_polarity 0:vs low,hs low; 1:vs high,hslow; 2:vs low,hs high; 3:vs high,hs high
;lcd_hv_syuv_seq 0:YUYV; 1:YVYU; 2:UYVY; 3:VYUY
;lcd_cpu_if 0:18bit/1 cycle parallel(RGB666); 4:16bit/1cycle parallel (RGB565)
; 6:18bit/3 cycle parallel(RGB666); 7:16bit/2cycle parallel (RGB565)
;lcd_cpu_te 0:frame auto trigger; 1:frame triggered by te rising edge; 2:frame triggered by te falling edge;
;lcd_dsi_if 0:video mode; 1: Command mode; 2:video burst mode
;lcd_dsi_te 0:frame auto trigger; 1:frame triggered by te rising edge; 2:frame triggered by te falling edge;
;lcd_x: lcd horizontal resolution
;lcd_y: lcd vertical resolution
;lcd_width: width of lcd in mm
;lcd_height: height of lcd in mm
;lcd_dclk_freq: in MHZ unit
;lcd_pwm_freq: in HZ unit
;lcd_pwm_pol: lcd backlight PWM polarity
;lcd_pwm_max_limit lcd backlight PWM max limit(<=255)
;lcd_hbp: hsync back porch(pixel) + hsync plus width(pixel);
;lcd_ht: hsync total cycle(pixel)
;lcd_vbp: vsync back porch(line) + vysnc plus width(line)
;lcd_vt: vysnc total cycle(line)
;lcd_hspw: hsync plus width(pixel)
;lcd_vspw: vysnc plus width(pixel)
;lcd_lvds_if: 0:single link; 1:dual link
;lcd_lvds_colordepth: 0:8bit; 1:6bit
;lcd_lvds_mode: 0:NS mode; 1:JEIDA mode
;lcd_frm: 0:disable; 1:enable rgb666 dither; 2:enable rgb656 dither
;lcd_io_phase: 0:noraml; 1:intert phase(0~3bit: vsync phase; 4~7bit:hsync phase;
; 8~11bit:dclk phase; 12~15bit:de phase)
;lcd_gamma_en lcd gamma correction enable
;lcd_bright_curve_en lcd bright curve correction enable
;lcd_cmap_en lcd color map function enable
;deu_mode 0:smoll lcd screen; 1:large lcd screen(larger than 10inch)
;lcdgamma4iep: Smart Backlight parameter, lcd gamma vale * 10;
; decrease it while lcd is not bright enough; increase while lcd is too bright
;smart_color 90:normal lcd screen 65:retina lcd screen(9.7inch)
;Pin setting for special function ie.LVDS, RGB data or vsync
; name(donot care) = port:PD12<pin function><pull up or pull down><drive ability><output level>
;Pin setting for gpio:
; lcd_gpio_X = port:PD12<pin function><pull up or pull down><drive ability><output level>
;Pin setting for backlight enable pin
; lcd_bl_en = port:PD12<pin function><pull up or pull down><drive ability><output level>
;fsync setting, pulse to csi
;lcd_fsync_en (0:disable fsync,1:enable)
;lcd_fsync_act_time (active time of fsync, unit:pixel)
;lcd_fsync_dis_time (disactive time of fsync, unit:pixel)
;lcd_fsync_pol (0:positive;1:negative)
;gpio config: <&pio for cpu or &r_pio for cpus, port, port num, pio function,
pull up or pull down(default 0), driver level(default 1), data>
;For dual link lvds: use lvds2link_pins_a and lvds2link_pins_b instead
;For rgb24: use rgb24_pins_a and rgb24_pins_b instead
;For lvds1: use lvds1_pins_a and lvds1_pins_b instead
;For lvds0: use lvds0_pins_a and lvds0_pins_b instead
;----------------------------------------------------------------------------------*/
&lcd0 {
lcd_used = <1>;
lcd_driver_name = "tft08006";
lcd_backlight = <100>;
lcd_if = <4>;
lcd_x = <800>;
lcd_y = <1280>;
lcd_width = <52>;
lcd_height = <52>;
lcd_dclk_freq = <70>;
lcd_pwm_used = <1>;
lcd_pwm_ch = <2>;
lcd_pwm_freq = <1000>;
lcd_pwm_pol = <0>;
lcd_pwm_max_limit = <255>;
lcd_hbp = <32>;
lcd_ht = <868>;
lcd_hspw = <4>;
lcd_vbp = <12>;
lcd_vt = <1311>;
lcd_vspw = <4>;
lcd_dsi_if = <0>;
lcd_dsi_lane = <4>;
lcd_lvds_if = <0>;
lcd_lvds_colordepth = <0>;
lcd_lvds_mode = <0>;
lcd_frm = <0>;
lcd_hv_clk_phase = <0>;
lcd_hv_sync_polarity= <0>;
lcd_io_phase = <0x0000>;
lcd_gamma_en = <0>;
lcd_bright_curve_en = <0>;
lcd_cmap_en = <0>;
lcd_fsync_en = <0>;
lcd_fsync_act_time = <1000>;
lcd_fsync_dis_time = <1000>;
lcd_fsync_pol = <0>;
deu_mode = <0>;
lcdgamma4iep = <22>;
smart_color = <90>;
lcd_gpio_0 = <&pio PG 13 GPIO_ACTIVE_HIGH>;
pinctrl-0 = <&dsi4lane_pins_a>;
pinctrl-1 = <&dsi4lane_pins_b>;
};
&hdmi {
hdmi_used = <1>;
hdmi_power_cnt = <0>;
hdmi_cts_compatibility = <1>;
hdmi_hdcp_enable = <1>;
hdmi_hdcp22_enable = <0>;
hdmi_cec_support = <1>;
hdmi_cec_super_standby = <0>;
ddc_en_io_ctrl = <0>;
power_io_ctrl = <0>;
};
&pwm0 {
pinctrl-names = "active", "sleep";
pinctrl-0 = <&pwm0_pin_a>;
pinctrl-1 = <&pwm0_pin_b>;
status = "okay";
};
&pwm2 {
pinctrl-names = "active", "sleep";
pinctrl-0 = <&pwm2_pin_a>;
pinctrl-1 = <&pwm2_pin_b>;
status = "okay";
};
/*
&pwm7 {
pinctrl-names = "active", "sleep";
pinctrl-0 = <&pwm7_pin_a>;
pinctrl-1 = <&pwm7_pin_b>;
status = "okay";
};
*/
&rtp {
allwinner,tp-sensitive-adjust = <0xf>;
allwinner,filter-type = <0x1>;
allwinner,ts-attached;
status = "disabled";
};
&gpadc {
channel_num = <2>;
channel_select = <3>;
channel_data_select = <3>;
channel_compare_select = <3>;
channel_cld_select = <3>;
channel_chd_select = <3>;
channel0_compare_lowdata = <1700000>;
channel0_compare_higdata = <1200000>;
channel1_compare_lowdata = <460000>;
channel1_compare_higdata = <1200000>;
status = "disabled";
};
&s_cir0 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&s_cir0_pins_a>;
pinctrl-1 = <&s_cir0_pins_b>;
status = "disabled";
};
&ir1 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&ir1_pins_a>;
pinctrl-1 = <&ir1_pins_b>;
status = "disabled";
};
/* &lcd_fb0 {
lcd_used = <1>;
lcd_driver_name = "kld35512";
lcd_if = <1>;
lcd_dbi_if = <4>;
lcd_data_speed = <60>;
lcd_spi_bus_num = <1>;
lcd_x = <320>;
lcd_y = <480>;
lcd_pixel_fmt = <10>;
lcd_dbi_fmt = <2>;
lcd_rgb_order = <0>;
lcd_width = <60>;
lcd_height = <95>;
lcd_pwm_used = <1>;
lcd_pwm_ch = <7>;
lcd_pwm_freq = <5000>;
lcd_pwm_pol = <1>;
lcd_frm = <1>;
lcd_gamma_en = <1>;
fb_buffer_num = <2>;
lcd_backlight = <100>;
lcd_fps = <40>;
lcd_dbi_te = <1>;
lcd_dbi_clk_mode = <1>;
lcd_gpio_0 = <&pio PC 0 GPIO_ACTIVE_HIGH>;
status = "okay";
}; */
/* &lcd_fb0 {
lcd_used = <1>;
lcd_driver_name = "kld2844b";
lcd_if = <1>;
lcd_dbi_if = <4>;
lcd_data_speed = <60>;
lcd_spi_bus_num = <1>;
lcd_x = <240>;
lcd_y = <320>;
lcd_width = <60>;
lcd_height = <95>;
lcd_pwm_used = <1>;
lcd_pwm_ch = <7>;
lcd_pwm_freq = <5000>;
lcd_pwm_pol = <0>;
lcd_pixel_fmt = <0>;
lcd_dbi_fmt = <3>;
lcd_rgb_order = <0>;
lcd_frm = <1>;
lcd_gamma_en = <1>;
fb_buffer_num = <2>;
lcd_backlight = <100>;
lcd_dbi_te = <1>;
lcd_fps = <60>;
lcd_gpio_0 = <&pio PC 0 GPIO_ACTIVE_HIGH>;
status = "okay";
}; */
然后 env.cfg
#kernel command arguments
earlyprintk=sunxi-uart,0x02500000
initcall_debug=0
console=ttyS0,115200
nand_root=/dev/ubiblock0_5
mmc_root=/dev/mmcblk0p5
mtd_name=sys
rootfstype=squashfs
root_partition=rootfs
boot_partition=boot
init=/sbin/init
loglevel=8
cma=8M
mac=
wifi_mac=
bt_mac=
specialstr=
keybox_list=widevine,ec_key,ec_cert1,ec_cert2,ec_cert3,rsa_key,rsa_cert1,rsa_cert2,rsa_cert3
dsp0_partition=dsp0
#set kernel cmdline if boot.img or recovery.img has no cmdline we will use this
setargs_nand=setenv bootargs ubi.mtd=${mtd_name} ubi.block=0,${root_partition} earlyprintk=${earlyprintk} clk_ignore_unused initcall_debug=${initcall_debug} console=${console} loglevel=${loglevel} root=${nand_root} rootfstype=${rootfstype} init=${init} partitions=${partitions} cma=${cma} snum=${snum} mac_addr=${mac} wifi_mac=${wifi_mac} bt_mac=${bt_mac} specialstr=${specialstr} gpt=1
setargs_nand_ubi=setenv bootargs ubi.mtd=${mtd_name} ubi.block=0,${root_partition} earlyprintk=${earlyprintk} clk_ignore_unused initcall_debug=${initcall_debug} console=${console} loglevel=${loglevel} root=${nand_root} rootfstype=${rootfstype} init=${init} partitions=${partitions} cma=${cma} snum=${snum} mac_addr=${mac} wifi_mac=${wifi_mac} bt_mac=${bt_mac} specialstr=${specialstr} gpt=1
setargs_mmc=setenv bootargs earlyprintk=${earlyprintk} clk_ignore_unused initcall_debug=${initcall_debug} console=${console} loglevel=${loglevel} root=${mmc_root} init=${init} partitions=${partitions} cma=${cma} snum=${snum} mac_addr=${mac} wifi_mac=${wifi_mac} bt_mac=${bt_mac} specialstr=${specialstr} gpt=1
#nand command syntax: sunxi_flash read address partition_name read_bytes
#0x4007f800 = 0x40080000(kernel entry) - 0x800(boot.img header 2k)
boot_dsp0=sunxi_flash read 45000000 ${dsp0_partition};bootr 45000000 0 0
boot_normal=sunxi_flash read 45000000 ${boot_partition};bootm 45000000
boot_recovery=sunxi_flash read 45000000 recovery;bootm 45000000
boot_fastboot=fastboot
#uboot system env config
bootdelay=0
#default bootcmd, will change at runtime according to key press
#default nand boot
bootcmd=run setargs_nand boot_dsp0 boot_normal
默认是mtd设备也就是spi flash 启动
修改
device/config/chips/d1-h/configs/nezha/sys_config.fex
;----------------------------------------------------------------------------------
;storage_type = boot medium, 0-nand, 1-sd, 2-emmc, 3-nor, 4-emmc3, 5-spinand -1(defualt)auto scan
;----------------------------------------------------------------------------------
[target]
storage_type = 1
···
[304]HELLO! BOOT0 is starting!
[307]BOOT0 commit : 88480af
U-Boot 2018.05-g24521d6-dirty-config-dirty (Mar 28 2022 - 18:12:53 +0800) Allwinner Technology
[00.386]DRAM: 64 MiB
[00.389]Relocation Offset is: 01ee7000
[00.393]secure enable bit: 0
[00.396]CPU=1008 MHz,PLL6=600 Mhz,AHB=200 Mhz, APB1=100Mhz MBus=300Mhz
[00.402]flash init start
[00.404]workmode = 0,storage type = 1
[00.408][mmc]: mmc driver ver uboot2018:2021-11-19 15:38:00
[00.413][mmc]: get sdc_type fail and use default host:tm1.
[00.419][mmc]: can't find node "mmc0",will add new node
[00.424][mmc]: fdt err returned <no error>
[00.428][mmc]: Using default timing para
[00.432][mmc]: SUNXI SDMMC Controller Version:0x50310
[00.449][mmc]: card_caps:0x3000000a
[00.452][mmc]: host_caps:0x3000003f
[00.455]sunxi flash init ok
[00.458]line:703 init_clocks
[00.461]drv_disp_init
[00.473]drv_disp_init finish
[00.476]boot_gui_init:start
[00.479]set disp.dev2_output_type fail. using defval=0
[00.695]boot_gui_init:finish
[00.705]=====================LCD_INIT
partno erro : can't find partition bootloader
54 bytes read in 5 ms (9.8 KiB/s)
[01.001]bmp_name=bootlogo.bmp size 38454
38454 bytes read in[01.018]LCD open finish
8 ms (4.6 MiB/s)
[01.056]Loading Environment from SUNXI_FLASH... OK
[01.078]out of usb burn from boot: not need burn key
[01.105]Item0 (Map) magic is bad
[01.108]the secure storage item0 copy0 magic is bad
[01.134]Item0 (Map) magic is bad
[01.137]the secure storage item0 copy1 magic is bad
[01.141]Item0 (Map) magic is bad
partno erro : can't find partition private
root_partition is rootfs
set root to /dev/mmcblk0p5
[01.159]update part info
[01.165]update bootcmd
[01.171]change working_fdt 0x42aa6da0 to 0x42a86da0
disable nand error: FDT_ERR_BADPATH
No reserved memory region found in source FDT
[01.201]update dts
noncached_alloc(): addr = 0x42b91080
noncached_alloc(): addr = 0x42b910c0
noncached_alloc(): addr = 0x42b91100
noncached_alloc(): addr = 0x42b91940
geth_sys_init:634: get node 'gmac0' error
geth_sys_init fail!
[01.222]Board Net Initialization Failed
[01.225]No ethernet found.
Hit any key to stop autoboot: 2 ... 1 ... 0
[03.572]no vendor_boot partition is found
Android's image name: d1s-yuzuki_nezha
Detect comp none
[03.589]
Starting kernel ...
[03.592][mmc]: MMC Device 2 not found
[03.595][mmc]: mmc 2 not find, so not exit
[ 0.000000][ T0] Linux version 5.4.61 (yuzuki@YuzukiOMEN) (riscv64-unknown-linux-gnu-gcc (C-SKY RISCV Tools V1.8.4 B20200702) 8.1.0, GNU ld (GNU Binutils) 2.32) #146 PREEMPT Tue Mar 29 03:29:50 UTC 2022
[ 0.000000][ T0] Zone ranges:
[ 0.000000][ T0] DMA32 [mem 0x0000000040000000-0x0000000043ffffff]
[ 0.000000][ T0] Normal empty
[ 0.000000][ T0] Movable zone start for each node
[ 0.000000][ T0] Early memory node ranges
[ 0.000000][ T0] node 0: [mem 0x0000000040000000-0x0000000043ffffff]
[ 0.000000][ T0] Initmem setup node 0 [mem 0x0000000040000000-0x0000000043ffffff]
[ 0.000000][ T0] On node 0 totalpages: 16384
[ 0.000000][ T0] DMA32 zone: 224 pages used for memmap
[ 0.000000][ T0] DMA32 zone: 0 pages reserved
[ 0.000000][ T0] DMA32 zone: 16384 pages, LIFO batch:3
[ 0.000000][ T0] elf_hwcap is 0x20112d
[ 0.000000][ T0] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000][ T0] pcpu-alloc: [0] 0
[ 0.000000][ T0] Built 1 zonelists, mobility grouping on. Total pages: 16160
[ 0.000000][ T0] Kernel command line: earlyprintk=sunxi-uart,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyS0,115200 loglevel=8 root=/dev/mmcblk0p5 init=/pseudo_init partitions=boot-resource@mmcblk0p1:env@mmcblk0p2:env-redund@mmcblk0p3:boot@mmcblk0p4:rootfs@mmcblk0p5:recovery@mmcblk0p6:rootfs_data@mmcblk0p7:UDISK@mmcblk0p8 cma=0M snum= mac_addr= wifi_mac= bt_mac= specialstr= gpt=1 androidboot.mode=normal androidboot.hardware=sun20iw1p1 boot_type=1 androidboot.boot_type=1 gpt=1 uboot_message=2018.05-g24521d6-dirty-config-dirty(03/28/
[ 0.000000][ T0] Dentry cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[ 0.000000][ T0] Inode-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.000000][ T0] Sorting __ex_table...
[ 0.000000][ T0] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000][ T0] Memory: 56412K/65536K available (4557K kernel code, 408K rwdata, 1745K rodata, 144K init, 230K bss, 9124K reserved, 0K cma-reserved)
[ 0.000000][ T0] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000][ T0] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000][ T0] Tasks RCU enabled.
[ 0.000000][ T0] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000][ T0] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
[ 0.000000][ T0] plic: mapped 200 interrupts with 1 handlers for 2 contexts.
[ 0.000000][ T0] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[ 0.000000][ T0] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000005][ T0] sched_clock: 64 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000026][ T0] riscv_timer_clockevent depends on broadcast, but no broadcast function available
[ 0.000372][ T0] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000979][ T0] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.001001][ T0] pid_max: default: 32768 minimum: 301
[ 0.001180][ T0] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.001202][ T0] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.003237][ T1] ASID allocator initialised with 65536 entries
[ 0.003431][ T1] rcu: Hierarchical SRCU implementation.
[ 0.004161][ T1] devtmpfs: initialized
[ 0.022175][ T1] random: get_random_u32 called from bucket_table_alloc.isra.27+0x10a/0x12c with crng_init=0
[ 0.023107][ T1] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.023144][ T1] futex hash table entries: 256 (order: 0, 6144 bytes, linear)
[ 0.023302][ T1] pinctrl core: initialized pinctrl subsystem
[ 0.024500][ T1] NET: Registered protocol family 16
[ 0.025272][ T1] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.025948][ T1] cpuidle: using governor menu
[ 0.069336][ T1] rtc_ccu: sunxi ccu init OK
[ 0.077557][ T1] clock: sunxi ccu init OK
[ 0.078646][ T1] clock: sunxi ccu init OK
[ 0.115882][ T1] iommu: Default domain type: Translated
[ 0.116102][ T1] sunxi iommu: irq = 4
[ 0.117394][ T1] SCSI subsystem initialized
[ 0.117600][ T1] usbcore: registered new interface driver usbfs
[ 0.117711][ T1] usbcore: registered new interface driver hub
[ 0.117847][ T1] usbcore: registered new device driver usb
[ 0.118016][ T1] videodev: Linux video capture interface: v2.00
[ 0.118921][ T1] Advanced Linux Sound Architecture Driver Initialized.
[ 0.119658][ T1] pwm module init!
[ 0.121567][ T1] g2d 5410000.g2d: Adding to iommu group 0
[ 0.122140][ T1] G2D: rcq version initialized.major:252
[ 0.122996][ T1] clocksource: Switched to clocksource riscv_clocksource
[ 0.138313][ T1] sun8iw20-pinctrl 2000000.pinctrl: initialized sunXi PIO driver
[ 0.141953][ T1] NET: Registered protocol family 2
[ 0.142874][ T1] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[ 0.142930][ T1] TCP established hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.142949][ T1] TCP bind hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.142964][ T1] TCP: Hash tables configured (established 512 bind 512)
[ 0.143236][ T1] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.143286][ T1] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.143569][ T1] NET: Registered protocol family 1
[ 0.146562][ T1] workingset: timestamp_bits=62 max_order=14 bucket_order=0
[ 0.156058][ T1] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.156325][ T1] ntfs: driver 2.1.32 [Flags: R/W].
[ 0.177005][ T1] io scheduler mq-deadline registered
[ 0.177022][ T1] io scheduler kyber registered
[ 0.178287][ T1] [DISP]disp_module_init
[ 0.178928][ T1] disp 5000000.disp: Adding to iommu group 0
[ 0.179642][ T1] [DISP] disp_init,line:2386:
[ 0.179648][ T1] smooth display screen:0 type:1 mode:4
[ 0.219187][ T1] display_fb_request,fb_id:0
[ 0.224799][ T1] Freeing logo buffer memory: 504K
[ 0.225341][ T13] disp_al_manager_apply ouput_type:1
[ 0.225503][ T13] [DISP] lcd_clk_config,line:732:
[ 0.225516][ T13] disp 0, clk: pll(192000000),clk(192000000),dclk(8000000) dsi_rate(8000000)
[ 0.225516][ T13] clk real:pll(288000000),clk(288000000),dclk(72000000) dsi_rate(150000000)
[ 0.226073][ T1] [DISP]disp_module_init finish
[ 0.226992][ T1] sunxi_sid_init()551 - insmod ok
[ 0.228543][ T1] sun8iw20-pinctrl 2000000.pinctrl: 2000000.pinctrl supply vcc-pe not found, using dummy regulator
[ 0.229138][ T1] uart uart0: get regulator failed
[ 0.229170][ T1] uart uart0: uart0 supply uart not found, using dummy regulator
[ 0.229500][ T1] uart0: ttyS0 at MMIO 0x2500000 (irq = 18, base_baud = 1500000) is a SUNXI
[ 0.229533][ T1] sw_console_setup()1808 - console setup baud 115200 parity n bits 8, flow n
[ 0.956668][ T1] printk: console [ttyS0] enabled
[ 0.963072][ T1] sun8iw20-pinctrl 2000000.pinctrl: 2000000.pinctrl supply vcc-pg not found, using dummy regulator
[ 0.975292][ T1] uart uart1: get regulator failed
[ 0.980845][ T1] uart uart1: uart1 supply uart not found, using dummy regulator
[ 0.989715][ T1] uart1: ttyS1 at MMIO 0x2500400 (irq = 19, base_baud = 1500000) is a SUNXI
[ 0.999993][ T1] sun8iw20-pinctrl 2000000.pinctrl: 2000000.pinctrl supply vcc-pb not found, using dummy regulator
[ 1.012150][ T1] uart uart3: get regulator failed
[ 1.017808][ T1] uart uart3: uart3 supply uart not found, using dummy regulator
[ 1.026622][ T1] uart3: ttyS3 at MMIO 0x2500c00 (irq = 21, base_baud = 1500000) is a SUNXI
[ 1.037505][ T1] misc dump reg init
[ 1.042639][ T1] sunxi-rfkill soc@3000000:rfkill@0: module version: v1.0.9
[ 1.050667][ T1] sunxi-rfkill soc@3000000:rfkill@0: devm_pinctrl_get() failed!
[ 1.059051][ T1] sunxi-rfkill soc@3000000:rfkill@0: get gpio chip_en failed
[ 1.067202][ T1] sunxi-rfkill soc@3000000:rfkill@0: get gpio power_en failed
[ 1.075396][ T1] sunxi-rfkill soc@3000000:rfkill@0: wlan_busnum (1)
[ 1.082672][ T1] sunxi-rfkill soc@3000000:rfkill@0: Missing wlan_power.
[ 1.090446][ T1] sunxi-rfkill soc@3000000:rfkill@0: wlan_regon gpio=204 assert=1
[ 1.099101][ T1] sunxi-rfkill soc@3000000:rfkill@0: wlan_hostwake gpio=202 assert=1
[ 1.108107][ T1] sunxi-rfkill soc@3000000:rfkill@0: wakeup source is enabled
[ 1.116623][ T1] sunxi-rfkill soc@3000000:rfkill@0: Missing bt_power.
[ 1.124197][ T1] sunxi-rfkill soc@3000000:rfkill@0: bt_rst gpio=207 assert=0
[ 1.132939][ T1] [ADDR_MGT] addr_mgt_probe: module version: v1.0.10
[ 1.141408][ T1] [ADDR_MGT] addr_mgt_probe: success.
[ 1.148326][ T1] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.156489][ T1] sunxi-ehci: EHCI SUNXI driver
[ 1.162300][ T1] get ehci0-controller wakeup-source is fail.
[ 1.169063][ T1] sunxi ehci0-controller don't init wakeup source
[ 1.176095][ T1] [sunxi-ehci0]: probe, pdev->name: 4101000.ehci0-controller, sunxi_ehci: 0xffffffe0006db4a0, 0x:ffffffd004071000, irq_no:2e
[ 1.190420][ T1] [sunxi-ehci0]: Not init ehci0
[ 1.196129][ T1] get ehci1-controller wakeup-source is fail.
[ 1.202841][ T1] sunxi ehci1-controller don't init wakeup source
[ 1.209939][ T1] [sunxi-ehci1]: probe, pdev->name: 4200000.ehci1-controller, sunxi_ehci: 0xffffffe0006dbc30, 0x:ffffffd004075000, irq_no:31
[ 1.224247][ T1] sunxi-ehci 4200000.ehci1-controller: 4200000.ehci1-controller supply drvvbus not found, using dummy regulator
[ 1.237513][ T1] sunxi-ehci 4200000.ehci1-controller: 4200000.ehci1-controller supply hci not found, using dummy regulator
[ 1.250466][ T1] sunxi-ehci 4200000.ehci1-controller: EHCI Host Controller
[ 1.258578][ T1] sunxi-ehci 4200000.ehci1-controller: new USB bus registered, assigned bus number 1
[ 1.269213][ T1] sunxi-ehci 4200000.ehci1-controller: irq 49, io mem 0x04200000
[ 1.303052][ T1] sunxi-ehci 4200000.ehci1-controller: USB 2.0 started, EHCI 1.00
[ 1.312782][ T1] hub 1-0:1.0: USB hub found
[ 1.317885][ T1] hub 1-0:1.0: 1 port detected
[ 1.324173][ T1] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.331837][ T1] sunxi-ohci: OHCI SUNXI driver
[ 1.337734][ T1] get ohci0-controller wakeup-source is fail.
[ 1.344513][ T1] sunxi ohci0-controller don't init wakeup source
[ 1.351541][ T1] [sunxi-ohci0]: probe, pdev->name: 4101400.ohci0-controller, sunxi_ohci: 0xffffffe0006db868
[ 1.362725][ T1] [sunxi-ohci0]: Not init ohci0
[ 1.368400][ T1] get ohci1-controller wakeup-source is fail.
[ 1.375236][ T1] sunxi ohci1-controller don't init wakeup source
[ 1.382229][ T1] [sunxi-ohci1]: probe, pdev->name: 4200400.ohci1-controller, sunxi_ohci: 0xffffffe0006dbff8
[ 1.393465][ T1] sunxi-ohci 4200400.ohci1-controller: 4200400.ohci1-controller supply drvvbus not found, using dummy regulator
[ 1.406761][ T1] sunxi-ohci 4200400.ohci1-controller: 4200400.ohci1-controller supply hci not found, using dummy regulator
[ 1.419782][ T1] sunxi-ohci 4200400.ohci1-controller: OHCI Host Controller
[ 1.427839][ T1] sunxi-ohci 4200400.ohci1-controller: new USB bus registered, assigned bus number 2
[ 1.438913][ T1] sunxi-ohci 4200400.ohci1-controller: irq 50, io mem 0x04200400
[ 1.518148][ T1] hub 2-0:1.0: USB hub found
[ 1.523255][ T1] hub 2-0:1.0: 1 port detected
[ 1.530028][ T1] sunxi-rtc 7090000.rtc: errata__fix_alarm_day_reg_default_value(): ALARM0_DAY_REG=0, set it to 1
[ 1.543479][ T1] sunxi-rtc 7090000.rtc: registered as rtc0
[ 1.550010][ T1] sunxi-rtc 7090000.rtc: setting system clock to 1970-01-01T00:00:05 UTC (5)
[ 1.559684][ T1] sunxi-rtc 7090000.rtc: sunxi rtc probed
[ 1.566464][ T1] i2c /dev entries driver
[ 1.571202][ T1] IR NEC protocol handler initialized
[ 1.579926][ T1] uvcvideo: Unable to create debugfs directory
[ 1.586889][ T1] usbcore: registered new interface driver uvcvideo
[ 1.594112][ T1] USB Video Class driver (1.1.1)
[ 1.599450][ T1] sunxi cedar version 1.1
[ 1.604427][ T1] sunxi-cedar 1c0e000.ve: Adding to iommu group 0
[ 1.611489][ T1] VE: install start!!!
[ 1.611489][ T1]
[ 1.618656][ T1] VE: cedar-ve the get irq is 6
[ 1.618656][ T1]
[ 1.626540][ T1] VE: install end!!!
[ 1.626540][ T1]
[ 1.633358][ T1] VE: sunxi_cedar_probe
[ 1.640255][ T1] sunxi-mmc 4020000.sdmmc: SD/MMC/SDIO Host Controller Driver(v4.21 2021-11-18 10:02)
[ 1.651046][ T1] sunxi-mmc 4020000.sdmmc: ***ctl-spec-caps*** 8
[ 1.658025][ T1] sunxi-mmc 4020000.sdmmc: No vmmc regulator found
[ 1.665200][ T1] sunxi-mmc 4020000.sdmmc: No vqmmc regulator found
[ 1.672380][ T1] sunxi-mmc 4020000.sdmmc: No vdmmc regulator found
[ 1.679587][ T1] sunxi-mmc 4020000.sdmmc: No vd33sw regulator found
[ 1.686929][ T1] sunxi-mmc 4020000.sdmmc: No vd18sw regulator found
[ 1.694239][ T1] sunxi-mmc 4020000.sdmmc: No vq33sw regulator found
[ 1.701511][ T1] sunxi-mmc 4020000.sdmmc: No vq18sw regulator found
[ 1.709641][ T1] sunxi-mmc 4020000.sdmmc: sdc set ios:clk 0Hz bm PP pm UP vdd 21 width 1 timing LEGACY(SDR12) dt B
[ 1.721552][ T1] sunxi-mmc 4020000.sdmmc: no vqmmc,Check if there is regulator
[ 1.742484][ T1] sunxi-mmc 4020000.sdmmc: sdc set ios:clk 400000Hz bm PP pm ON vdd 21 width 1 timing LEGACY(SDR12) dt B
[ 1.767535][ T1] sunxi-mmc 4020000.sdmmc: detmode:gpio polling
[ 1.774403][ T13] sunxi-mmc 4020000.sdmmc: sdc set ios:clk 400000Hz bm PP pm ON vdd 21 width 1 timing LEGACY(SDR12) dt B
[ 1.787557][ T1] sunxi-mmc 4021000.sdmmc: SD/MMC/SDIO Host Controller Driver(v4.21 2021-11-18 10:02)
[ 1.798478][ T1] sunxi-mmc 4021000.sdmmc: ***ctl-spec-caps*** 8
[ 1.805554][ T1] sunxi-mmc 4021000.sdmmc: No vmmc regulator found
[ 1.812687][ T1] sunxi-mmc 4021000.sdmmc: No vqmmc regulator found
[ 1.819928][ T13] sunxi-mmc 4020000.sdmmc: sdc set ios:clk 400000Hz bm PP pm ON vdd 21 width 1 timing LEGACY(SDR12) dt B
[ 1.832318][ T1] sunxi-mmc 4021000.sdmmc: No vdmmc regulator found
[ 1.839532][ T1] sunxi-mmc 4021000.sdmmc: No vd33sw regulator found
[ 1.846958][ T1] sunxi-mmc 4021000.sdmmc: No vd18sw regulator found
[ 1.854342][ T1] sunxi-mmc 4021000.sdmmc: No vq33sw regulator found
[ 1.861667][ T1] sunxi-mmc 4021000.sdmmc: No vq18sw regulator found
[ 1.869052][ T1] sunxi-mmc 4021000.sdmmc: Cann't get pin bias hs pinstate,check if needed
[ 1.878572][ T13] sunxi-mmc 4020000.sdmmc: sdc set ios:clk 400000Hz bm PP pm ON vdd 21 width 1 timing LEGACY(SDR12) dt B
[ 1.891692][ T1] sunxi-mmc 4021000.sdmmc: sdc set ios:clk 0Hz bm PP pm UP vdd 21 width 1 timing LEGACY(SDR12) dt B
[ 1.903785][ T1] sunxi-mmc 4021000.sdmmc: no vqmmc,Check if there is regulator
[ 1.913869][ T13] sunxi-mmc 4020000.sdmmc: sdc set ios:clk 400000Hz bm PP pm ON vdd 21 width 1 timing LEGACY(SDR12) dt B
[ 1.926264][ T1] sunxi-mmc 4021000.sdmmc: sdc set ios:clk 400000Hz bm PP pm ON vdd 21 width 1 timing LEGACY(SDR12) dt B
[ 1.951375][ T1] sunxi-mmc 4021000.sdmmc: detmode:manually by software
[ 1.960035][ C0] sunxi-mmc 4021000.sdmmc: smc 1 p1 err, cmd 52, RTO !!
[ 1.968134][ T1] ashmem: initialized
[ 1.972452][ C0] sunxi-mmc 4021000.sdmmc: smc 1 p1 err, cmd 52, RTO !!
[ 1.980144][ T5] sunxi-mmc 4021000.sdmmc: sdc set ios:clk 400000Hz bm PP pm ON vdd 21 width 1 timing LEGACY(SDR12) dt B
[ 1.992533][ T1] exFAT: Version 1.3.0
[ 2.000133][ T5] sunxi-mmc 4021000.sdmmc: sdc set ios:clk 400000Hz bm PP pm ON vdd 21 width 1 timing LEGACY(SDR12) dt B
[ 2.012538][ T13] mmc0: host does not support reading read-only switch, assuming write-enable
[ 2.024648][ T1] [AUDIOCODEC][sunxi_codec_parse_params][2412]:digital_vol:0, lineout_vol:26, mic1gain:19, mic2gain:19 pa_msleep:120, pa_level:1, pa_pwr_level:1
[ 2.024648][ T1]
[ 2.043560][ T1] [AUDIOCODEC][sunxi_codec_parse_params][2448]:adcdrc_cfg:0, adchpf_cfg:1, dacdrc_cfg:0, dachpf:0
[ 2.055301][ T13] sunxi-mmc 4020000.sdmmc: sdc set ios:clk 400000Hz bm PP pm ON vdd 21 width 1 timing SD-HS(SDR25) dt B
[ 2.068096][ T1] [AUDIOCODEC][sunxi_internal_codec_probe][2609]:codec probe finished
[ 2.077043][ C0] sunxi-mmc 4021000.sdmmc: smc 1 p1 err, cmd 5, RTO !!
[ 2.084740][ T13] sunxi-mmc 4020000.sdmmc: sdc set ios:clk 50000000Hz bm PP pm ON vdd 21 width 1 timing SD-HS(SDR25) dt B
[ 2.097162][ C0] sunxi-mmc 4021000.sdmmc: smc 1 p1 err, cmd 5, RTO !!
[ 2.105571][ C0] sunxi-mmc 4021000.sdmmc: smc 1 p1 err, cmd 5, RTO !!
[ 2.113401][ T13] sunxi-mmc 4020000.sdmmc: sdc set ios:clk 50000000Hz bm PP pm ON vdd 21 width 4 timing SD-HS(SDR25) dt B
[ 2.125822][ C0] sunxi-mmc 4021000.sdmmc: smc 1 p1 err, cmd 5, RTO !!
[ 2.133390][ T5] sunxi-mmc 4021000.sdmmc: sdc set ios:clk 0Hz bm PP pm OFF vdd 0 width 1 timing LEGACY(SDR12) dt B
[ 2.145792][ T1] sid_rd_ver_reg()254 - ver >= 4, soc ver:5
[ 2.152307][ T1] [SNDCODEC][sunxi_card_init][583]:card init finished
[ 2.162483][ T1] sunxi-codec-machine 2030340.sound: 2030000.codec <-> 203034c.dummy_cpudai mapping ok
[ 2.173211][ T13] mmc0: new high speed SDHC card at address b368
[ 2.181531][ T13] mmcblk0: mmc0:b368 NCard 14.6 GiB
[ 2.188544][ T1] input: audiocodec sunxi Audio Jack as /devices/platform/soc@3000000/2030340.sound/sound/card0/input0
[ 2.204504][ T1] [SNDCODEC][sunxi_card_dev_probe][836]:register card finished
[ 2.214262][ T13] mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8
[ 2.221595][ T1] NET: Registered protocol family 10
[ 2.231653][ T1] Segment Routing with IPv6
[ 2.236917][ T1] NET: Registered protocol family 17
[ 2.244942][ T13] sunxi-i2c sunxi-i2c2: sunxi-i2c2 supply twi not found, using dummy regulator
[ 2.261028][ T13] sunxi-i2c sunxi-i2c2: probe success
[ 2.272285][ T1] clk: Not disabling unused clocks
[ 2.278409][ T13] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 2.288941][ T1] ALSA device list:
[ 2.293103][ T1] #0: audiocodec
[ 2.297104][ T1] alloc_fd: slot 0 not NULL!
[ 2.302698][ T13] cfg80211: failed to load regulatory.db
[ 2.323152][ T1] EXT4-fs (mmcblk0p5): mounted filesystem without journal. Opts: (null)
[ 2.332399][ T1] VFS: Mounted root (ext4 filesystem) readonly on device 179:5.
[ 2.342216][ T1] devtmpfs: mounted
[ 2.346554][ T1] Freeing unused kernel memory: 144K
[ 2.352278][ T1] This architecture does not have kernel memory protection.
[ 2.360319][ T1] Run /pseudo_init as init process
mount: mounting none on /dev failed: Device or resource busy
mount: mounting /dev/by-name/rootfs_data on /overlay failed: Invalid argument
Mount Failed: formating /dev/by-name/rootfs_data to ext4 ...
/pseudo_init: line 395: mkfs.ext4: not found
can't run '/etc/preinit': No such file or directory
mount: mounting proc on /proc failed: Device or resource busy
mount: mounting tmpfs on /run failed: No such file or directory
[ 2.742162][ T91] EXT4-fs (mmcblk0p5): re-mounted. Opts: (null)
hostname: can't open '/etc/hostname': No such file or directory
------run rc.preboot file-----
/etc/init.d/rcS: line 136: mkfs.ext4: not found
[ 2.863138][ T13] [SNDCODEC][sunxi_check_hs_detect_status][191]:plugin --> switch:1
------run rc.modules file-----
------run rc.final file-----
[ 2.930690][ T111]
[ 2.930690][ T111] insmod_host_driver
[ 2.930690][ T111]
[ 2.943946][ T111] [ehci0-controller]: sunxi_usb_enable_ehci
[ 2.951019][ T111] [sunxi-ehci0]: probe, pdev->name: 4101000.ehci0-controller, sunxi_ehci: 0xffffffe0006db4a0, 0x:ffffffd004071000, irq_no:2e
[ 2.969093][ T111] hci: sunxi_insmod_ehci()601 WARN: get supply failed
[ 2.977013][ T111] sunxi-ehci 4101000.ehci0-controller: 4101000.ehci0-controller supply hci not found, using dummy regulator
[ 2.993559][ T111] sunxi-ehci 4101000.ehci0-controller: EHCI Host Controller
[ 3.001596][ T111] sunxi-ehci 4101000.ehci0-controller: new USB bus registered, assigned bus number 3
[ 3.017937][ T111] sunxi-ehci 4101000.ehci0-controller: irq 46, io mem 0x04101000
[ 3.063121][ T111] sunxi-ehci 4101000.ehci0-controller: USB 2.0 started, EHCI 1.00
[ 3.084293][ T111] hub 3-0:1.0: USB hub found
[ 3.089334][ T111] hub 3-0:1.0: 1 port detected
[ 3.104790][ T111] [ohci0-controller]: sunxi_usb_enable_ohci
[ 3.111203][ T111] [sunxi-ohci0]: probe, pdev->name: 4101400.ohci0-controller, sunxi_ohci: 0xffffffe0006db868
[ 3.143768][ T111] hci: sunxi_insmod_ohci()265 WARN: get supply failed
[ 3.151165][ T111] sunxi-ohci 4101400.ohci0-controller: 4101400.ohci0-controller supply hci not found, using dummy regulator
[ 3.199530][ T111] sunxi-ohci 4101400.ohci0-controller: OHCI Host Controller
[ 3.217544][ T111] sunxi-ohci 4101400.ohci0-controller: new USB bus registered, assigned bus number 4
[ 3.237039][ T111] sunxi-ohci 4101400.ohci0-controller: irq 47, io mem 0x04101400
[ 3.245503][ C0] random: fast init done
[ 3.311816][ T133] file system registered
[ 3.332762][ T111] hub 4-0:1.0: USB hub found
[ 3.343198][ T111] hub 4-0:1.0: 1 port detected
host_chose finished!
[ 3.363111][ T59]
[ 3.363111][ T59] rmmod_host_driver
[ 3.363111][ T59]
[ 3.372039][ T59] [ehci0-controller]: sunxi_usb_disable_ehci
[ 3.401325][ T59] [sunxi-ehci0]: remove, pdev->name: 4101000.ehci0-controller, sunxi_ehci: 0xffffffe0006db4a0
[ 3.415632][ T113] configfs-gadget 4100000.udc-controller: failed to start g1: -19
BusyBox v1.27.2 () built-in shell (ash)
sh: write error: No such device[ 3.445531][ T59] sunxi-ehci 4101000.ehci0-controller: remove, state 4
------run profile file-----
nice: can't execute '/usr/bin/story_ota_bin': No such file or directory
[ 3.503131][ T59] usb usb3: USB disconnect, device number 1
_ _ _ ____ _____
| | | | Powered by OpenWRT | | / __ \ / ____|
| | | |_ __ _ _ ___ ___ | | __ _| | | | (___
| | | | '_ \| | | / __|/ _ \| |/ _` | | | |\___ \
| |__| | | | | |_| \__ \ (_) | | (_| | |__| |____) |
\____/|_| |_|\__,_|___/\___/|_|\__,_|\____/|_____/
----------------------[ 3.539688][ T59] sunxi-ehci 4101000.ehci0-controller: USB bus 3 deregistered
------------------------------
Yuzuki UnusolaOS (v1.0, Tina: 61CC0487)
----------------------------------------------------
[ 3.563240][ T153] read descriptors
[ 3.567245][ T153] read strings
[ 3.582720][ T59] [ohci0-controller]: sunxi_usb_disable_ohci
[ 3.589634][ T59] [sunxi-ohci0]: remove, pdev->name: 4101400.ohci0-controller, sunxi_ohci: 0xffffffe0006db868
[ 3.609221][ T59] sunxi-ohci 4101400.ohci0-controller: remove, state 4
[ 3.618260][ T59] usb usb4: USB disconnect, device number 1
[ 3.626411][ T59] sunxi-ohci 4101400.ohci0-controller: USB bus 4 deregistered
root@TinaLinux:/# [ 3.635799][ T59]
[ 3.635799][ T59] insmod_device_driver
[ 3.635799][ T59]
[ 3.646861][ T59] sunxi_usb_udc 4100000.udc-controller: 4100000.udc-controller supply udc not found, using dummy regulator
[ 3.659712][ T59] device_chose finished 139!
[ 3.813980][ T13] sunxi_set_cur_vol_work()397 WARN: get power supply failed
[ 3.895639][ T13] android_work: sent uevent USB_STATE=CONNECTED
[ 3.930050][ C0] configfs-gadget gadget: high-speed config #1: c
[ 3.937220][ T13] android_work: sent uevent USB_STATE=CONFIGURED
root@TinaLinux:/#
首先,SDK抄一下EVB的相关文件
然后把 __PRJ_CONFIG_BOARD
修改到 __PRJ_CONFIG_BOARD := YuzukiXR32
试试能不能编译编译
cd XR32SDK/project/example/sd/gcc
make build
编译通过~
"section" :[
{"id": "0xa5ff5a00", "bin": "boot.bin", "cert": "null", "flash_offs": "0K", "sram_offs": "0x00067000", "ep": "0x00067101", "attr": "0x1"},
{"id": "0xa5fe5a01", "bin": "app.bin", "cert": "null", "flash_offs": "32K", "sram_offs": "0x00010000", "ep": "0x00010101", "attr": "0x1"},
{"id": "0xa5f75a08", "bin": "app_ext.bin", "cert": "null", "flash_offs": "332K", "sram_offs": "0x60000000", "ep": "0xffffffff", "attr": "0x1"}
]
}
generate image: xr_system.img
刷写程序
运行一下试试看
sd demo started
SDC source:24 MHz clock=400 kHz,src:0, n:1, m:14
SDC source:24 MHz clock=400 kHz,src:0, n:1, m:14
__mci_irq_handler,535 raw_int:100 err!
SDC err, cmd 8, RTO
sdc 387 abnormal status: RespErr
int err 100
__mci_irq_handler,535 raw_int:100 err!
SDC err, cmd 55, RTO
sdc 387 abnormal status: RespErr
int err 100
__mci_irq_handler,535 raw_int:100 err!
SDC err, cmd 55, RTO
sdc 387 abnormal status: RespErr
int err 100
__mci_irq_handler,535 raw_int:100 err!
SDC err, cmd 55, RTO
sdc 387 abnormal status: RespErr
int err 100
__mci_irq_handler,535 raw_int:100 err!
SDC err, cmd 55, RTO
sdc 387 abnormal status: RespErr
int err 100
sd scan error
不出所料,用不了,应该是引脚绑定不同,打开板级文件看看
__xip_rodata
static const GPIO_PinMuxParam g_pinmux_sd0[BOARD_SD0_DATA_BITS + 2] = {
{ GPIO_PORT_A, GPIO_PIN_0, { GPIOA_P0_F3_SD_CMD, GPIO_DRIVING_LEVEL_2, GPIO_PULL_UP } }, /* CMD */
{ GPIO_PORT_A, GPIO_PIN_2, { GPIOA_P2_F3_SD_CLK, GPIO_DRIVING_LEVEL_2, GPIO_PULL_UP } }, /* CLK */
{ GPIO_PORT_A, GPIO_PIN_1, { GPIOA_P1_F3_SD_DATA0, GPIO_DRIVING_LEVEL_2, GPIO_PULL_UP } }, /* D0 */
// { GPIO_PORT_A, GPIO_PIN_3, { GPIOA_P3_F3_SD_DATA1, GPIO_DRIVING_LEVEL_2, GPIO_PULL_UP } }, /* D1 */
// { GPIO_PORT_A, GPIO_PIN_4, { GPIOA_P4_F3_SD_DATA2, GPIO_DRIVING_LEVEL_2, GPIO_PULL_UP } }, /* D2 */
// { GPIO_PORT_A, GPIO_PIN_5, { GPIOA_P5_F3_SD_DATA3, GPIO_DRIVING_LEVEL_2, GPIO_PULL_UP } }, /* D3 */
};
果然,绑定的脚是PA的SD脚位,参照YuzukiXR32的电路图,应该是使用PB驱动SDIO才对。
那就修改一下
__xip_rodata
static const GPIO_PinMuxParam g_pinmux_sd0[BOARD_SD0_DATA_BITS + 2] = {
{ GPIO_PORT_B, GPIO_PIN_4, { GPIOB_P4_F3_SD_CMD, GPIO_DRIVING_LEVEL_2, GPIO_PULL_UP } }, /* CMD */
{ GPIO_PORT_B, GPIO_PIN_7, { GPIOB_P7_F3_SD_CLK, GPIO_DRIVING_LEVEL_2, GPIO_PULL_UP } }, /* CLK */
{ GPIO_PORT_B, GPIO_PIN_5, { GPIOB_P5_F3_SD_DATA0, GPIO_DRIVING_LEVEL_2, GPIO_PULL_UP } }, /* D0 */
};
成功运行
sd demo started
SDC source:24 MHz clock=400 kHz,src:0, n:1, m:14
SDC source:24 MHz clock=400 kHz,src:0, n:1, m:14
SDC source:192 MHz clock=48000 kHz,src:1000000, n:0, m:1
write "hello word!" to sd card
read data: hello word!
sd demo over
[40]BOOT0 commit : 889f614
[42]set pll start
[44]periph0 has been enabled
[47]set pll end
[48][pmu]: bus read error
[51]board init ok
[53]enable_jtag
[54]ZQ value = 0x2d
[56]get_pmu_exist() = -1
[58]DRAM BOOT DRIVE INFO: V0.32
[61]DRAM CLK = 528 MHz
[63]DRAM Type = 2 (2:DDR2,3:DDR3)
[66]DRAMC read ODT off.
[69]DRAM ODT off.
[71]ddr_efuse_type: 0xa
[73]mark_id: 0x5c
[75]DRAM SIZE =64 M
[77]PLL_DDR_CTRL_REG:0xf9002b00
[80]DRAM_CLK_REG:0xc0000000
[82][TIMING DEBUG] MR2= 0x0
[87]DRAM simple test OK.
[89]dram size =64
[91]spinor id is: ef 70 18, read cmd: 6b
[94]Succeed in reading toc file head.
[98]The size of toc is 98000.
[126]Entry_name = melis-lzma
[129]LZMA: Image address............... 0x41000400
[134]LZMA: Properties address.......... 0x41000400
[138]LZMA: Uncompressed size address... 0x41000405
[143]LZMA: Compressed data address..... 0x4100040d
[147]LZMA: Destination address......... 0x40000000
[152]LZMA: Uncompresed size............ 0xffffffffffffffff
[157]LZMA: Compresed size.............. 0xfffffffa
[337]LZMA: Uncompressed ............... 0x00123410
[342]Entry_name = melis-config
[345]image_base:43000000
[348]Jump to second Boot.
[350]jump to rtos
sbi2ekernel
===============================================================================================================
| /'\_/`\ (_ ) _ /'_ ) /'_ `\ /' _`\ |
| | | __ | | (_) ___ ______ _ _ (_)_) | ( (_) | | ( ) | |
| | (_) | /'__`\ | | | |/',__)(______)( ) ( ) _(_ < \__, | | | | | |
| | | | |( ___/ | | | |\__, \ | \_/ |( )_) | _ | | _ | (_) | |
| (_) (_)`\____)(___)(_)(____/ `\___/'`\____)(_) (_)(_)`\___/' |
|version : V3.9.0 |
|commitid: c6bf140930185e29f6e12888005ea61634ae7e5a |
|sunxiver: 30800 |
|timever : Tue, 29 Mar 2022 20:33:56 +0800 |
|compiler: gcc version 8.4.0 (T-HEAD RISCV Tools V1.10.2 B20201104) |
|optimal : -Os -g -gdwarf-2 -gstrict-dwarf |
|linker : GNU ld (GNU Binutils) 2.32 |
|newlibc : 3.0.0 |
|author : yuzuki |
===============================================================================================================
[DBG]: [__mount_parts:0273]: classname=DMS
[DBG]: [__mount_parts:0274]: devname=dms01
[DBG]: [__mount_parts:0301]: find last lun.
[DBG]: [__mount_parts:0331]: nPart = 1.
[DBG]: [__mount_parts:0460]: dmsPart: "DMS\dms010" is linked to symbel "B".
[ERR]: [esFSYS_pread:0318]: fs fatal err
[ERR]: [esFSYS_pread:0318]: fs fatal err
[ERR]: [esFSYS_pread:0318]: fs fatal err
[ERR]: [esFSYS_pread:0318]: fs fatal err
[DBG]: [esFSYS_mntfs:0317]: devfs,mount on B.
[DBG]: [kservice_maintask:0834]: partition [B] plug in..
[DBG]: [__mount_parts:0273]: classname=DISK
[DBG]: [__mount_parts:0274]: devname=RAMDISK
[DBG]: [__mount_parts:0301]: find last lun.
[DBG]: [__mount_parts:0331]: nPart = 1.
[DBG]: [__mount_parts:0460]: rawpart: "DISK\▒[ERR]: [match_nor:0376]: spinor: not match any id on factory 0xef ids table
[ERR]: [nor_scan:0495]: spinor: scan nor flash failed
[ERR]: [nor_init:0571]: spinor: init nor flash failed
[ERR]: [nor_read:0880]: spinor: read address 0xc000 with len 16384 failed
[ERR]: [register_blk_device:0862]: get gpt from nor flash failed - 4294967291
SDC:hal_sdc_create host:0x401b65d8 id:0
[ERR] SDC:name sdc0_d1,port 6,port_num 0,mul_sel 2, pull 1, drv_level 1
[ERR] SDC:name sdc0_d0,port 6,port_num 1,mul_sel 2, pull 1, drv_level 1
[ERR] SDC:name sdc0_clk,port 6,port_num 2,mul_sel 2, pull 1, drv_level 1
[ERR] SDC:name sdc0_cmd,port 6,port_num 3,mul_sel 2, pull 1, drv_level 1
[ERR] SDC:name sdc0_d3,port 6,port_num 4,mul_sel 2, pull 1, drv_level 1
[ERR] SDC:name sdc0_d2,port 6,port_num 5,mul_sel 2, pull 1, drv_level 1
SDC:Not implement __mci_restore_io,793
SDC:Not imp hal_sdc_init,2206
SDC:hal_sdc_init,2239 no imp
SDC:hal_sdc_init,2248 no imp
SDC:SDC Host Capability:0x3820f Ocr avail:0x3f0000
SDC:SDC cd_mode:2 present_val:0
SDC:SDC id:0 dma_use:1 present:1
driver version SD/MMC/SDIO Host Controller Driver(v0.28 2021-08-24 16:50) init ok.
host_id =0!
[ERR]: [hal_ths_init:0094]: 0x2009404, 0x2009400, 0
我这更惨
&usbc0 {
device_type = "usbc0";
usb_port_type = <0x0>;
usb_detect_type = <0x1>;
usb_detect_mode = <0>;
usb_id_gpio = <&pio PB 6 GPIO_ACTIVE_HIGH>; /*unused */
enable-active-high;
usb_det_vbus_gpio = <&pio PB 2 GPIO_ACTIVE_HIGH>;/*unused */
usb_wakeup_suspend = <0>;
usb_serial_unique = <0>;
usb_serial_number = "20080411";
rndis_wceis = <1>;
status = "okay";
};
&ehci0 {
drvvbus-supply = <®_usb1_vbus>;
};
&ohci0 {
drvvbus-supply = <®_usb1_vbus>;
};
&usbc1 {
device_type = "usbc1";
usb_port_type = <1>;
sb_detect_type = <1>;
usb_regulator_io = "nocare";
usb_wakeup_suspend = <0>;
status = "okay";
};
&ehci1 {
status = "okay";
};
&ohci1 {
status = "okay";
};
问题一:
tina 2.0 d1s 编译后 adb 无法使用,根本找不到这个设备
板子输入adbd之后报错
问题二:
修改sys_partition.fex
的rootfs
大小后发现无法启动
[ 2.256587][ T13] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 2.267116][ T1] ALSA device list:
[ 2.271203][ T1] #0: audiocodec
[ 2.275266][ T13] cfg80211: failed to load regulatory.db
[ 2.281453][ T1] alloc_fd: slot 0 not NULL!
[ 2.291093][ T1] [EXFAT] trying to mount...
[ 2.297370][ T1] VFS: Cannot open root device "mmcblk0p5" or unknown-block (179,5): error -5
[ 2.307115][ T1] Please append a correct "root=" boot option; here are the available partitions:
[ 2.317332][ T1] b300 15267840 mmcblk0
[ 2.317337][ T1] driver: mmcblk
[ 2.326562][ T1] b301 252 mmcblk0p1 a0085546-4166-744a-a353-fca9272b8e45
[ 2.326568][ T1]
[ 2.338198][ T1] b302 252 mmcblk0p2 a0085546-4166-744a-a353-fca9272b8e46
[ 2.338203][ T1]
[ 2.349780][ T1] b303 252 mmcblk0p3 a0085546-4166-744a-a353-fca9272b8e47
[ 2.349784][ T1]
[ 2.361391][ T1] b304 10240 mmcblk0p4 a0085546-4166-744a-a353-fca9272b8e48
[ 2.361396][ T1]
[ 2.372992][ T1] b305 600000 mmcblk0p5 a0085546-4166-744a-a353-fca9272b8e49
[ 2.372996][ T1]
[ 2.384603][ T1] b306 11200 mmcblk0p6 a0085546-4166-744a-a353-fca9272b8e4a
[ 2.384608][ T1]
[ 2.396185][ T1] b307 5120 mmcblk0p7 a0085546-4166-744a-a353-fca9272b8e4b
[ 2.396188][ T1]
[ 2.407788][ T1] 103:00000 14602636 mmcblk0p8 a0085546-4166-744a-a353-fca9272b8e4c
[ 2.407793][ T1]
[ 2.419373][ T1] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,5)
[ 2.429553][ T1] CPU: 0 PID: 1 Comm: swapper Not tainted 5.4.61 #139
[ 2.436915][ T1] Call Trace:
[ 2.440427][ T1] [<ffffffe00002512c>] walk_stackframe+0x0/0x98
[ 2.447214][ T1] [<ffffffe0000252e4>] show_stack+0x2a/0x34
[ 2.453616][ T1] [<ffffffe000443b52>] dump_stack+0x20/0x28
[ 2.460016][ T1] [<ffffffe0000296ee>] panic+0xee/0x274
[ 2.466029][ T1] [<ffffffe000000ef6>] mount_block_root+0x214/0x27a
[ 2.473202][ T1] [<ffffffe000000fe2>] mount_root+0x86/0x90
[ 2.479599][ T1] [<ffffffe000001134>] prepare_namespace+0x148/0x152
[ 2.486868][ T1] [<ffffffe000000b58>] kernel_init_freeable+0x166/0x198
[ 2.494434][ T1] [<ffffffe000454704>] kernel_init+0x12/0xee
[ 2.500929][ T1] [<ffffffe000023e98>] ret_from_exception+0x0/0xc
[ 2.507911][ T1] Rebooting in 5 seconds..
正常下载,可以看看这个视频里生成ssh钥匙串的那部分
【视频】八分钟,教你下载 D1-H Tina SDK
https://bbs.aw-ol.com/topic/1177/share/1
@yelong98 目前不支持麻雀,我本来想提交但是他把文件拆到自己的fork里了难搞
@juggernaut 还不支持,不过只是修改几个文件就可以了
@tigger 基本上连ccu都要自己加((
还好全志的ip一代接一代改动不大应该问题不大
不过Linux和Uboot都是smaeul 的 fork,更倾向于主线kernel+patch这样的。
@zt13947787451 直接烧录编译出来的fw_jump.bin呢?我这边对模式切换也不熟,也只是停留在能用OpenSBI的阶段
{0xB0, 1, {0x5A}},
{0xB1, 1, {0x00}},
{0x89, 1, {0x01}},
{0x91, 1, {0x17}},
{0xB1, 1, {0x03}},
{0x2C, 1, {0x28}},
{0x00, 1, {0xB7}},
{0x01, 1, {0x1B}},
{0x02, 1, {0x00}},
{0x03, 1, {0x00}},
{0x04, 1, {0x00}},
{0x05, 1, {0x00}},
{0x06, 1, {0x00}},
{0x07, 1, {0x00}},
{0x08, 1, {0x00}},
{0x09, 1, {0x00}},
{0x0A, 1, {0x01}},
{0x0B, 1, {0x01}},
{0x0C, 1, {0x00}},
{0x0D, 1, {0x00}},
{0x0E, 1, {0x24}},
{0x0F, 1, {0x1C}},
{0x10, 1, {0xC9}},
{0x11, 1, {0x60}},
{0x12, 1, {0x70}},
{0x13, 1, {0x01}},
{0x14, 1, {0xE7}},
{0x15, 1, {0xFF}},
{0x16, 1, {0x3D}},
{0x17, 1, {0x0E}},
{0x18, 1, {0x01}},
{0x19, 1, {0x00}},
{0x1A, 1, {0x00}},
{0x1B, 1, {0xFC}},
{0x1C, 1, {0x0B}},
{0x1D, 1, {0xA0}},
{0x1E, 1, {0x03}},
{0x1F, 1, {0x04}},
{0x20, 1, {0x0C}},
{0x21, 1, {0x00}},
{0x22, 1, {0x04}},
{0x23, 1, {0x81}},
{0x24, 1, {0x1F}},
{0x25, 1, {0x10}},
{0x26, 1, {0x9B}},
{0x2D, 1, {0x01}},
{0x2E, 1, {0x84}},
{0x2F, 1, {0x00}},
{0x30, 1, {0x02}},
{0x31, 1, {0x08}},
{0x32, 1, {0x01}},
{0x33, 1, {0x1C}},
{0x34, 1, {0x40}},
{0x35, 1, {0xFF}},
{0x36, 1, {0xFF}},
{0x37, 1, {0xFF}},
{0x38, 1, {0xFF}},
{0x39, 1, {0xFF}},
{0x3A, 1, {0x05}},
{0x3B, 1, {0x00}},
{0x3C, 1, {0x00}},
{0x3D, 1, {0x00}},
{0x3E, 1, {0xCF}},
{0x3F, 1, {0x84}},
{0x40, 1, {0x2F}},
{0x41, 1, {0xFC}},
{0x42, 1, {0x01}},
{0x43, 1, {0x40}},
{0x44, 1, {0x05}},
{0x45, 1, {0xE8}},
{0x46, 1, {0x16}},
{0x47, 1, {0x00}},
{0x48, 1, {0x00}},
{0x49, 1, {0x88}},
{0x4A, 1, {0x08}},
{0x4B, 1, {0x05}},
{0x4C, 1, {0x03}},
{0x4D, 1, {0xD0}},
{0x4E, 1, {0x13}},
{0x4F, 1, {0xFF}},
{0x50, 1, {0x0A}},
{0x51, 1, {0x53}},
{0x52, 1, {0x26}},
{0x53, 1, {0x22}},
{0x54, 1, {0x09}},
{0x55, 1, {0x22}},
{0x56, 1, {0x00}},
{0x57, 1, {0x1C}},
{0x58, 1, {0x03}},
{0x59, 1, {0x3F}},
{0x5A, 1, {0x28}},
{0x5B, 1, {0x01}},
{0x5C, 1, {0xCC}},
{0x5D, 1, {0x21}},
{0x5E, 1, {0x84}},
{0x5F, 1, {0x10}},
{0x60, 1, {0x42}},
{0x61, 1, {0x08}},
{0x62, 1, {0x21}},
{0x63, 1, {0x84}},
{0x64, 1, {0x80}},
{0x65, 1, {0x0C}},
{0x66, 1, {0x74}},
{0x67, 1, {0x4C}},
{0x68, 1, {0x09}},
{0x69, 1, {0x12}},
{0x6A, 1, {0x42}},
{0x6B, 1, {0x08}},
{0x6C, 1, {0x21}},
{0x6D, 1, {0x84}},
{0x6E, 1, {0x10}},
{0x6F, 1, {0x42}},
{0x70, 1, {0x08}},
{0x71, 1, {0xE9}},
{0x72, 1, {0xC4}},
{0x73, 1, {0xD7}},
{0x74, 1, {0xD6}},
{0x75, 1, {0x28}},
{0x76, 1, {0x00}},
{0x77, 1, {0x00}},
{0x78, 1, {0x0F}},
{0x79, 1, {0xE0}},
{0x7A, 1, {0x01}},
{0x7B, 1, {0xFF}},
{0x7C, 1, {0xFF}},
{0x7D, 1, {0x0F}},
{0x7E, 1, {0x41}},
{0x7F, 1, {0xFE}},
{0xB1, 1, {0x02}},
{0x00, 1, {0xFF}},
{0x01, 1, {0x05}},
{0x02, 1, {0xF0}},
{0x03, 1, {0x00}},
{0x04, 1, {0x94}},
{0x05, 1, {0x48}},
{0x06, 1, {0xC8}},
{0x07, 1, {0x0A}},
{0x08, 1, {0x00}},
{0x09, 1, {0x00}},
{0x0A, 1, {0x00}},
{0x0B, 1, {0x10}},
{0x0C, 1, {0xE6}},
{0x0D, 1, {0x0D}},
{0x0F, 1, {0x00}},
{0x10, 1, {0xF9}},
{0x11, 1, {0x4D}},
{0x12, 1, {0x9E}},
{0x13, 1, {0x8F}},
{0x14, 1, {0xDF}},
{0x15, 1, {0x15}},
{0x16, 1, {0xE4}},
{0x17, 1, {0x6A}},
{0x18, 1, {0xAB}},
{0x19, 1, {0xD7}},
{0x1A, 1, {0x78}},
{0x1B, 1, {0xFE}},
{0x1C, 1, {0xFF}},
{0x1D, 1, {0xFF}},
{0x1E, 1, {0xFF}},
{0x1F, 1, {0xFF}},
{0x20, 1, {0xFF}},
{0x21, 1, {0xFF}},
{0x22, 1, {0xFF}},
{0x23, 1, {0xFF}},
{0x24, 1, {0xFF}},
{0x25, 1, {0xFF}},
{0x26, 1, {0xFF}},
{0x27, 1, {0x1F}},
{0x28, 1, {0xFF}},
{0x29, 1, {0xFF}},
{0x2A, 1, {0xFF}},
{0x2B, 1, {0xFF}},
{0x2C, 1, {0xFF}},
{0x2D, 1, {0x07}},
{0x33, 1, {0x3F}},
{0x35, 1, {0x7F}},
{0x36, 1, {0x3F}},
{0x38, 1, {0xFF}},
{0x3A, 1, {0x80}},
{0x3B, 1, {0x01}},
{0x3C, 1, {0x00}},
{0x3D, 1, {0x2F}},
{0x3E, 1, {0x00}},
{0x3F, 1, {0xE0}},
{0x40, 1, {0x05}},
{0x41, 1, {0x00}},
{0x42, 1, {0xBC}},
{0x43, 1, {0x00}},
{0x44, 1, {0x80}},
{0x45, 1, {0x07}},
{0x46, 1, {0x00}},
{0x47, 1, {0x00}},
{0x48, 1, {0x9B}},
{0x49, 1, {0xD2}},
{0x4A, 1, {0xC1}},
{0x4B, 1, {0x83}},
{0x4C, 1, {0x17}},
{0x4D, 1, {0xC0}},
{0x4E, 1, {0x0F}},
{0x4F, 1, {0xF1}},
{0x50, 1, {0x78}},
{0x51, 1, {0x7A}},
{0x52, 1, {0x34}},
{0x53, 1, {0x99}},
{0x54, 1, {0xA2}},
{0x55, 1, {0x02}},
{0x56, 1, {0x14}},
{0x57, 1, {0xB8}},
{0x58, 1, {0xDC}},
{0x59, 1, {0xD4}},
{0x5A, 1, {0xEF}},
{0x5B, 1, {0xF7}},
{0x5C, 1, {0xFB}},
{0x5D, 1, {0xFD}},
{0x5E, 1, {0x7E}},
{0x5F, 1, {0xBF}},
{0x60, 1, {0xEF}},
{0x61, 1, {0xE6}},
{0x62, 1, {0x76}},
{0x63, 1, {0x73}},
{0x64, 1, {0xBB}},
{0x65, 1, {0xDD}},
{0x66, 1, {0x6E}},
{0x67, 1, {0x37}},
{0x68, 1, {0x8C}},
{0x69, 1, {0x08}},
{0x6A, 1, {0x31}},
{0x6B, 1, {0xB8}},
{0x6C, 1, {0xB8}},
{0x6D, 1, {0xB8}},
{0x6E, 1, {0xB8}},
{0x6F, 1, {0xB8}},
{0x70, 1, {0x5C}},
{0x71, 1, {0x2E}},
{0x72, 1, {0x17}},
{0x73, 1, {0x00}},
{0x74, 1, {0x00}},
{0x75, 1, {0x00}},
{0x76, 1, {0x00}},
{0x77, 1, {0x00}},
{0x78, 1, {0x00}},
{0x79, 1, {0x00}},
{0x7A, 1, {0xDC}},
{0x7B, 1, {0xDC}},
{0x7C, 1, {0xDC}},
{0x7D, 1, {0xDC}},
{0x7E, 1, {0xDC}},
{0x7F, 1, {0x6E}},
{0x0B, 1, {0x00}},
{0xB1, 1, {0x03}},
{0x2C, 1, {0x2C}},
{0xB1, 1, {0x00}},
{0x89, 1, {0x03}},
你把d1的sdk存f盘了,这样肯定报错,把sdk移动到/home文件夹下就行了,存到wsl里不能存外面
修复叻,手残打开了Boot Time Optimization
#
# Boot Time Optimization
#
# CONFIG_BOOT_TIME_OPTIMIZATION is not set
使用量产卡刷入Uboot有输出,使用启动卡就不行了
[303]HELLO! BOOT0 is starting!
[306]BOOT0 commit : e3b2a9e
[309]board init start
[311]set pll start
[314]set pll end
[315][pmu]: bus read error
[318][pmu]: bus read error
[321]board init ok
[322]chip id check OK
[325]DRAM BOOT DRIVE INFO: V0.41
[328]DRAM CLK = 528 MHz
[330]DRAM Type = 2 (2:DDR2,3:DDR3)
[333]DRAMC read ODT off.
[336]DRAM ODT off.
[338]DRAM SIZE =64 M
[344]DRAM simple test OK.
[347]rtc standby flag is 0x0, super standby flag is 0x0
[352]dram size =64
MESSAGE: [0x0] TEE-CORE: OP-TEE version: sun8iw19p1_v0.6.0-14-gf6954e7 #1 2019. 11. 21. .... 01:34:42 UTC arm
ERROR: [0x0] TEE-CORE:platform_standby_fdt_parse:126: no pmu node
ERROR: [0x0] TEE-CORE:sunxi_twi_parse_from_dt:84: no pmu node
U-Boot 2018.05-00008-g384031a (Jan 16 2020 - 14:12:41 +0800) Allwinner Technology
[00.467]CPU: Allwinner Family
[00.470]Model: sun8iw19
I2C: ready
[00.474]DRAM: 64 MiB
[00.477]Relocation Offset is: f9f46000
[00.498]secure enable bit: 0
[00.502]pmu_axp152_probe pmic_bus_read fail
[00.505]pmu_axp2101_probe pmic_bus_read fail
[00.509]PMU: no found
[00.511]bmu_axp152_probe pmic_bus_read fail
[00.515]bmu_axp2101_probe pmic_bus_read fail
[00.519]BMU: no found
[00.521]CPU=1008 MHz,PLL6=600 Mhz,AHB=200 Mhz, APB1=100Mhz MBus=132Mhz
[00.528]gic: sec monitor mode
[00.530]flash init start
[00.533]workmode = 17,storage type = 1
try card 2
set card number 2
get card number 2
[00.540]mmc driver ver uboot2018:2019-12-13 9:48:00
[00.545]get mem for descripter OK !
[00.549]get gpio bias fail
[00.551]get gpio_bias: pc_bias fail
[00.555]get card2_boot_para:sdc_io_1v8 fail
[00.561]get card2 disable pin fail
[00.564]get card2_boot_para:sdc_ex_dly_used fail
[00.568]get sdc_ex_dly_used -1090671915, use auto tuning sdly
[00.574]get sdc2 sdc_boot0_sup_1v8 fail.
[00.578]get card-pwr-gpios faild
[00.581]get card2_boot_para:time_pwroff_ms:use default time_pwroff:200
[00.587]Using default timing para
[00.590]init mmc 2 clock and io
[00.593]devnum 2, prv 43fb6590, bdesc 42b664ec
[00.597]SUNXI SD/MMC: 2
[00.599]==================== work mode: 17 0, sample_mode:0
[00.605]=============== start mmc_init_boot...
[00.623]Card did not respond to voltage select!
[00.627]mmc_init: -95, time 28
[00.630]mmc_init: mmc init fail, err -95
MMC init failed
try emmc fail
[00.636]NB1 : enter phy init
[00.639][NI]enter rawnand hardward init..
[00.643]nand0: get node offset error
[00.646][NE]init nctri NAND PIORequest error!
[00.650][NE]rawnand_channel_init channel@0 init nctri fail
[00.656][NI]rawnand hardward init fail
[00.659][NI]---rawnand_dump_clock start---
[00.663][NI]---rawnand_dump_clock end---
[00.667][NI]---rawnand_dump_gpio_nand start---
[00.671][NI]---rawnand_dump_gpio_nand end---
[00.675][NE]nand_physic_init error -1
[00.678]NB1 : nand phy init fail
[00.681]Failed to probe nand flash
try nand fail
[00.691]unrecognized JEDEC id bytes: ff, ff, ff
try spinor fail
initcall sequence 43fab5dc failed at call 4a00a301 (err=-1)
### ERROR ### Please RESET the board ###
[302]HELLO! BOOT0 is starting!
[305]BOOT0 commit : e3b2a9e
[307]board init start
[310]set pll start
[312]set pll end
[314][pmu]: bus read error
[316][pmu]: bus read error
[319]board init ok
[321]chip id check OK
[323]DRAM BOOT DRIVE INFO: V0.41
[326]DRAM CLK = 528 MHz
[328]DRAM Type = 2 (2:DDR2,3:DDR3)
[332]DRAMC read ODT off.
[334]DRAM ODT off.
[337]DRAM SIZE =64 M
[343]DRAM simple test OK.
[345]rtc standby flag is 0x0, super standby flag is 0x0
[350]dram size =64
MESSAGE: [0x0] TEE-CORE: OP-TEE version: sun8iw19p1_v0.6.0-14-gf6954e7 #1 2019. 11. 21. .... 01:34:42 UTC arm
ERROR: [0x0] TEE-CORE:platform_standby_fdt_parse:126: no pmu node
ERROR: [0x0] TEE-CORE:sunxi_twi_parse_from_dt:84: no pmu node
mount: mounting pstore on /sys/fs/pstore failed: No such file or directory
mount: mounting /dev/by-name/rootfs_data on /overlay failed: No such file or directory
Mount Failed: formating /dev/by-name/rootfs_data to ext4 ...
mke2fs 1.42.12 (29-Aug-2014)
The file /dev/by-name/rootfs_data does not exist and no size was specified.
can't run '/bin/mkdir': Read-only file system
mount: mounting devpts on /dev/pts failed: No such file or directory
------run rc.preboot file-----
------run rc.modules file-----
------run rc.final file-----
Load mpp modules
read-only file system detected...done
Starting network...
ifconfig: SIOCGIFFLAGS: No such device
Successfully initialized wpa_supplicant
Could not read interface wlan0 flags: No such device
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Could not read interface wlan0 flags: No such device
wlan0: Failed to initialize driver interface
Starting telnetd: udhcpc: SIOCGIFINDEX: No such device
OK
enable android usb
sh: write error: Resource busy
BusyBox v1.27.2 () built-in shell (ash)
------run profile file-----
_____ _ __ _
|_ _||_| ___ _ _ | | |_| ___ _ _ _ _
| | _ | || | | |__ | || || | ||_'_|
| | | || | || _ | |_____||_||_|_||___||_,_|
|_| |_||_|_||_|_| Tina is Based on OpenWrt!
----------------------------------------------
Tina Linux (Neptune, 5C1C9C53)
----------------------------------------------
printk的等级已经设置7了
[302]HELLO! BOOT0 is starting!
[305]BOOT0 commit : e3b2a9e
[307]board init start
[310]set pll start
[312]set pll end
[314][pmu]: bus read error
[316][pmu]: bus read error
[319]board init ok
[321]chip id check OK
[323]DRAM BOOT DRIVE INFO: V0.41
[326]DRAM CLK = 528 MHz
[328]DRAM Type = 2 (2:DDR2,3:DDR3)
[332]DRAMC read ODT off.
[334]DRAM ODT off.
[337]DRAM SIZE =64 M
[343]DRAM simple test OK.
[345]rtc standby flag is 0x0, super standby flag is 0x0
[350]dram size =64
MESSAGE: [0x0] TEE-CORE: OP-TEE version: sun8iw19p1_v0.6.0-14-gf6954e7 #1 2019年 11月 21日 星期四 01:34:42 UTC arm
ERROR: [0x0] TEE-CORE:platform_standby_fdt_parse:126: no pmu node
ERROR: [0x0] TEE-CORE:sunxi_twi_parse_from_dt:84: no pmu node
mount: mounting pstore on /sys/fs/pstore failed: No such file or directory
mount: mounting /dev/by-name/rootfs_data on /overlay failed: No such file or directory
Mount Failed: formating /dev/by-name/rootfs_data to ext4 ...
mke2fs 1.42.12 (29-Aug-2014)
The file /dev/by-name/rootfs_data does not exist and no size was specified.
can't run '/bin/mkdir': Read-only file system
mount: mounting devpts on /dev/pts failed: No such file or directory
------run rc.preboot file-----
------run rc.modules file-----
------run rc.final file-----
Load mpp modules
read-only file system detected...done
Starting network...
ifconfig: SIOCGIFFLAGS: No such device
Successfully initialized wpa_supplicant
Could not read interface wlan0 flags: No such device
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Could not read interface wlan0 flags: No such device
wlan0: Failed to initialize driver interface
udhcpc: SIOCGIFINDEX: No such device
Starting telnetd: OK
enable android usb
sh: write error: Resource busy
BusyBox v1.27.2 () built-in shell (ash)
------run profile file-----
_____ _ __ _
|_ _||_| ___ _ _ | | |_| ___ _ _ _ _
| | _ | || | | |__ | || || | ||_'_|
| | | || | || _ | |_____||_||_|_||___||_,_|
|_| |_||_|_||_|_| Tina is Based on OpenWrt!
----------------------------------------------
Tina Linux (Neptune, 5C1C9C53)
----------------------------------------------
root@TinaLinux:/# cat /proc/sys/kernel/printk
7 7 1 7
@zt13947787451 参考这个OpenSBI,这个是D1使用的版本,可能master的OpenSBI有些更改。opensbi.zip
或者贴一下操作的code
简单的方法使用OpenSBI,RustSBI切换,不太建议直接操作CSR寄存器。
如果需要操作寄存器切换,可以尝试参考Xuantie_C906_R1S0_User_Manual.pdf 中的附录A与附录C相关的操作说明。
官方的D1使用的是OpenSBI
@cstyle xr819 wifi模块问题,应该是依赖相关错误,建议在build前先make kernel_menuconfig和make menuconfig
sudo apt install openssl
bash
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib"
@wxgd2017 全志平台的brandy里有芯片验证代码,R528和T113虽然是一个Die,但是其烧录的验证代码是不一样的,所以不能启动。
可以在直接在brandy的build.sh里面把传进来的值强制赋值成T113,不过这个要自己研究了
或者下载T113的SDK替换brandy
在EVB电路图里看到D1s内置了ALDO和HPLDO
数据手册里看到是内置的,但是外面没有看到相关的输出引脚。是AVCC,HPVCC自己就是输出吗?