Hi Bin,

Sorry for the top-posting.

After check the datasheet, I think my SPI address was wrong due to null 
ops->read_config in pci_bus_read_config().
My dts file:
          spi: spi {
                                #address-cells = <1>;
                                #size-cells = <0>;
                compatible = "intel,ich9-spi";
                spi-flash@0 {
                                        #address-cells = <1>;
                                        #size-cells = <1>;
                    reg = <0>;
                    compatible = "winbond,w25q128bv", "spi-flash";
                    memory-map = <0xff000000 0x01000000>;
                    rw-mrc-cache {
                        label = "rw-mrc-cache";
                        reg = <0xffe10000 0x00010000>;
                    };
                };
            };

And also bind the node as following:

        bind node spi
        ##device_bind: driver id:50, driver name:ich_spi
        Looking for 'spi' at 1140, name spi
        Looking for 'spi' at 1140, name spi
                - spi0, /pci/pch@1f,0/spi
                - spi0, /pci/pch@1f,0/spi
        Found seq 0
        Found seq 0
        bind node spi-flash@0
        ##device_bind: driver id:52, driver name:spi_flash_std
        fdtdec_get_bool: spi-cpol
        fdtdec_get_bool: spi-cpha
        fdtdec_get_bool: spi-cs-high
        fdtdec_get_bool: spi-3wire
        fdtdec_get_bool: spi-half-duplex

The "dm tree" is as following:
Class       Probed   Name
----------------------------------------
 root        [ + ]    root_driver
 serial      [ + ]    |-- serial
 keyboard    [ + ]    |-- keyboard
 rtc         [   ]    |-- rtc
 timer       [ + ]    |-- tsc-timer
 pci         [ + ]    `-- pci
 pch         [ + ]        |-- pch@1f,0
 irq         [ + ]        |   |-- irq-router
 spi         [ + ]        |   `-- spi
 spi_flash   [   ]        |       `-- spi-flash@0
 pci_generic [   ]        |-- pci_0:0.0
 pci         [ + ]        |-- pci_0:1.0
 pci_generic [   ]        |   `-- pci_1:0.0
 pci         [ + ]        |-- pci_0:3.0
 pci_generic [   ]        |-- pci_0:e.0
 pci_generic [   ]        |-- pci_0:f.0
 pci_generic [   ]        |-- pci_0:13.0
 usb         [   ]        |-- ehci_pci
 pci_generic [   ]        |-- pci_0:17.0
 pci_generic [   ]        |-- pci_0:18.0
 pci_generic [   ]        `-- pci_0:1f.3

So I think the initialization is ok. But when I execute "sf probe", I got 
following wrong result:

##uclass_find_device_by_seq: find_req_seq=0 seq_or_req_seq=0
##uclass_find_device_by_seq: id=50, ret=0
##uclass_find_device_by_seq: dev req bus=0 dev bus=-1
device not found
##spi_flash_probe_bus_cs: bus=0, num=0
##uclass_find_device_by_seq: find_req_seq=0 seq_or_req_seq=0
##uclass_find_device_by_seq: id=50, ret=0
##uclass_find_device_by_seq: dev req bus=0 dev bus=-1
device not found
##uclass_get_device_by_seq: id=50, bus=0, ret=-19
##uclass_find_device_by_seq: find_req_seq=1 seq_or_req_seq=0
##uclass_find_device_by_seq: id=50, ret=0
##uclass_find_device_by_seq: dev req bus=0 dev bus=-1
device found
##uclass_find_device_by_seq: find_req_seq=0 seq_or_req_seq=0
##uclass_find_device_by_seq: id=50, ret=0
##uclass_find_device_by_seq: dev req bus=0 dev bus=-1
device not found
##uclass_resolve_seq: Device 'spi': seq 0 dup name:'<NULL>', ret=-19
###ops->read_config is null
##ich_init_controller: sbasep:2143514112, sbase_addr:7fc36ed2
ich_init_controller: sbase=7fc36e00

The node "spi" does not have correct operations to read config. Is it due to 
wrong device model or wrong dts file?

Regards,
Hilbert
This e-mail and its attachment may contain PEGATRON Corp information that is 
confidential or privileged, and are solely for the use of the individual to 
whom this e-mail is addressed. If you are not the intended recipient or have 
received it accidentally, please immediately notify the sender by reply e-mail 
and destroy all copies of this email and its attachment. Please be advised that 
any unauthorized use, disclosure, distribution or copying of this email or its 
attachment is strictly prohibited.
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to