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.

How to program in Linux to control LEDs?

Other Parts Discussed in Thread: OMAP-L137

I'm working on OMAP L137. Now the evm is able to boot from nandflash and work properly. The DSPLINK samples also work properly.

How to get started with programming from gpp side, for instance, toggle LEDs?(Is there wiki on it?)

  • Ti has some basics that is not specific to the OMAP-L137 on their wiki:

    http://processors.wiki.ti.com/index.php/GPIO_Driver_Guide

    There are lot of examples on this forum and the internet. For userspace, search for "/sys/class/gpio". The hard part is recompiling the Linux kernel to configure the pinmux for your LED. The TI wik has the same info as the setup packages and more. Maybe start here:

    http://processors.wiki.ti.com/index.php/Getting_Started_Guide_for_OMAP-L137

    The module where pinmux config is done for the OMAP-L137 EVM is usually

    arch/arm/mach-davinci/board-da830-evm.c

    Take care to avoid using a pin that is already being used by some other peripheral.

  • Thanks for your response Norman.

    I'v read Getting_Started_Guide_for_OMAP-L137 already but it refered litte little about gpp programming.

    If I connect a CPLD with EMIFA, should I need writing driver for it? Can I read or write the CPLD  simply use "ioremap" and "iowrite(ioread)"?

    For instance:

            void __iomem *reg_virt = ioremap(physical_addr, num);

            iowrite32(command, regvirt);

            iounmap(reg_virt);

  • You should probably start as new thread for each question. I have feeling that you will get more answers that way. I believe the support guys loathe the "support user X forever" kind of threads.

    I've accessed a CPLD from the BIOS/DSP side. Never done it from the Linux/ARM side. Principles should be the same. Pinmux the EMIFA pins and set the appropriate EMIF CEnCFG config register. There is a some precedence on the Linux side with the NOR EMIFA driver. See EMIFA NOR code in

    arch/arm/mach-davinci/aemif.c
    arch/arm/mach-davinci/board-da850-evm.c
    drivers/mtd/maps/davinci-nor.c

    You are on the right track with the io API and the mapping of physical to virtual space. The davinci-nor.c uses the ioremap() to map a block of registers rather than one location. They will use raw_readl, etc. to access a location offset into the block.

    Note that EMIFA pins overlap badly with other peripherals. For me. the SD Card had to share the bus with the CPLD.