AnsweredAssumed Answered

gpio-addr-flash: probe of gpio-addr-flash.0 failed with error -22

Question asked by jkadin on Feb 20, 2014
Latest reply on Feb 24, 2014 by jkadin

Please bear with me I am new to the Blackfin and uCLinux but have dove in head first because I am taking over an existing project.  Lucky me.


I was able to get the gpio assisted flash working well in u-boot. erase, protect, and flread all work perfectly, cp works well writing to flash, but can't toggle the gpio when reading the flash, but flread takes care of that.


I think I am doing everything correctly, but you know how one little mistake can cause issues, I am usually pretty good at fixing this stuff, but this one has me asking for help,


Below is my MTD partition setup.  I have the Kernel options for GPIO Addressing setup and added in a coding error to make sure  the partitioning I made below is being compiled.



static struct mtd_partition ezbrd_partitions[] = {


        .name       = "bootloader(nor)",

        .size       = 0x50000,

        .offset     = 0,

    }, {

        .name       = "linux kernel(nor)",

        .size       = 0x760000,            // 0x1C0000 - org

        .offset     = MTDPART_OFS_APPEND,

    }, {

        .name       = "file system(nor)",

        .size       = MTDPART_SIZ_FULL,

        .offset     = MTDPART_OFS_APPEND,




static struct physmap_flash_data ezbrd_flash_data = {

    .width      = 2,                // 16 bit

    .parts      = ezbrd_partitions,

    .nr_parts   = ARRAY_SIZE(ezbrd_partitions),



static unsigned ezbrd_flash_gpios[] = { GPIO_PG9 };


static struct resource ezbrd_flash_resource[] = {


        /*.name  = "cfi_probe",*/

        .start = 0x20000000,

        .end   = 0x207fffff,

        .flags = IORESOURCE_MEM,

    }, {

        .start = (unsigned long)ezbrd_flash_gpios,

        .end   = ARRAY_SIZE(ezbrd_flash_gpios),

        .flags = IORESOURCE_IRQ,





static struct platform_device ezbrd_flash_device = {

    .name          = "gpio-addr-flash",

    .id            = 0,

    .dev = {

        .platform_data = &ezbrd_flash_data,


    .num_resources = 1,

    .resource      = &ezbrd_flash_resource,


#else //GPIO Assist


I get the probe error and no partitioning happens and no mtd's are created.

gpio-addr-flash: probe of gpio-addr-flash.0 failed with error -22

I searched like crazy for error -22 and cant find it so that is why I am asking for help.


Thanks in advance.



U-Boot 2011.09 (ADI-2011R1) (Feb 20 2014 - 06:34:10)


CPU:   ADSP bf526-0.2 (Detected Rev: 0.2) (parallel flash boot)

Board: ADI BF526 ML Ctrl-Board board


Clock: VCO: 400 MHz, Core: 400 MHz, System: 100 MHz

RAM:   32 MiB

Flash: 8 MiB

In:    serial

Out:   serial

Err:   serial

KGDB:  [on serial] ready

EUP STBY: gpio: PG11 (27) set to 1

CPLD Reset: gpio: PG0 (16) set to 1 - 0 - 1

Net:   bfin_mac

Hit any key to stop autoboot:  0


..... done

Protected 5 sectors

## Booting kernel from Legacy Image at 01000000 ...

   Image Name:   bf527-

   Created:      2014-02-20  19:24:59 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    3605659 Bytes = 3.4 MiB

   Load Address: 00001000

   Entry Point:  0026e680

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

Starting Kernel at = 0026e680

console [ttyBF0] enabled, bootconsole disabled

Calibrating delay loop... 796.67 BogoMIPS (lpj=1593344)

Mount-cache hash table entries: 512

Blackfin Scratchpad data SRAM: 4 KB

Blackfin L1 Data A SRAM: 16 KB (16 KB free)

Blackfin L1 Data B SRAM: 16 KB (16 KB free)

Blackfin L1 Instruction SRAM: 48 KB (42 KB free)

NET: Registered protocol family 16

Blackfin DMA Controller

ezbrd_init(): registering device resources

bio: create slab <bio-0> at 0

SCSI subsystem initialized

spi spi0.5: Warning: SPI CPHA not set: Slave Select not under software control!

See Documentation/blackfin/bfin-spi-notes.txt

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@7

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller, regs_base@ffc01400

musb_hdrc: version 6.0, musb-dma, host, debug=0

musb_hdrc musb_hdrc.0: MUSB HDRC host driver

musb_hdrc musb_hdrc.0: new USB bus registered, assigned bus number 1

usb usb1: New USB device found, idVendor=1d6b, idProduct=0002

usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1

usb usb1: Product: MUSB HDRC host driver

usb usb1: Manufacturer: Linux musb-hcd

usb usb1: SerialNumber: musb_hdrc.0

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 1 port detected

musb_hdrc musb_hdrc.0: USB Host mode controller at ffc03800 using DMA, IRQ 59

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 1024 (order: 1, 8192 bytes)

TCP bind hash table entries: 1024 (order: 0, 4096 bytes)

TCP: Hash tables configured (established 1024 bind 1024)

TCP reno registered

UDP hash table entries: 256 (order: 0, 4096 bytes)

UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

NET: Registered protocol family 1

NTFS driver 2.1.29 [Flags: R/W DEBUG].

JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.

JFFS2: default compression mode: priority

msgmni has been set to 48

io scheduler noop registered (default)

bfin-otp: initialized

bfin-uart: Blackfin serial driver

bfin-uart.0: ttyBF0 at MMIO 0xffc00400 (irq = 29) is a BFIN-UART

bfin-uart.1: ttyBF1 at MMIO 0xffc02000 (irq = 31) is a BFIN-UART

brd: module loaded

GPIO_PG10 granted

GPIO_PG10 Direction set as input

bfin-gpio: GPIO 26 is already reserved by BFIN-GPIO! (Documentation/blackfin/bfin-gpio-notes.txt)

IRQ for FP_HOST or GPIO_PG10 registered

GPIO_PG5 granted

GPIO_PG5 Direction set as input

bfin-gpio: GPIO 21 is already reserved by BFIN-GPIO! (Documentation/blackfin/bfin-gpio-notes.txt)

IRQ for CPLD_CPU or GPIO_PG5 registered

ml52_irq: gpio_request() - GPIO_PH10 - TrigIn success

ml52_irq: gpio_direction_input() - GPIO_PH10 - TrigIn success

bfin-gpio: GPIO 42 is already reserved by BFIN-GPIO! (Documentation/blackfin/bfin-gpio-notes.txt)

ml52_irq: request_irq() - GPIO_PH10 - TrigIn success

gpio-addr-flash: probe of gpio-addr-flash.0 failed with error -22

bfin_mii_bus: probed

bfin_mac: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=19)@sclk=100MHz)

bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

TCP cubic registered

NET: Registered protocol family 17

dma_alloc_init: dma_page @ 0x016ad000 - 256 pages at 0x01f00000