[U-Boot] xhci USB controller driver for x86 board

2016-11-09 Thread Ding, ChiX
Hi there
I'm having problem getting USB 3.0 controller working properly on the Intel 
Denverton x86 board.
First I tried to use xhci driver, but there doesn't seem to be any xhci driver 
or generic driver for x86
I only found the following
xhci-exynos5.c:   { .compatible = "samsung,exynos5250-xhci" }, 
xhci-mvebu.c: { .compatible = "marvell,armada3700-xhci" }, 
xhci-rockchip.c:  { .compatible = "rockchip,rk3399-xhci" },

Then I tried to use ehci driver, as there is generic driver for ehci-pci
ehci-pci.c: { .compatible = "ehci-pci" },

I added the section into device tree file
usb_0: usb@15,0 {
reg = <0xa800 0 0 0 0>;
compatible = "ehci-pci";
};

When I run "usb start", U-boot is able to find the controller, but doesn't 
detect the usb keyboard or
Pendrive which are plugged to the USB ports.

=> usb info
1: Hub,  USB Revision 2.0
- u-boot EHCI Host Controller 
 - Class: Hub
- PacketSize: 64  Configurations: 1
- Vendor: 0x  Product 0x Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
 Interface: 0
 - Alternate Setting 0, Endpoints: 1
 - Class Hub
 - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

I see the following in the log. It doesn't find child devices when scanning.
scanning bus 0 for devices... 
Calling usb_setup_device(), portnr=0
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x100 index 0x0 length 
0x40
ehci_submit_control_msg: dev='usb@15,0', udev=7f4ef080, udev->dev='usb@15,0', 
portnr=0
req=6 (0x6), type=128 (0x80), value=256, index=0
USB_DT_DEVICE request
set address 1
usb_control_msg: request: 0x5, requesttype: 0x0, value 0x1 index 0x0 length 0x0
ehci_submit_control_msg: dev='usb@15,0', udev=7f4ef080, udev->dev='usb@15,0', 
portnr=0
req=5 (0x5), type=0 (0x0), value=1, index=0
USB_REQ_SET_ADDRESS
Len is 0
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x100 index 0x0 length 
0x12
ehci_submit_control_msg: dev='usb@15,0', udev=7f4ef080, udev->dev='usb@15,0', 
portnr=0
req=6 (0x6), type=128 (0x80), value=256, index=0
USB_DT_DEVICE request
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0 length 
0x9
ehci_submit_control_msg: dev='usb@15,0', udev=7f4ef080, udev->dev='usb@15,0', 
portnr=0
req=6 (0x6), type=128 (0x80), value=512, index=0
USB_DT_CONFIG config
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0 length 
0x19
ehci_submit_control_msg: dev='usb@15,0', udev=7f4ef080, udev->dev='usb@15,0', 
portnr=0
req=6 (0x6), type=128 (0x80), value=512, index=0
USB_DT_CONFIG config
get_conf_no 0 Result 25, wLength 25
if 0, ep 0
##EP epmaxpacketin[1] = 8
set configuration 1
usb_control_msg: request: 0x9, requesttype: 0x0, value 0x1 index 0x0 length 0x0
ehci_submit_control_msg: dev='usb@15,0', udev=7f4ef080, udev->dev='usb@15,0', 
portnr=0
req=9 (0x9), type=0 (0x0), value=1, index=0
USB_REQ_SET_CONFIGURATION
Len is 0
new device strings: Mfr=1, Product=2, SerialNumber=0
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x300 index 0x0 length 
0xFF
ehci_submit_control_msg: dev='usb@15,0', udev=7f4ef080, udev->dev='usb@15,0', 
portnr=0
req=6 (0x6), type=128 (0x80), value=768, index=0
USB_DT_STRING config
USB device number 1 default language ID 0x1
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x301 index 0x1 length 
0xFF
ehci_submit_control_msg: dev='usb@15,0', udev=7f4ef080, udev->dev='usb@15,0', 
portnr=0
req=6 (0x6), type=128 (0x80), value=769, index=1
USB_DT_STRING config
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x302 index 0x1 length 
0xFF
ehci_submit_control_msg: dev='usb@15,0', udev=7f4ef080, udev->dev='usb@15,0', 
portnr=0
req=6 (0x6), type=128 (0x80), value=770, index=1
USB_DT_STRING config
Manufacturer u-boot
Product  EHCI Host Controller
SerialNumber 
read_descriptor for 'usb@15,0': ret=0
** usb_find_child returns -2
usb_find_and_bind_driver: Searching for driver
Bound device usb_hub to usb@15,0
usb_find_and_bind_driver: Match found: usb_hub
usb_scan_device: Probing 'usb_hub', plat=7f4f53c0
uclass_find_device_by_seq: 0 -1
uclass_find_device_by_seq: 0 0
   - -1 -1
   - not found
usb_hub_post_probe
usb_control_msg: request: 0x6, requesttype: 0xA0, value 0x2900 index 0x0 length 
0x4
ehci_submit_control_msg: dev='usb@15,0', udev=7f4f5400, udev->dev='usb_hub', 
portnr=0
req=6 (0x6), type=160 (0xa0), value=10496, index=0
USB_DT_HUB config
usb_control_msg: request: 0x6, requesttype: 0xA0, value 0x2900 index 0x0 length 
0x8
ehci_submit_control_msg: dev='usb@15,0', udev=7f4f5400, udev->dev='usb_hub', 
portnr=0
req=6 (0x6), type=160 (0xa0), value=10496, index=0
USB_DT_HUB config
0 ports detected


I wonder if this is caused by using ehci driver on xhci controller? And 
currently is there xhci controller
Driver for x86 based board?

Thanks a lot,
Chi
--
Intel Research and Development Ireland Limited
Registered in Ireland
Re

Re: [U-Boot] build error with CONFIG_DM_PCI disabled in menuconfig

2016-10-11 Thread Ding, ChiX

> -Original Message-
> From: Bin Meng [mailto:bmeng...@gmail.com]
> Sent: Tuesday, October 11, 2016 11:44 AM
> To: Ding, ChiX 
> Cc: Simon Glass ; u-boot@lists.denx.de
> Subject: Re: [U-Boot] build error with CONFIG_DM_PCI disabled in menuconfig
> 
> Hi Chi,
> 
> On Tue, Oct 11, 2016 at 6:01 PM, Ding, ChiX  wrote:
> > Hi Bin
> > Thanks for the reply. I'm working on Intel Denvernton Board.  As you
> > suggested I'm debugging it using DM PCI now. In the device tree file,
> > I define PCI as this, but I don't know what is missing so that AHCI isn't 
> > probed
> > pci {
> > compatible = "pci-x86";
> > #address-cells = <3>;
> > #size-cells = <2>;
> > u-boot,dm-pre-reloc;
> > };
> >
> > In coreboot.h, I define
> > #define CONFIG_SCSI_AHCI
> > #define CONFIG_SCSI
> >
> > #ifdef CONFIG_SCSI_AHCI
> > #define CONFIG_LIBATA
> > #define CONFIG_SYS_64BIT_LBA
> > #define CONFIG_SCSI_DEV_LIST{PCI_VENDOR_ID_INTEL, \
> > 0x19b2},  \
> > {PCI_VENDOR_ID_INTEL,   \
> > 0x19c2}
> >
> > U-Boot dm tree command shows pci isn't probed.
> > => dm tree
> >  Class   Probed   Name
> > 
> >  root[ + ]root_driver
> >  keyboard[ + ]|-- keyboard
> >  serial  [ + ]|-- serial
> >  rtc [   ]|-- rtc
> >  timer   [ + ]|-- tsc-timer
> >  pci [   ]`-- pci
> >
> >
> >
> > => dm uclass
> > uclass 0: root
> > - * root_driver @ 7f4e9040, seq 0, (req -1)
> >
> > uclass 9: simple_bus
> > uclass 11: ahci
> > uclass 12: blk
> > uclass 14: cpu
> > uclass 19: gpio
> > uclass 24: irq
> > uclass 25: keyboard
> > - * keyboard @ 7f4e90c8, seq 0, (req -1)
> >
> > uclass 27: lpc
> > uclass 34: northbridge
> > uclass 37: pch
> > uclass 38: pci
> > -   pci @ 7f4e92c0
> >
> > uclass 39: pci_generic
> > uclass 50: rtc
> > -   rtc @ 7f4e91d0
> >
> > uclass 51: serial
> > - * serial @ 7f4e9140, seq 0, (req -1)
> >
> > uclass 52: spi
> > uclass 54: spi_flash
> > uclass 55: spi_generic
> > uclass 56: syscon
> > uclass 59: timer
> > - * tsc-timer @ 7f4e9248, seq 0, (req -1)
> >
> > uclass 60: tpm
> >
> >
> > Thanks a lot,
> > Chi
> 
> Please do not top-posting.
> 
> The reason is that PCI is not probed so that AHCI driver is not probed too. 
> Can
> you please run pci command from U-Boot shell?
> 
> Regards,
> Bin

Hi Bin
Sorry that outlook does top-posting by default. I just changed it.
I ran "pci" command from U-Boot shell and it says no such bus.

=> pci  
No such bus 

Thanks,
Chi
--
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] build error with CONFIG_DM_PCI disabled in menuconfig

2016-10-11 Thread Ding, ChiX
Hi Bin
Thanks for the reply. I'm working on Intel Denvernton Board.  As you suggested 
I'm debugging it
using DM PCI now. In the device tree file, I define PCI as this, but I don't 
know what is missing so
that AHCI isn't probed
pci {
compatible = "pci-x86";
#address-cells = <3>;
#size-cells = <2>;
u-boot,dm-pre-reloc;
};

In coreboot.h, I define 
#define CONFIG_SCSI_AHCI
#define CONFIG_SCSI

#ifdef CONFIG_SCSI_AHCI
#define CONFIG_LIBATA
#define CONFIG_SYS_64BIT_LBA
#define CONFIG_SCSI_DEV_LIST{PCI_VENDOR_ID_INTEL, \
0x19b2},  \
{PCI_VENDOR_ID_INTEL,   \
0x19c2}

U-Boot dm tree command shows pci isn't probed.
=> dm tree  
 Class   Probed   Name  

 root[ + ]root_driver   
 keyboard[ + ]|-- keyboard  
 serial  [ + ]|-- serial
 rtc [   ]|-- rtc   
 timer   [ + ]|-- tsc-timer 
 pci [   ]`-- pci   



=> dm uclass
uclass 0: root  
- * root_driver @ 7f4e9040, seq 0, (req -1) 

uclass 9: simple_bus
uclass 11: ahci 
uclass 12: blk  
uclass 14: cpu  
uclass 19: gpio 
uclass 24: irq  
uclass 25: keyboard 
- * keyboard @ 7f4e90c8, seq 0, (req -1)

uclass 27: lpc  
uclass 34: northbridge  
uclass 37: pch  
uclass 38: pci  
-   pci @ 7f4e92c0  

uclass 39: pci_generic  
uclass 50: rtc  
-   rtc @ 7f4e91d0  

uclass 51: serial
- * serial @ 7f4e9140, seq 0, (req -1)  

uclass 52: spi  
uclass 54: spi_flash
uclass 55: spi_generic  
uclass 56: syscon   
uclass 59: timer
- * tsc-timer @ 7f4e9248, seq 0, (req -1)   

uclass 60: tpm  


Thanks a lot,
Chi   

-Original Message-
From: Bin Meng [mailto:bmeng...@gmail.com] 
Sent: Tuesday, October 11, 2016 2:44 AM
To: Ding, ChiX ; Simon Glass 
Cc: u-boot@lists.denx.de
Subject: Re: [U-Boot] build error with CONFIG_DM_PCI disabled in menuconfig

On Mon, Oct 10, 2016 at 11:47 PM, Ding, ChiX  wrote:
> Hi there
> I disabled CONFIG_DM_PCI in menuconfig because I have problem 
> detecting AHCI SCSI controller on X86 board with CONFIG_DM_PCI enabled and 
> the older code in drivers/pci/pci.c works for me in the previous U-boot 
> version.
> Then I got the build error :
> u-boot/arch/x86/cpu/irq.c:29: undefined reference to `dm_pci_read_config8'
> u-boot/arch/x86/cpu/irq.c:104: undefined reference to `dm_pci_get_bdf'
> u-boot/arch/x86/c

[U-Boot] build error with CONFIG_DM_PCI disabled in menuconfig

2016-10-10 Thread Ding, ChiX
Hi there
I disabled CONFIG_DM_PCI in menuconfig because I have problem detecting AHCI 
SCSI controller on X86 board
with CONFIG_DM_PCI enabled and the older code in drivers/pci/pci.c works for me 
in the previous U-boot version.
Then I got the build error :
u-boot/arch/x86/cpu/irq.c:29: undefined reference to `dm_pci_read_config8'
u-boot/arch/x86/cpu/irq.c:104: undefined reference to `dm_pci_get_bdf'
u-boot/arch/x86/cpu/irq.c:147: undefined reference to `dm_pci_read_config32'
u-boot/arch/x86/cpu/pci.c:69: undefined reference to `pci_read_config16'
u-boot/arch/x86/cpu/pci.c:73: undefined reference to `pci_read_config8'
u-boot/arch/x86/cpu/pci.c:86: undefined reference to `pci_write_config8'
u-boot/arch/x86/lib/bios_interrupts.c:137: undefined reference to 
`dm_pci_find_device'
u-boot/arch/x86/lib/bios_interrupts.c:141: undefined reference to 
`dm_pci_get_bdf'

It seems that the code refers to the DM_PCI code regardless if  CONFIG_DM_PCI 
is enabled or not.
Is it ok to build U-boot with CONFIG_DM_PCI disabled or  did I miss anything?

Thanks a lot,
Chi
--
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] AHCI controller not found

2016-10-10 Thread Ding, ChiX
Hi there
I'm testing U-boot as Coreboot payload on Intel board. It boots into U-boot 
shell but fails to detect AHCI controller.
SCSI:  Error: SCSI Controller(s) 8086:19B2 8086:19C2 not found

AHCI SCSI devices are defined in coreboot.h,
#define CONFIG_SCSI_AHCI
#define CONFIG_SCSI_DEV_LIST{PCI_VENDOR_ID_INTEL, \
0x19b2},  \
{PCI_VENDOR_ID_INTEL,   \
0x19c2}

I debug into scsi_init(void). It goes through a loop to try to find PCI device 
for  the AHCI controllers defined above in coreboot.h .
I tried the new code "enable driver mode for PCI" and the old code using 
pci_find_device() function, but both fail to find the devices.

#ifdef CONFIG_DM_PCI
struct udevice *dev;
int ret;

ret = dm_pci_find_device(scsi_device_list[i].vendor,
 scsi_device_list[i].device, 0, &dev);
if (!ret) {
busdevfunc = dm_pci_get_bdf(dev);
break;
}
#else
busdevfunc = pci_find_device(scsi_device_list[i].vendor,
 scsi_device_list[i].device,
 0);
#endif


My device tree file below is a barebone which only defines serial port, 
keyboard, timer. They work fine.
I wonder that in order to find AHCI controller, shall I add some definition for 
PCI device into the device tree file?
What's the minimum definition shall I add?

/include/ "skeleton.dtsi"
/include/ "keyboard.dtsi"
/include/ "serial.dtsi"
/include/ "rtc.dtsi"
/include/ "tsc_timer.dtsi"

/ {
#address-cells = <1>;
#size-cells = <1>;
model = "Google Alex";
compatible = "google,alex", "intel,atom-pineview";

config {
   silent_console = <0>;
};

gpio: gpio {};

serial {
reg = <0x1000 8>;
clock-frequency = <115200>;
};

tsc-timer {
clock-frequency = <10>;
};

chosen {
stdout-path = "/serial";
};

memory { device_type = "memory"; reg = <0 0>; };

};


Thanks a lot,
Chi
--
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] remote debug u-boot through serial port

2016-08-23 Thread Ding, ChiX
My target board is based on i386 architecture.
After I enable CONFIG_CMD_KGDB in the board config file, during building  it 
reports link error :
undefined reference to `kgdb_longjmp'

I checked the directory, only found the function definition for powerpc, but no 
definition for x86
arch/powerpc/lib/kgdb.c:kgdb_longjmp(long *buf, int val)

Does it mean that if I want to enable debugging u-boot through serial port on 
x86 , then I need to
copy/port the implementation of kgdb.c to u-boot, enable it and build it?

Thanks,
Chi


From: Ding, ChiX
Sent: Tuesday, August 23, 2016 3:25 PM
To: 'u-boot@lists.denx.de' 
Subject: remote debug u-boot through serial port

Hi there
I'm learning how to remote debug u-boot through serial port.
In menuconfig general setup, I selected "enable debug information for tools".
It adds -g in gcc flag. After built is over, I got u-boot, u-boot.sym, 
u-boot.map and a few other files.
When I run objdump -trS u-boot, it does show the source code and the symbols.

However in gdb, when I tried to load the ELF executable file,  I got this error
(gdb) file u-boot
Reading symbols from u-boot...BFD: 
/root/work/cid_iafw_opensource-coreboot/payloads/external/U-Boot/u-boot/u-boot: 
attempt to load strings from a non-string section (number 0)
BFD: 
/root/work/cid_iafw_opensource-coreboot/payloads/external/U-Boot/u-boot/u-boot: 
attempt to load strings from a non-string section (number 0)

Anything I missed and caused this issue?
Also I wonder if I want to enable remote debugging of u-boot through serial 
port, what shall I do in the configuration?
I didn't see such option in menuconfig.  Is it enabled by default or shall I 
enable CONFIG_CMD_KGDB in my board config file ?

Thanks,
Chi


--
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] remote debug u-boot through serial port

2016-08-23 Thread Ding, ChiX
Hi there
I'm learning how to remote debug u-boot through serial port.
In menuconfig general setup, I selected "enable debug information for tools".
It adds -g in gcc flag. After built is over, I got u-boot, u-boot.sym, 
u-boot.map and a few other files.
When I run objdump -trS u-boot, it does show the source code and the symbols.

However in gdb, when I tried to load the ELF executable file,  I got this error
(gdb) file u-boot
Reading symbols from u-boot...BFD: 
/root/work/cid_iafw_opensource-coreboot/payloads/external/U-Boot/u-boot/u-boot: 
attempt to load strings from a non-string section (number 0)
BFD: 
/root/work/cid_iafw_opensource-coreboot/payloads/external/U-Boot/u-boot/u-boot: 
attempt to load strings from a non-string section (number 0)

Anything I missed and caused this issue?
Also I wonder if I want to enable remote debugging of u-boot through serial 
port, what shall I do in the configuration?
I didn't see such option in menuconfig.  Is it enabled by default or shall I 
enable CONFIG_CMD_KGDB in my board config file ?

Thanks,
Chi


--
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] building u-boot x86 with device tree disabled , still refers to device tree function

2016-08-17 Thread Ding, ChiX
Hi Bin
Thanks for the reply.
I'm building for Intel Harrisonville board with Denverton chipset.

Cheers,
Chi

-Original Message-
From: Bin Meng [mailto:bmeng...@gmail.com] 
Sent: Friday, August 12, 2016 5:12 AM
To: Ding, ChiX ; Simon Glass 
Cc: u-boot@lists.denx.de
Subject: Re: [U-Boot] building u-boot x86 with device tree disabled , still 
refers to device tree function

Hi,

On Thu, Aug 11, 2016 at 10:36 PM, Ding, ChiX  wrote:
> Hi there
> I'm building u-boot as payload for x86 platform. I didn't enable 
> device tree in menuconfig (CONFIG_OF_CONTROL is not set) because I use 
> a board config file coreboot.h. When I built u-boot, it reports error 
> during linking stage : undefined reference to dm_scan_fdt_dev
>

Which board are you building?

> arch/x86/lib/built-in.o:(.u_boot_list_2_uclass_2_lpc+0x8): undefined 
> reference to `dm_scan_fdt_dev'
> common/built-in.o:(.u_boot_list_2_uclass_2_usb_hub+0x8): undefined reference 
> to `dm_scan_fdt_dev'
> drivers/built-in.o:(.u_boot_list_2_uclass_2_pch+0x8): undefined reference to 
> `dm_scan_fdt_dev'
> drivers/pci/built-in.o:(.u_boot_list_2_uclass_2_pci+0x8): undefined reference 
> to `dm_scan_fdt_dev'
> drivers/spi/built-in.o:(.u_boot_list_2_uclass_2_spi+0x8): undefined reference 
> to `dm_scan_fdt_dev'
> drivers/usb/host/built-in.o:(.u_boot_list_2_uclass_2_usb+0x8): more 
> undefined references to `dm_scan_fdt_dev' follow
> Makefile:1189: recipe for target 'u-boot' failed
>
> I looked at the code and see arch/x86/lib/lpc-uclass.c refers to a 
> function "dm_scan_fdt_dev " which is defined in drivers/core/root.c 
> and it looks like a device tree function
>
>
> UCLASS_DRIVER(lpc) = {
> .id = UCLASS_LPC,
> .name   = "lpc",
> .post_bind  = dm_scan_fdt_dev,
> };
>
> Because device tree isn't enabled, the function isn't compiled and causes the 
> problem while linking.
> It's only compiled when the following is true #if 
> CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) If I 
> comment out the line, it would compile and build. But I'm not sure if it's 
> the right way to do it.
>
> Is it normal behavior? I thought that when not enabling device tree, the code 
> shouldn't use device tree function?
> Can anyone help on this please?
>

Please refer to README.x86 for how to build U-Boot as the coreboot payload.

Regards,
Bin
--
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] building u-boot x86 with device tree disabled , still refers to device tree function

2016-08-17 Thread Ding, ChiX
Hi Simon
We have an older version u-boot code that is built without device tree.
It works fine as coreboot payload on the target board with Denverton chipset.
With the current u-boot code from git://git.denx.de/u-boot.git, I run 
coreboot-x86_defconfig,
then make menuconfig, and by default qemu-x86 is the target board. I use device 
tree in the
beginning which is enalbed by default, but I didn't see the dts file for my 
target board.
Since I'm new to the bootloader world, I 'm not sure how to define it correctly 
for my target board. 
I did experiments of the dst file and menuconfig to use it, but the built 
u-boot file doesn't work
properly as Coreboot payload when booting : it gets stuck when jumping into 
u-boot from coreboot.

Jumping to boot code at 01110020(7f6ea000)
CPU0: stack: 0012d000 - 0012e000, lowest used address 0012d9cc, stack used: 
1588 bytes
entry= 0x01110020
lb_start = 0x0010
lb_size  = 0x00036870
buffer   = 0x7f67c000

After that I tried to use the board configure file instead (taken from my older 
version u-boot code) of device tree, therefore I disabled device tree in 
menuconfig. That's how my question comes from.

I also tried to make u-boot work as payload of coreboot on qemu-x86.
I ran make dist clean, make coreboot-x86_defconfig and built uboot using the 
default menuconfig setting of device tree enabled, and embedded
Then I built coreboot using u-boot as ELF payload. Somehow when I run it with 
qemu-86, it crashes inside uboot :


[root@localhost cid_iafw_opensource-coreboot]# qemu-system-x86_64 --nographic 
-bios build/coreboot.rom 


U-Boot 2016.09-rc1-00324-g2863a9b-dirty (Aug 12 2016 - 11:13:50 +0100)

CPU: x86_64, vendor AMD, device 663h
DRAM:  127.6 MiB
Using default environment

Video: No video mode configured in coreboot!
Model: QEMU x86 (I440FX)
Net:   General Protection
EIP: 0010:[<07f1440a>] EFLAGS: 0002
Original EIP :[<0111040a>]
EAX: 0002 EBX: 07d15668 ECX: 0001 EDX: c002
ESI: 0041 EDI: 00c8 EBP: 00010001 ESP: 07d129d4
DS: 0018 ES: 0018 FS: 0020 GS: 0018 SS: 0018
CR0: 0033 CR2:  CR3:  CR4: 
DR0:  DR1:  DR2:  DR3: 
DR6: 0ff0 DR7: 0400
Stack:
   0x07d12a14 : 0x0001
0x07d12a10 : 0x
0x07d12a0c : 0x07d15668
0x07d12a08 : 0x
0x07d12a04 : 0x159dc191
0x07d12a00 : 0x
0x07d129fc : 0x
0x07d129f8 : 0x1800
0x07d129f4 : 0x0001
0x07d129f0 : 0x07d12a5c
0x07d129ec : 0x07f35f29
0x07d129e8 : 0x07d15668
0x07d129e4 : 0x0001
0x07d129e0 : 0x0001
0x07d129dc : 0x0202
0x07d129d8 : 0x0010
--->0x07d129d4 : 0x07f35efc
0x07d129d0 : 0x0002
0x07d129cc : 0x0010
0x07d129c8 : 0x07f1440a
### ERROR ### Please RESET the board ###

When looking at the code, I see it crashes here
/* IRQ Low-Level Service Routine */
void irq_llsr(struct irq_regs *regs)
{
/*
 * For detailed description of each exception, refer to:
 * IntelĀ® 64 and IA-32 Architectures Software Developer's Manual
 * Volume 1: Basic Architecture
 * Order Number: 253665-029US, November 2008
 * Table 6-1. Exceptions and Interrupts
 */
if (regs->irq_id < 32) {
/* Architecture defined exception */
do_exception(regs);

Any suggestion on this issue?

Thanks a lot,
Chi



 

-Original Message-
From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass
Sent: Friday, August 12, 2016 7:21 PM
To: Ding, ChiX
Cc: u-boot@lists.denx.de; Bin Meng
Subject: Re: [U-Boot] building u-boot x86 with device tree disabled , still 
refers to device tree function

+Bin

Hi,



On 11 August 2016 at 08:36, Ding, ChiX  wrote:
> Hi there
> I'm building u-boot as payload for x86 platform. I didn't enable 
> device tree in menuconfig (CONFIG_OF_CONTROL is not set) because I use 
> a board config file coreboot.h. When I built u-boot, it reports error 
> during linking stage : undefined reference to dm_scan_fdt_dev
>
> arch/x86/lib/built-in.o:(.u_boot_list_2_uclass_2_lpc+0x8): undefined 
> reference to `dm_scan_fdt_dev'
> common/built-in.o:(.u_boot_list_2_uclass_2_usb_hub+0x8): undefined reference 
> to `dm_scan_fdt_dev'
> drivers/built-in.o:(.u_boot_list_2_uclass_2_pch+0x8): undefined reference to 
> `dm_scan_fdt_dev'
> drivers/pci/built-in.o:(.u_boot_list_2_uclass_2_pci+0x8): undefined reference 
> to `dm_scan_fdt_dev'
> drivers/spi/built-in.o:(.u_boot_list_2_uclass_2_spi+0x8): undefined reference 
> to `dm_scan_fdt_dev'
> drivers/usb/host/built-in.o:(.u_boot_list_2_uclass_2_usb+0x8): more 
> undefined references to `dm_scan_fdt_dev' follow
> Makefile:1189: recipe for target 'u-boot' failed
>
> I looked at the code and see arch/x86/lib/lpc-uclass.c refer

[U-Boot] building u-boot x86 with device tree disabled , still refers to device tree function

2016-08-11 Thread Ding, ChiX
Hi there
I'm building u-boot as payload for x86 platform. I didn't enable device tree in 
menuconfig (CONFIG_OF_CONTROL is not set) because I use a board config file 
coreboot.h. When I built u-boot, it reports error during linking stage : 
undefined reference to dm_scan_fdt_dev

arch/x86/lib/built-in.o:(.u_boot_list_2_uclass_2_lpc+0x8): undefined reference 
to `dm_scan_fdt_dev'
common/built-in.o:(.u_boot_list_2_uclass_2_usb_hub+0x8): undefined reference to 
`dm_scan_fdt_dev'
drivers/built-in.o:(.u_boot_list_2_uclass_2_pch+0x8): undefined reference to 
`dm_scan_fdt_dev'
drivers/pci/built-in.o:(.u_boot_list_2_uclass_2_pci+0x8): undefined reference 
to `dm_scan_fdt_dev'
drivers/spi/built-in.o:(.u_boot_list_2_uclass_2_spi+0x8): undefined reference 
to `dm_scan_fdt_dev'
drivers/usb/host/built-in.o:(.u_boot_list_2_uclass_2_usb+0x8): more undefined 
references to `dm_scan_fdt_dev' follow
Makefile:1189: recipe for target 'u-boot' failed

I looked at the code and see arch/x86/lib/lpc-uclass.c refers to a function 
"dm_scan_fdt_dev " which is defined in drivers/core/root.c and it looks like a 
device tree function


UCLASS_DRIVER(lpc) = {
.id = UCLASS_LPC,
.name   = "lpc",
.post_bind  = dm_scan_fdt_dev,
};

Because device tree isn't enabled, the function isn't compiled and causes the 
problem while linking.
It's only compiled when the following is true
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
If I comment out the line, it would compile and build. But I'm not sure if it's 
the right way to do it.

Is it normal behavior? I thought that when not enabling device tree, the code 
shouldn't use device tree function?
Can anyone help on this please?


Thanks alot,
Chi


--
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot