This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

can't read back pin mux settings

Other Parts Discussed in Thread: TMS320DM8148

I've got a TMS320DM8148 chip and I'm running the u-boot that came with the dm814x evm. I'm trying to set a pin mux value for a very specific pin, GPIO1[13]. The mux control register for this pin is called PINCNTL107 with reset value 0x00040000 at address 0x481409A8. I put the following line into u-boot.min:

/*
 * baord specific muxing of pins
 */
void set_muxconf_regs(void)
{
    u32 i, add, val;
    u32 pad_conf[] = {
#include "mux.h"
    };

    for (i = 0; i<N_PINS; i++)
    {
        add = PIN_CTRL_BASE + (i*4);
        val = __raw_readl(add);
        val |= pad_conf[i];
        __raw_writel(val, add);
    }
    /* MMC/SD pull-down enable */
    __raw_writel(0x000C0040, 0x48140928);

    __raw_writel(0x00040080, 0x481409A8);
}

and stopped the boot process in the u-boot min prompt and issued the following command

TI-MIN#md.l 0x481409a8
481409a8: 00000001 00000001 00020001 00000001    ................
481409b8: 00020001 00000001 00060001 00060001    ................
481409c8: 00060001 00020080 00020002 00020002    ................
481409d8: 00020002 00020002 00060001 00020001    ................
481409e8: 00000002 00020002 00060080 00060002    ................
481409f8: 00060081 00010001 00020001 00020001    ................
48140a08: 00010001 00010081 00060001 00040020    ............ ...
48140a18: 000e0001 000e0001 000c0001 000e0001    ................
48140a28: 000e0001 000c0001 000c0001 000c0001    ................
48140a38: 000c0001 000c0001 000c0001 000c0001    ................
48140a48: 000c0001 000c0001 000c0001 000c0001    ................
48140a58: 000c0001 00040001 000c0001 000c0001    ................
48140a68: 000c0001 000e0001 000c0001 000e0001    ................
48140a78: 000e0001 000c0001 00040001 00040001    ................
48140a88: 00040001 00060001 00060001 00060001    ................
48140a98: 00060001 00020010 00000010 00000010    ................
TI-MIN#

Notice that the value at 0x481409A8 is 1...ignoring the fact that I put in a line to write in the value 0x000400800 the value 1 doesn't even make sense because the spec says that for every PINCTL register the 18th bit must always be 1. some of the extra values printed above make sense, but not the one I care about.

I started looking into this because I can only control GPIO pins connected to bank 0, and not banks 1,2 and 3. Calling 'md.l 0x481409A8 1' crashes u-boot, but the linux kernel and u-boot stage 2 both report a value of 1 in that register.

thanks,

-Chris

  • Hi Chris,

    This portion of the code remodifying the pinmux register back to MODE1

    nor_pad_config_mux() and "{GPMC_A18, MODE(1)},"

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!

  • hi Chris,

    You can select the GPIO1_13 signal in the kernel: ${EZSDK}/board-support/linux-2.6.37-xxx/arch/arm/mach-omap2/board-ti8148evm.c

    #ifdef CONFIG_OMAP_MUX
    static struct omap_board_mux board_mux[] __initdata = {
              TI814X_MUX(GPMC_A18, OMAP_MUX_MODE7),
              { .reg_offset = OMAP_MUX_TERMINATOR },
    };

    Thus the PINCNTL107 register will have the value of 0x00000080.

    There are other ways to modify the pin mux settings, see ${EZSDK}/board-support/docs/DM814x_AM387x_PSP_User_Guide.pdf, section Modifying Pin Mux settings.

    Best regards,

    Pavel