您尚未登录。

#1 全志 SOC » mainline kernel驱动移植到 legacy kernel » 2019-08-02 15:01:23

flash
回复: 3

之前使用的内核是linux 4.9,使用device tree配置设备资源。设备树中i2c设备信息如下:
&i2c1 {
    status = "okay";
    penctrl@57 {
        compatible = "maxim,max31760";
        reg = <0x57>;
    };

    mpu6050@68 {
        compatible = "invensense,mpu6050";
        reg = <0x68>;
    };
};

如何将该驱动移植到使用sys_config.fex描述硬件资源的linux3.4内核中??

#2 Re: 全志 SOC » allwinner h3 otg做host 连接外设usb » 2019-07-22 10:18:43

路漫漫 说:

插入的这个是 hub 还是 U盘?

hub跟u盘结果都是一样的。

#3 Re: 全志 SOC » allwinner h3 otg做host 连接外设usb » 2019-07-22 09:36:05

路漫漫 说:

你这个看起来驱动没有问题, 估计是硬件问题, 可能是某些原因被复位了.

使用的bsp包是https://github.com/orangepi-xunlong/orangepi_h3_linux,其中包含了两个内核版本,
一个是3.4的,它是用fex文件配置资源的,
另一个是4.9的,它是用device tree配置资源的。

使用linux 3.4是可以正常枚举的,说明硬件没问题啊。
现在一直用的是4.9,设备树配置后使用异常,郁闷啊。

#4 Re: 全志 SOC » allwinner h3 otg做host 连接外设usb » 2019-07-22 09:22:32

arychen 说:

H3  android4.4的时候老的系统,我有用otg做host过   写个指令直接可以转换模式。

使用的是什么指令??

#5 Re: 全志 SOC » allwinner h3 otg做host 连接外设usb » 2019-07-22 09:20:19

晕哥 说:

失败的日志是什么?
用香橙派 lite 板子吗?

使用的是orangepi one ,日志信息如下:

[    0.029246] reg-fixed-voltage usb0-vbus: could not find pctldev for node /soe
[    0.030528] usbcore: registered new interface driver usbfs                   
[    0.030605] usbcore: registered new interface driver hub                     
[    0.030694] usbcore: registered new device driver usb                       
[    0.057387] sun4i-usb-phy 1c19400.phy: could not find pctldev for node /soc/e
[    0.827676] usbcore: registered new interface driver cdc_acm                 
[    0.841437] usbcore: registered new interface driver usblp                   
[    0.846984] usbcore: registered new interface driver cdc_wdm                 
[    0.852704] usbcore: registered new interface driver usbtmc                 
[    0.858319] usbcore: registered new interface driver uas                     
[    0.863711] usbcore: registered new interface driver usb-storage             
[    0.869757] usbcore: registered new interface driver ums-alauda             
[    0.875730] usbcore: registered new interface driver ums-cypress             
[    0.881773] usbcore: registered new interface driver ums-datafab             
[    0.887832] usbcore: registered new interface driver ums_eneub6250           
[    0.894064] usbcore: registered new interface driver ums-freecom             
[    0.900106] usbcore: registered new interface driver ums-isd200             
[    0.906077] usbcore: registered new interface driver ums-jumpshot           
[    0.912205] usbcore: registered new interface driver ums-karma               
[    0.918091] usbcore: registered new interface driver ums-onetouch           
[    0.924249] usbcore: registered new interface driver ums-realtek             
[    0.930291] usbcore: registered new interface driver ums-sddr09             
[    0.936271] usbcore: registered new interface driver ums-sddr55             
[    0.942229] usbcore: registered new interface driver ums-usbat               
[    0.948127] usbcore: registered new interface driver mdc800                 
[    0.961429] usbcore: registered new interface driver microtekX6             
[    0.967469] usbcore: registered new interface driver usbserial               
[    0.973384] usbip_core: usbip_core_init:776: USB/IP Core v1.0.0             
[    1.009725] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002   
[    1.016543] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    1.023794] usb usb1: Product: USB/IP Virtual Host Controller               
[    1.029548] usb usb1: Manufacturer: Linux 4.9.0-rc1 vhci_hcd                 
[    1.035227] usb usb1: SerialNumber: vhci_hcd                                 
[    1.435067] usbcore: registered new device driver usbip-host                 
[    1.440745] usbip_host: usbip_host_init:302: USB/IP Host Driver v1.0.0       
[    1.728410] usbcore: registered new interface driver usbhid                 
[    1.734017] usbhid: USB HID core driver                                     
[    1.969537] ehci-platform 1c1a000.usb: EHCI Host Controller                 
[    1.975510] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus 2
[    1.989707] ehci-platform 1c1a000.usb: irq 28, io mem 0x01c1a000             
[    2.001630] usb usb1: vhci_bus_suspend                                       
[    2.027504] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00           
[    2.039566] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002   
[    2.046402] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.053657] usb usb2: Product: EHCI Host Controller                         
[    2.058543] usb usb2: Manufacturer: Linux 4.9.0-rc1 ehci_hcd                 
[    2.064223] usb usb2: SerialNumber: 1c1a000.usb                             
[    2.080888] ehci-platform 1c1b000.usb: EHCI Host Controller                 
[    2.086761] ehci-platform 1c1b000.usb: new USB bus registered, assigned bus 3
[    2.094767] ehci-platform 1c1b000.usb: irq 30, io mem 0x01c1b000             
[    2.122553] ehci-platform 1c1b000.usb: USB 2.0 started, EHCI 1.00           
[    2.134951] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002   
[    2.141768] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.149036] usb usb3: Product: EHCI Host Controller                         
[    2.153937] usb usb3: Manufacturer: Linux 4.9.0-rc1 ehci_hcd                 
[    2.159603] usb usb3: SerialNumber: 1c1b000.usb                             
[    2.207139] ehci-platform 1c1c000.usb: EHCI Host Controller                 
[    2.213128] ehci-platform 1c1c000.usb: new USB bus registered, assigned bus 4
[    2.221076] ehci-platform 1c1c000.usb: irq 32, io mem 0x01c1c000             
[    2.252342] ehci-platform 1c1c000.usb: USB 2.0 started, EHCI 1.00           
[    2.258647] usb usb4: New USB device found, idVendor=1d6b, idProduct=0002   
[    2.265464] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.272716] usb usb4: Product: EHCI Host Controller                         
[    2.277601] usb usb4: Manufacturer: Linux 4.9.0-rc1 ehci_hcd                 
[    2.283279] usb usb4: SerialNumber: 1c1c000.usb                             
[    2.296794] ehci-platform 1c1d000.usb: EHCI Host Controller                 
[    2.302642] ehci-platform 1c1d000.usb: new USB bus registered, assigned bus 5
[    2.310563] ehci-platform 1c1d000.usb: irq 34, io mem 0x01c1d000             
[    2.342332] ehci-platform 1c1d000.usb: USB 2.0 started, EHCI 1.00           
[    2.348615] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002   
[    2.355432] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.362683] usb usb5: Product: EHCI Host Controller                         
[    2.367570] usb usb5: Manufacturer: Linux 4.9.0-rc1 ehci_hcd                 
[    2.373248] usb usb5: SerialNumber: 1c1d000.usb                             
[    2.386624] ohci-platform 1c1a400.usb: Generic Platform OHCI controller     
[    2.393508] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus 6
[    2.401381] ohci-platform 1c1a400.usb: irq 29, io mem 0x01c1a400             
[    2.476487] usb usb6: New USB device found, idVendor=1d6b, idProduct=0001   
[    2.483306] usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.490545] usb usb6: Product: Generic Platform OHCI controller             
[    2.496491] usb usb6: Manufacturer: Linux 4.9.0-rc1 ohci_hcd                 
[    2.502158] usb usb6: SerialNumber: 1c1a400.usb                             
[    2.515656] ohci-platform 1c1b400.usb: Generic Platform OHCI controller     
[    2.522535] ohci-platform 1c1b400.usb: new USB bus registered, assigned bus 7
[    2.530403] ohci-platform 1c1b400.usb: irq 31, io mem 0x01c1b400             
[    2.606578] usb usb7: New USB device found, idVendor=1d6b, idProduct=0001   
[    2.613396] usb usb7: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.620635] usb usb7: Product: Generic Platform OHCI controller             
[    2.626575] usb usb7: Manufacturer: Linux 4.9.0-rc1 ohci_hcd                 
[    2.632242] usb usb7: SerialNumber: 1c1b400.usb                             
[    2.645659] ohci-platform 1c1c400.usb: Generic Platform OHCI controller     
[    2.652529] ohci-platform 1c1c400.usb: new USB bus registered, assigned bus 8
[    2.660425] ohci-platform 1c1c400.usb: irq 33, io mem 0x01c1c400             
[    2.736586] usb usb8: New USB device found, idVendor=1d6b, idProduct=0001   
[    2.743406] usb usb8: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.750645] usb usb8: Product: Generic Platform OHCI controller             
[    2.756586] usb usb8: Manufacturer: Linux 4.9.0-rc1 ohci_hcd                 
[    2.762252] usb usb8: SerialNumber: 1c1c400.usb                             
[    2.775715] ohci-platform 1c1d400.usb: Generic Platform OHCI controller     
[    2.782603] ohci-platform 1c1d400.usb: new USB bus registered, assigned bus 9
[    2.790474] ohci-platform 1c1d400.usb: irq 35, io mem 0x01c1d400             
[    2.866505] usb usb9: New USB device found, idVendor=1d6b, idProduct=0001   
[    2.873333] usb usb9: New USB device strings: Mfr=3, Product=2, SerialNumber1
[    2.880573] usb usb9: Product: Generic Platform OHCI controller             
[    2.886516] usb usb9: Manufacturer: Linux 4.9.0-rc1 ohci_hcd                 
[    2.892183] usb usb9: SerialNumber: 1c1d400.usb                             
[    3.112351] usb 7-1: new full-speed USB device number 2 using ohci-platform 
[    3.222443] usb 8-1: new full-speed USB device number 2 using ohci-platform 
[    3.322431] usb 9-1: new full-speed USB device number 2 using ohci-platform 
[    3.381463] usb 7-1: New USB device found, idVendor=04d8, idProduct=00de     
[    3.388273] usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.395430] usb 7-1: Product: MCP2210 USB to SPI Master                     
[    3.400663] usb 7-1: Manufacturer: Microchip Technology Inc.                 
[    3.406344] usb 7-1: SerialNumber: 0000893622                               
[    3.451685] hid-generic 0003:04D8:00DE.0001: hidraw0: USB HID v1.11 Device [0
[    3.511460] usb 8-1: New USB device found, idVendor=04d8, idProduct=00de     
[    3.518275] usb 8-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.525432] usb 8-1: Product: MCP2210 USB to SPI Master                     
[    3.530666] usb 8-1: Manufacturer: Microchip Technology Inc.                 
[    3.536347] usb 8-1: SerialNumber: 0000890804                               
[    3.581700] hid-generic 0003:04D8:00DE.0002: hidraw1: USB HID v1.11 Device [0
[    3.615415] usb 9-1: New USB device found, idVendor=04d8, idProduct=00de     
[    3.622158] usb 9-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.629360] usb 9-1: Product: MCP2210 USB to SPI Master                     
[    3.634606] usb 9-1: Manufacturer: Microchip Technology Inc.                 
[    3.640273] usb 9-1: SerialNumber: 0000890805                               
[    3.681660] hid-generic 0003:04D8:00DE.0003: hidraw2: USB HID v1.11 Device [0

#6 全志 SOC » allwinner h3 otg做host 连接外设usb » 2019-07-20 12:08:18

flash
回复: 9

用h3的otg口做host连接usb设备,设备枚举失败。
使用的软件linux内核版本是linux4.9,设备树配置如下:

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

&usbphy {
    /* USB VBUS is always on except for the OTG port */
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&usb0_id_detect_pin>;
    usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
    usb0_vbus-supply = <&reg_usb0_vbus>;
};

&ohci0 {
    status = "okay";
};

&ehci0 {
    status = "okay";
};

这是设么情况???

#7 Re: 全志 SOC » JTAG 调试 H3 » 2019-06-04 15:42:37

晕哥,uboot起来之后重新配置了PA0~3引脚功能为JTAG,还是没连接上? 有做过H3的jlik调试吗?能发一份给我吗?  谢谢!

JTAG的引脚需要设置上拉电阻吗??

#8 Re: 全志 SOC » JTAG 调试 H3 » 2019-06-04 14:44:41

全志的芯片是不是uboot起来之后,讲PA0~3引脚功能配置成JTAG功能就能连接,识别设备?我现在的问题是连不上设备。

#9 全志 SOC » JTAG 调试 H3 » 2019-06-04 14:10:46

flash
回复: 7

通过jlink连接H3板子,总是连接不上?有用过jtag调试全志芯片的吗?
连接需要其它步骤吗?

#10 全志 SOC » H3 emmc 调试 » 2019-05-23 10:55:42

flash
回复: 1

参照 orangepi pc plus 在设备树中添加了设备信息:
&mmc2 {
    pinctrl-names = "default";
    pinctrl-0 = <&mmc2_8bit_pins>;
    vmmc-supply = <&reg_vcc3v3>;
    bus-width = <8>;
    non-removable;
    cap-mmc-hw-reset;
    status = "okay";
};

&mmc2_8bit_pins {
    /* Increase drive strength for DDR modes */
    allwinner,drive = <SUN4I_PINCTRL_40_MA>;
    /* eMMC is missing pull-ups */
    allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
};

启动log:
[    1.028147] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 8, RTO !!
[    1.065805] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    1.072411] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    1.078901] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    1.085414] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 55, RTO !!
[    1.097286] sunxi-mmc 1c11000.mmc: smc 1 err, cmd 1, RTO !!


这会是什么问题?
可以从sd卡启动,说明mmc驱动没有问题,只需要在设备树中添加设备信息就行了。

#11 Re: 全志 SOC » allwinner H3 NAND FLASH调试 » 2019-05-17 18:25:09

The address: 01c14200
sid_reg->sid_key0: 0x2904620
sid_reg->sid_key1: 0x4910318
sid_reg->sid_key2: 0x78170713
sid_reg->sid_key3: 0x60000078

数据手册上没有相应的值,wiki上也没有,这是对的吗?

#12 Re: 全志 SOC » allwinner H3 NAND FLASH调试 » 2019-05-17 17:40:29

sid 寄存器中有特定的数据??

#13 Re: 全志 SOC » allwinner H3 NAND FLASH调试 » 2019-05-17 17:35:23

没错的,在uboot中都是这样子用的。
readl(&nfc->ndfc_wcmd_set)

#14 全志 SOC » allwinner H3 NAND FLASH调试 » 2019-05-17 17:01:33

flash
回复: 9

H3芯片外接nand flash芯片,在调试uboot的时候,读写nfc寄存器的值都为0,其它控制器不是,这是什么问题??
void board_nand_init(void)
{
    printf("+++ board_nand_init +++\n");
    nand_pinmux_setup();
    nand_clock_setup();

    struct sunxi_nfc_reg
    {
        uint32_t    ndfc_ctl;
        uint32_t    ndfc_st;
        uint32_t    ndfc_int;
        uint32_t    ndfc_timing_ctl;
        uint32_t    ndfc_timing_cfg;
        uint32_t    ndfc_addr_low;
        uint32_t    ndfc_addr_high;
        uint32_t    ndfc_block_num;
        uint32_t    ndfc_cnt;
        uint32_t    ndfc_rcmd_set;
        uint32_t    ndfc_wcmd_set;
    };

    struct sunxi_gpio_reg *const pio = (struct sunxi_gpio_reg *)SUNXI_PIO_BASE;

    printf("address: %p \n", &pio->gpio_bank[2].cfg[0]);
    printf("value: 0x%x \n", readl(&pio->gpio_bank[2].cfg[0]));

    struct sunxi_nfc_reg *const nfc = (struct sunxi_nfc_reg *)0x01C03000;

    printf("ndfc->ndfc_wcmd_set: %p \n", &nfc->ndfc_wcmd_set);
    printf("ndfc_wcmd_set: 0x%x \n", readl(&nfc->ndfc_wcmd_set));

#ifndef CONFIG_SPL_BUILD
    sunxi_nand_init();
#endif
}


U-Boot SPL 2017.03 (May 17 2019 - 15:12:56)
DRAM: 512 MiB
Trying to boot from MMC1


U-Boot 2017.03 (May 17 2019 - 15:12:56 +0800) Allwinner Technology

CPU:   Allwinner H3 (SUN8I 1680)
Model: Xunlong Orange Pi One
DRAM:  512 MiB
+++ initr_nand +++
NAND:  +++ nand_init +++
+++ board_nand_init +++
address: 01c20848
value: 0x22222222
ndfc->ndfc_wcmd_set: 01c03028
ndfc_wcmd_set: 0x0
+++ sunxi_nand_init +++
+++ regs: 01c03000 +++
sunxi nfc reset successful!
chip: 0x0
ccm->nand0_clk_cfg: 01c20080
ccm->nand0_clk_cfg: 0x8102000a
ccm->sd0_clk_cfg: 01c20088
ccm->sd0_clk_cfg: 0x8140030b
ccm->pll6_cfg: 01c20028
ccm->pll6_cfg: 0x90041811
NFC_REG_TIMING_CTL: 0x0
NFC_REG_CTL: 0x0
NFC_REG_CTL: 0x0

页脚

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

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