OMAP multiplexing support kernel panic

Hello

I want to enable SPI on my beagleboard and following these steps:

1. Add Pin Muxes in u-boot, using the following patch:

--- a/board/omap3/beagle/beagle.h 2009-06-14 21:30:39.000000000 +0200
+++ b/board/omap3/beagle/beagle.h 2009-07-07 10:47:29.000000000 +0200
@@ -201,12 +201,12 @@
  MUX_VAL(CP(MMC1_DAT6), (IEN | PTU | EN | M0)) /*MMC1_DAT6*/\
  MUX_VAL(CP(MMC1_DAT7), (IEN | PTU | EN | M0)) /*MMC1_DAT7*/\
  /*Wireless LAN */\
- MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M4)) /*GPIO_130*/\
- MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M4)) /*GPIO_131*/\
- MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M4)) /*GPIO_132*/\
+ MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M1)) /*MCSPI3_CLK*/\
+ MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M1)) /*MCSPI3_SIMO*/\
+ MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M1)) /*MCSPI3_SOMI*/\
  MUX_VAL(CP(MMC2_DAT1), (IEN | PTU | EN | M4)) /*GPIO_133*/\
- MUX_VAL(CP(MMC2_DAT2), (IEN | PTU | EN | M4)) /*GPIO_134*/\
- MUX_VAL(CP(MMC2_DAT3), (IEN | PTU | EN | M4)) /*GPIO_135*/\
+ MUX_VAL(CP(MMC2_DAT2), (IEN | PTU | EN | M1)) /*MCSPI3_CS1*/\
+ MUX_VAL(CP(MMC2_DAT3), (IEN | PTU | EN | M1)) /*MCSPI3_CS0*/\
  MUX_VAL(CP(MMC2_DAT4), (IEN | PTU | EN | M4)) /*GPIO_136*/\
  MUX_VAL(CP(MMC2_DAT5), (IEN | PTU | EN | M4)) /*GPIO_137*/\
  MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M4)) /*GPIO_138*/\
@@ -229,12 +229,12 @@
  MUX_VAL(CP(MCBSP4_DR), (IEN | PTD | DIS | M1)) /*SSI1_FLAG_RX*/\
  MUX_VAL(CP(MCBSP4_DX), (IEN | PTD | DIS | M1)) /*SSI1_RDY_RX*/\
  MUX_VAL(CP(MCBSP4_FSX), (IEN | PTD | DIS | M1)) /*SSI1_WAKE*/\
- MUX_VAL(CP(MCBSP1_CLKR), (IDIS | PTD | DIS | M4)) /*GPIO_156*/\
+ MUX_VAL(CP(MCBSP1_CLKR), (IDIS | PTD | DIS | M1)) /*MCSPI4_CLK*/\
  MUX_VAL(CP(MCBSP1_FSR), (IDIS | PTU | EN | M4)) /*GPIO_157*/\
- MUX_VAL(CP(MCBSP1_DX), (IDIS | PTD | DIS | M4)) /*GPIO_158*/\
- MUX_VAL(CP(MCBSP1_DR), (IDIS | PTD | DIS | M4)) /*GPIO_159*/\
+ MUX_VAL(CP(MCBSP1_DX), (IDIS | PTD | DIS | M1)) /*MCSPI4_SIMO*/\
+ MUX_VAL(CP(MCBSP1_DR), (IDIS | PTD | EN | M1)) /*MCSPI4_SOMI*/\
  MUX_VAL(CP(MCBSP_CLKS), (IEN | PTU | DIS | M0)) /*McBSP_CLKS*/\
- MUX_VAL(CP(MCBSP1_FSX), (IDIS | PTD | DIS | M4)) /*GPIO_161*/\
+ MUX_VAL(CP(MCBSP1_FSX), (IDIS | PTD | DIS | M1)) /*MCSPI4_SC0*/\
  MUX_VAL(CP(MCBSP1_CLKX), (IDIS | PTD | DIS | M4)) /*GPIO_162*/\
  /*Serial Interface*/\
  MUX_VAL(CP(UART3_CTS_RCTX), (IEN | PTD | EN | M0)) /
*UART3_CTS_RCTX*/\

After that, I applied the first patch in this post
http://groups.google.com/group/beagleboard/browse_thread/thread/42988f0e14db0f01/df889508056f7cbd?lnk=gst&q=mcspi3#df889508056f7cbd,
(linux kernel sources affected files only). After that I enabled in my
2.6.29 kernel support for OMAP multiplexing, McSPI driver for OMAP24xx/
OMAP34xx and User mode SPI device driver support.
After compiling the kernel and u-boot, placing them on my SD, booting
from new u-boot, I get the following kernel panic:

[ 115.760345] Waiting for root device /dev/
mmcblk0p2...
[ 115.787933] mmc0: new high speed SDHC card at address
0002
[ 115.794097] mmcblk0: mmc0:0002 SD4GB 3.76 GiB
(ro)
[ 115.799224] mmcblk0: p1
p2
[ 115.874176] VFS: Cannot open root device "mmcblk0p2" or unknown-
block(179,2)
[ 115.881256] Please append a correct "root=" boot option; here are
the availa:
[ 115.889739] 1f00 512 mtdblock0
(driver?)
[ 115.894744] 1f01 1920 mtdblock1
(driver?)
[ 115.899810] 1f02 128 mtdblock2
(driver?)
[ 115.904815] 1f03 4096 mtdblock3
(driver?)
[ 115.909851] 1f04 255488 mtdblock4
(driver?)
[ 115.914886] b300 3948544 mmcblk0 driver:
mmcblk
[ 115.920135] b301 56416
mmcblk0p1
[ 115.924468] b302 3890880
mmcblk0p2
[ 115.928802] Kernel panic - not syncing: VFS: Unable to mount root
fs on unkn)

Disabling OMAP Multiplexing does not produce the kernel panic, but /
dev/mcspix.x files do not exist...
My bootargs: console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootwait
rootfstype=ext3

Any ideas for this problem?
Thanks!

I've found that removing the line:

omap_cfg_reg(AH8_34XX_GPIO29);

in beagle_twl_gpio_setup function (board-omap3beagle.c) solves the
problem.
Any ideas why does this happen?

Thanks!

I've been looking in mux.c source file (arch/arm/mach-omap2/mux.c) and
found that

MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5f8,
    OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)

Should have the address 0x5f8 (according to OMAP35x SCM, page 37).
GPIO29 is used in Beagle to detect MMC write protect.

I've changed that, rebuild and then everything works.

Do you think that it could be the problem?

Thanks.

Solved by not using OMAP Multiplexing support, U-Boot multiplexing method works better by now.

Thanks anyway!

gerard_mp,

I had the same problem as you. I've done for your advice and changed
the value of

MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
                OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)

to

MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5f8,
                OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)

The system boots up properly now, but stopped working USB controller -
does not detect mouse and keyboard. You had such a problem?

Did you solved your problem?

I'm with the same error =\