Altera_Forum
Honored Contributor
13 years agosopc2dts: cfi-flash & usb isp1362-hcd
Hey nios2-community,
I want to update my kernel from version 2.6.35 to version 3.3, but i have some problems integrating cfi-flash and usb. I'm working with a custom board similar to the neek-board and IP-Cores from Altera (mostly). Furthermore i'm using the neat tool: sopc2dts, which is a great help, but i'm not sure if i made some mistakes regarding the configuration of the device-tree. 1) cfi-flash: Everytime i use flashcp or ioctls accessing the otp-register my system freezes. Nevertheless i can create a jffs2-filesystem on my older build and use that on my new build. So i can mount the jffs2 on kernel 3.3 and make everything with the files on it. The system just hangs when i access the flash directly over the flash-utilities and/or ioctls. (the ioctl is changing the mode of cfi-flash to MTD_OTP_FACTORY) I generated my device-tree with sopc2dts and the configuration regarding the cfi-flash seems to be just right. This is the entry about cfi-flash:
cfi_flash: flash@0x4000000 {
compatible = "ALTR,cfi_flash-9.0", "cfi-flash";
reg = < 0x04000000 0x02000000 >;
bank-width = < 2 >;
device-width = < 1 >;
# address-cells = < 1 >;
# size-cells = < 1 >;
Linux-Kernel@0 {
reg = < 0x00000000 0x00800000 >;
}; //end Linux-Kernel@0
filesystem@1000000 {
reg = < 0x01000000 0x01000000 >;
}; //end filesystem@1000000
}; //end flash@0x4000000 (cfi_flash)My kernel-configuration is: -> MTD (x) -> MTD_OF_PARTS (x) -> CONFIG_MTD_CHAR (x) -> MTD_BLOCK (x) -> RAM/ROM/Flash chip drivers -> MTD_CFI (x) -> MTD_CFI_ADV_OPTIONS (x) -> MTD_OTP (x) -> MTD_CFI_INTELEXT (x) -> Mapping drivers for chip access -> CONFIG_MTD_PHYSMAP_OF (x) -> BLK_DEV (x) 2) My USB-device isn't working anymore. It fails when checking the clkrdy signal at isp1362-hcd.c. This is really weird, because everything that was in the header-file nios2 in my older build is also in the device-tree. Here is the entry in my device-tree:
isp1362_usb_controller: usb@0xa80 {
compatible = "nxp,isp1362-1.0", "nxp,usb-isp1362";
reg = < 0x00000A80 0x00000008
0x00000B28 0x00000001 >;
interrupt-parent = < &cpu_linux >;
interrupts = < 10 11 >;
}; //end usb@0xa80 (isp1362_usb_controller)I just added "nxp,usb-isp1362" to the compatible string. I think this has to happen otherwise uClinux can't load any driver at all. Btw here is the code snippet from the clkrdy check in isp1362-hcd.c:
/* chip has been reset. First we need to see a clock */
t = jiffies + msecs_to_jiffies(timeout);
while (!clkrdy && time_before_eq(jiffies, t)) {
spin_lock_irqsave(&isp1362_hcd->lock, flags);
clkrdy = isp1362_read_reg16(isp1362_hcd, HCuPINT) & HCuPINT_CLKRDY;
spin_unlock_irqrestore(&isp1362_hcd->lock, flags);
if (!clkrdy)
msleep(4);
}
spin_lock_irqsave(&isp1362_hcd->lock, flags);
isp1362_write_reg16(isp1362_hcd, HCuPINT, HCuPINT_CLKRDY);
spin_unlock_irqrestore(&isp1362_hcd->lock, flags);
if (!clkrdy) {
pr_err("Clock not ready after %lums\n", timeout);
ret = -ENODEV;
}
return ret;What am I missing here? I guess something is wrong with my device-tree but I checked a lot of entries in your newslist. I don't know what could be wrong here, so any help would be great. For information purpose I attached our sopcinfo file. Thanks in advance. kind regards, Tobias Biehl