Re: [PATCH 1/1] Fix MUSB_HDRC compilation error
On Fri, 23 Jan 2009 12:20:14 +0200 Felipe Balbi wrote: > On Fri, Jan 09, 2009 at 05:44:55PM -0500, ext Hugo Villeneuve wrote: > > With CONFIG_USB_MUSB_HDRC selected, we have the > > following compilation errors: > > > > drivers/usb/musb/cppi_dma.c:437:5: warning: "MUSB_DEBUG" is not > > defined drivers/usb/musb/cppi_dma.c: In function > > 'cppi_next_rx_segment': drivers/usb/musb/cppi_dma.c:884: error: > > 'debug' undeclared (first use in this function) > > > > These compilation errors are related to incorrect > > debugging macro and variable names. > > > > Signed-off-by: Hugo Villeneuve > > --- > > drivers/usb/musb/cppi_dma.c | 11 +-- > > 1 files changed, 9 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/usb/musb/cppi_dma.c > > b/drivers/usb/musb/cppi_dma.c index 5ad6d08..3aac8d5 100644 > > --- a/drivers/usb/musb/cppi_dma.c > > +++ b/drivers/usb/musb/cppi_dma.c > > @@ -41,6 +41,9 @@ > > #define NUM_TXCHAN_BD 64 > > #define NUM_RXCHAN_BD 64 > > > > +/* Defined in musb_core.c */ > > +extern unsigned musb_debug; > > you should include musb_debug.h Done. > > static inline void cpu_drain_writebuffer(void) > > { > > wmb(); > > @@ -423,6 +426,7 @@ cppi_rndis_update(struct cppi_channel *c, int > > is_rx, } > > } > > > > +#ifdef CONFIG_USB_MUSB_DEBUG > > static void cppi_dump_rxbd(const char *tag, struct cppi_descriptor > > *bd) { > > pr_debug("RXBD/%s %08x: " > > @@ -431,10 +435,11 @@ static void cppi_dump_rxbd(const char *tag, > > struct cppi_descriptor *bd) bd->hw_next, bd->hw_bufp, > > bd->hw_off_len, bd->hw_options); > > } > > +#endif > > > > static void cppi_dump_rxq(int level, const char *tag, struct > > cppi_channel *rx) { > > -#if MUSB_DEBUG > 0 > > +#ifdef CONFIG_USB_MUSB_DEBUG > > struct cppi_descriptor *bd; > > > > if (!_dbg_level(level)) > > @@ -881,12 +886,14 @@ cppi_next_rx_segment(struct musb *musb, > > struct cppi_channel *rx, int onepacket) bd->hw_options |= > > CPPI_SOP_SET; tail->hw_options |= CPPI_EOP_SET; > > > > - if (debug >= 5) { > > +#ifdef CONFIG_USB_MUSB_DEBUG > > + if (musb_debug >= 5) { > > and use _dbg_level(5) Done. I´m sending a new patch right now. Hugo V. --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/1] Fix compilation errors with musb/cppi_dma.c
These compilation errors are related to incorrect debugging macro and variable names and generated the following errors: drivers/usb/musb/cppi_dma.c:437:5: warning: "MUSB_DEBUG" is not defined drivers/usb/musb/cppi_dma.c: In function 'cppi_next_rx_segment': drivers/usb/musb/cppi_dma.c:884: error: 'debug' undeclared (first use in this function) Signed-off-by: Hugo Villeneuve --- drivers/usb/musb/cppi_dma.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c index 5ad6d08..d8d5345 100644 --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c @@ -9,6 +9,7 @@ #include #include "musb_core.h" +#include "musb_debug.h" #include "cppi_dma.h" @@ -423,6 +424,7 @@ cppi_rndis_update(struct cppi_channel *c, int is_rx, } } +#ifdef CONFIG_USB_MUSB_DEBUG static void cppi_dump_rxbd(const char *tag, struct cppi_descriptor *bd) { pr_debug("RXBD/%s %08x: " @@ -431,10 +433,11 @@ static void cppi_dump_rxbd(const char *tag, struct cppi_descriptor *bd) bd->hw_next, bd->hw_bufp, bd->hw_off_len, bd->hw_options); } +#endif static void cppi_dump_rxq(int level, const char *tag, struct cppi_channel *rx) { -#if MUSB_DEBUG > 0 +#ifdef CONFIG_USB_MUSB_DEBUG struct cppi_descriptor *bd; if (!_dbg_level(level)) @@ -881,12 +884,14 @@ cppi_next_rx_segment(struct musb *musb, struct cppi_channel *rx, int onepacket) bd->hw_options |= CPPI_SOP_SET; tail->hw_options |= CPPI_EOP_SET; - if (debug >= 5) { +#ifdef CONFIG_USB_MUSB_DEBUG + if (_dbg_level(5)) { struct cppi_descriptor *d; for (d = rx->head; d; d = d->next) cppi_dump_rxbd("S", d); } +#endif /* in case the preceding transfer left some state... */ tail = rx->last_processed; -- 1.5.4.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
mmc_davinci DMA Oops
irq+0x0/0x20) from [] (schedule +0x184/0x288) [] (schedule+0x0/0x288) from [] (schedule_timeout+0x20/0xc4) [] (schedule_timeout+0x0/0xc4) from [] (wait_for_common+0xe0/0x16c) r7:c393bdfc r6:7fff r5: r4:c393be00 [] (wait_for_common+0x0/0x16c) from [] (wait_for_completion+0x18/0x1c) [] (wait_for_completion+0x0/0x1c) from [] (mmc_wait_for_req +0x218/0x23c [mmc_core]) [] (mmc_wait_for_req+0x0/0x23c [mmc_core]) from [] (mmc_io_rw_extended+0x178/0x1d8 [mmc_core]) r7:c3b4ac00 r6:0001 r5:0020 r4:c393be4c [] (mmc_io_rw_extended+0x0/0x1d8 [mmc_core]) from [] (sdio_io_rw_ext_helper+0x158/0x190 [mmc_core]) [] (sdio_io_rw_ext_helper+0x0/0x190 [mmc_core]) from [] (sdio_readsb+0x24/0x2c [mmc_core]) [] (sdio_readsb+0x0/0x2c [mmc_core]) from [] (if_sdio_interrupt +0x234/0x920 [libertas_sdio]) [] (if_sdio_interrupt+0x0/0x920 [libertas_sdio]) from [] (sdio_irq_thread+0x118/0x254 [mmc_core]) [] (sdio_irq_thread+0x0/0x254 [mmc_core]) from [] (kthread+0x5c/0x94) [] (kthread+0x0/0x94) from [] (do_exit+0x0/0x6e0) r6: r5: r4: Code: e593 eb42f951 e5943004 e5942008 (e5933014) Kernel panic - not syncing: Fatal exception in interrupt End kernel log The crash is caused by the host->data member being NULL in the function mmc_davinci_dma_cb() (drivers/mmc/host/mmc_davinci.c). The message you see just before the crash: davinci_mmc davinci_mmc.0: host->data is NULL is a trace I added in the function mmc_davinci_dma_cb() to confirm the cause of the bug. What would be the proper way to deal with that bug/condition? Thank-you, Hugo V. ------- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: mmc_davinci DMA Oops
On Tue, 27 Jan 2009 11:10:51 -0800 David Brownell wrote: > On Tuesday 27 January 2009, Hugo Villeneuve wrote: > > I´m trying to use a Marvell 88w8686 chip with a DM6446 and the > > libertas driver. So far it looks promising as the libertas is able > > to detect the chip, send the firmware to it and configure it. > > You neglected to say which kernel. Current GIT? Hi Dave, sorry, my kernel is davinci-2.6 GIT. Latest log entry for it is: commit 3c8fcf7722a8edd280d1aa84f90702e84fc536a2 Author: David Brownell Date: Mon Jan 19 12:06:12 2009 -0800 > If so, are you using the RFT patch I sent along, > to activate the SDIO IRQ? I did not use any patches. > So far as I know, no GIT kernel has ever supported > SDIO IRQs. If it's some non-git kernel, please > give the above combination a try. I know I've > triggered DMA error IRQs and seen them handled > correctly. So if I am using the latest davinci git kernel, should I apply your patch? If so where is it located? I also found that prior to the crash, I have this error message , also coming from the mmc_davinci_dma_cb() function: Begin kernel log --- mmc0: starting CMD52 arg 10004000 flags 0195 davinci_mmc davinci_mmc.0: CMD52, arg 0x10004000, R1/R5/R6/R7 response mmc0: req done (CMD52): 0: 1008 mmc0: starting CMD53 arg 9220 flags 01b5 mmc0: blksz 32 blocks 1 flags 0100 tsac 1000 ms nsac 0 davinci_mmc davinci_mmc.0: MMCSD : Data xfer (block write), DTO 0 cycles + 10 ns, 1 blocks of 32 bytes davinci_mmc davinci_mmc.0: CMD53, arg 0x9220, R1/R5/R6/R7 response davinci_mmc davinci_mmc.0: DMA write error mmc0: req done (CMD53): 0: 2000 mmc0: 32 bytes transferred: -5 mmc0: starting CMD52 arg 0a00 flags 0195 davinci_mmc davinci_mmc.0: CMD52, arg 0x0a00, R1/R5/R6/R7 response mmc0: req done (CMD52): 0: 1002 mmc0: starting CMD52 arg 1a00 flags 0195 davinci_mmc davinci_mmc.0: CMD52, arg 0x1a00, R1/R5/R6/R7 response mmc0: req done (CMD52): 0: 1002 mmc0: starting CMD52 arg 9afd flags 0195 davinci_mmc davinci_mmc.0: CMD52, arg 0x9afd, R1/R5/R6/R7 response mmc0: req done (CMD52): 0: 10fd mmc0: starting CMD52 arg 0a00 flags 0195 davinci_mmc davinci_mmc.0: CMD52, arg 0x0a00, R1/R5/R6/R7 response mmc0: req done (CMD52): 0: 1002 mmc0: starting CMD52 arg 1a00 flags 0195 davinci_mmc davinci_mmc.0: CMD52, arg 0x1a00, R1/R5/R6/R7 response mmc0: req done (CMD52): 0: 1001 mmc0: starting CMD52 arg 9afe flags 0195 davinci_mmc davinci_mmc.0: CMD52, arg 0x9afe, R1/R5/R6/R7 response mmc0: req done (CMD52): 0: 10fe mmc0: starting CMD52 arg 10006800 flags 0195 davinci_mmc davinci_mmc.0: CMD52, arg 0x10006800, R1/R5/R6/R7 response mmc0: req done (CMD52): 0: 101d mmc0: starting CMD52 arg 10006a00 flags 0195 davinci_mmc davinci_mmc.0: CMD52, arg 0x10006a00, R1/R5/R6/R7 response mmc0: req done (CMD52): 0: 1000 mmc0: starting CMD52 arg 10004000 flags 0195 davinci_mmc davinci_mmc.0: CMD52, arg 0x10004000, R1/R5/R6/R7 response mmc0: req done (CMD52): 0: 100a mmc0: starting CMD53 arg 1220 flags 01b5 mmc0: blksz 32 blocks 1 flags 0200 tsac 1000 ms nsac 0 davinci_mmc davinci_mmc.0: MMCSD : Data xfer (block read), DTO 0 cycles + 10 ns, 1 blocks of 32 bytes davinci_mmc davinci_mmc.0: CMD53, arg 0x1220, R1/R5/R6/R7 response mmc0: req done (CMD53): 0: 2000 mmc0: 32 bytes transferred: 0 davinci_mmc davinci_mmc.0: host->data is NULL Unable to handle kernel NULL pointer dereference at virtual address 0014 --- End kernel log I don´t have any clue as to what could cause this DMA write error... --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: mmc_davinci DMA Oops
On Tue, 27 Jan 2009 13:35:11 -0800 David Brownell wrote: > On Tuesday 27 January 2009, Hugo Villeneuve wrote: > > On Tue, 27 Jan 2009 11:10:51 -0800 > > David Brownell wrote: > > > > > On Tuesday 27 January 2009, Hugo Villeneuve wrote: > > > > I´m trying to use a Marvell 88w8686 chip with a DM6446 and the > > > > libertas driver. So far it looks promising as the libertas is > > > > able to detect the chip, send the firmware to it and configure > > > > it. > > > > > > So far as I know, no GIT kernel has ever supported > > > SDIO IRQs. If it's some non-git kernel, please > > > give the above combination a try. I know I've > > > triggered DMA error IRQs and seen them handled > > > correctly. > > > > So if I am using the latest davinci git kernel, should I apply your > > patch? If so where is it located? > > I just resent that. I tried your patch but it actually prevents the driver from being loaded correctly (command 0x0003 timed out): $> modprobe libertas_sdio helper_name=sd8686_helper.bin fw_name=sd86 86.bin libertas_sdio: Libertas SDIO driver libertas_sdio: Copyright Pierre Ossman r...@das-04:~# modprobe davinci_mmc davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode $> mmc0: new SDIO card at address 0001 libertas_sdio mmc0:0001:1: firmware: requesting sd8686_helper.bin libertas_sdio mmc0:0001:1: firmware: requesting sd8686.bin libertas: command 0x0003 timed out libertas: requeueing command 0x0003 due to timeout (#1) libertas: Received result 0 to command 3 after 1 retries libertas: 00:13:e0:ab:e0:17, fw 9.70.3p14, cap 0x0303 libertas: unidentified region code; using the default (USA) > Capsule summary of what I write below: this looks like > an issue specific to SDIO. So I suspect you'll need to > dive into SDIO a bit and debug this ... > > > davinci_mmc davinci_mmc.0: DMA write error > > mmc0: req done (CMD53): 0: 2000 > > mmc0: 32 bytes transferred: -5 > > OK, so this time the DMA error callback seems to have worked as > it should. I'd have to dive into MMC and SDIO specs to see what > that command and status bit signify, but -EIO after a DMA error > is appropriate. And subsequent commands act OK... > > > > mmc0: starting CMD52 arg 0a00 flags 0195 > > davinci_mmc davinci_mmc.0: CMD52, arg 0x0a00, R1/R5/R6/R7 > > response mmc0: req done (CMD52): 0: 1002 > > mmc0: starting CMD52 arg 1a00 flags 0195 > > davinci_mmc davinci_mmc.0: CMD52, arg 0x1a00, R1/R5/R6/R7 > > response mmc0: req done (CMD52): 0: 1002 > > mmc0: starting CMD52 arg 9afd flags 0195 > > davinci_mmc davinci_mmc.0: CMD52, arg 0x9afd, R1/R5/R6/R7 > > response mmc0: req done (CMD52): 0: 10fd > > mmc0: starting CMD52 arg 0a00 flags 0195 > > davinci_mmc davinci_mmc.0: CMD52, arg 0x0a00, R1/R5/R6/R7 > > response mmc0: req done (CMD52): 0: 1002 > > mmc0: starting CMD52 arg 1a00 flags 0195 > > davinci_mmc davinci_mmc.0: CMD52, arg 0x1a00, R1/R5/R6/R7 > > response mmc0: req done (CMD52): 0: 1001 > > mmc0: starting CMD52 arg 9afe flags 0195 > > davinci_mmc davinci_mmc.0: CMD52, arg 0x9afe, R1/R5/R6/R7 > > response mmc0: req done (CMD52): 0: 10fe > > mmc0: starting CMD52 arg 10006800 flags 0195 > > davinci_mmc davinci_mmc.0: CMD52, arg 0x10006800, R1/R5/R6/R7 > > response mmc0: req done (CMD52): 0: 101d > > mmc0: starting CMD52 arg 10006a00 flags 0195 > > davinci_mmc davinci_mmc.0: CMD52, arg 0x10006a00, R1/R5/R6/R7 > > response mmc0: req done (CMD52): 0: 1000 > > mmc0: starting CMD52 arg 10004000 flags 0195 > > davinci_mmc davinci_mmc.0: CMD52, arg 0x10004000, R1/R5/R6/R7 > > response mmc0: req done (CMD52): 0: 100a > > > > > mmc0: starting CMD53 arg 1220 flags 01b5 > > mmc0: blksz 32 blocks 1 flags 0200 tsac 1000 ms nsac 0 > > davinci_mmc davinci_mmc.0: MMCSD : Data xfer (block read), DTO 0 > > cycles > > + 10 ns, 1 blocks of 32 bytes davinci_mmc davinci_mmc.0: > > CMD53, arg 0x1220, R1/R5/R6/R7 response mmc0: req done (CMD53): > > 0: 2000 mmc0: 32 bytes > > transferred: 0 > > OK, that block *read* worked OK ... note that CMD53 is used > for both reads and writes here. > > > > davinci_mmc dav
Re: mmc_davinci DMA Oops
On Tue, 27 Jan 2009 14:28:05 -0800 David Brownell wrote: > On Tuesday 27 January 2009, Hugo Villeneuve wrote: > > > > > > So if I am using the latest davinci git kernel, should I apply > > > > your patch? If so where is it located? > > > > > > I just resent that. > > > > I tried your patch but it actually prevents the driver from being > > loaded correctly (command 0x0003 timed out): > > That's from the libertas driver ... unclear what MMC protocol > command is involved. Better to see the whole trace with the > MMC and/or davinci_mmc debug messages. And maybe trace the > SDIO irq enable/disable. Just to recap: 1. Yes I am using the libertas driver, and with the latest stock davinci-2.6 git kernel (latest commit is f9719b2d8f29e5bef46a51594d79643fff045221 from January 20th) , the libertas and davinci_mmc drivers seems to load correctly: $> modprobe davinci_mmc davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode r...@das-04:~# mmc0: new SDIO card at address 0001 libertas_sdio: Libertas SDIO driver libertas_sdio: Copyright Pierre Ossman libertas_sdio mmc0:0001:1: firmware: requesting sd8686_helper.bin libertas_sdio mmc0:0001:1: firmware: requesting sd8686.bin libertas: 00:13:e0:ab:e0:17, fw 9.70.3p24, cap 0x0303 libertas: unidentified region code; using the default (USA) libertas: PREP_CMD: command 0x00a3 failed: 2 libertas: PREP_CMD: command 0x00a3 failed: 2 libertas: eth1: Marvell WLAN 802.11 adapter (the command 0x00a3 failed message is for some kind of mesh functionality probing related to the OLPC and is harmless here based on some Googling). 2. After the drivers are loaded, if I enable the debug messages I see this in a continuous fashion (it never stops): $> dmesg -n 8 mmc0: starting CMD52 arg 0a00 flags 0195 davinci_mmc davinci_mmc.0: CMD52, arg 0x0a00, R1/R5/R6/R7 response mmc0: req done (CMD52): 0: 1000 mmc0: starting CMD52 arg 0a00 flags 0195 davinci_mmc davinci_mmc.0: CMD52, arg 0x0a00, R1/R5/R6/R7 response mmc0: req done (CMD52): 0: 1000 mmc0: starting CMD52 arg 0a00 flags 0195 davinci_mmc davinci_mmc.0: CMD52, arg 0x0a00, R1/R5/R6/R7 response mmc0: req done (CMD52): 0: 1000 ... 3. With debug messages deactivated (dmesg -n 7), I can start configuring the wlan adapter but it fails when I try to scan with iwlist: $> iwconfig eth1 eth1 IEEE 802.11b/g ESSID:"" Mode:Managed Frequency:2.412 GHz Access Point: Not-Associated Bit Rate:0 kb/s Tx-Power=18 dBm Retry short limit:8 RTS thr=2347 B Fragment thr=2346 B Encryption key:off Power Management:off Link Quality:0 Signal level:0 Noise level:0 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 $> ifconfig eth1 up $> iwlist eth1 scan Unable to handle kernel NULL pointer dereference at virtual address 0014 pgd = c0004000 ... Hugo V. --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/1] Prevent a segmentation fault when MMC DMA transfer failed.
The segmentation fault is caused when accessing a potential NULL host->data structure. Signed-off-by: Hugo Villeneuve --- drivers/mmc/host/davinci_mmc.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c index 8ea3902..9f19283 100644 --- a/drivers/mmc/host/davinci_mmc.c +++ b/drivers/mmc/host/davinci_mmc.c @@ -430,6 +430,12 @@ static void mmc_davinci_dma_cb(unsigned channel, u16 ch_status, void *data) * request was seen. In the future, TC errors (like bad * addresses) might be presented too. */ + if (!host->data) { + dev_warn(mmc_dev(host->mmc), +"DMA error (host->data is NULL)\n"); + return; + } + dev_warn(mmc_dev(host->mmc), "DMA %s error\n", (host->data->flags & MMC_DATA_WRITE) ? "write" : "read"); -- 1.5.4.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: mmc_davinci DMA Oops
On Wed, 28 Jan 2009 11:37:35 -0500 Hugo Villeneuve wrote: > On Tue, 27 Jan 2009 14:28:05 -0800 > David Brownell wrote: > > > On Tuesday 27 January 2009, Hugo Villeneuve wrote: > > > > > > > > So if I am using the latest davinci git kernel, should I apply > > > > > your patch? If so where is it located? > > > > > > > > I just resent that. > > > > > > I tried your patch but it actually prevents the driver from being > > > loaded correctly (command 0x0003 timed out): > > > > That's from the libertas driver ... unclear what MMC protocol > > command is involved. Better to see the whole trace with the > > MMC and/or davinci_mmc debug messages. And maybe trace the > > SDIO irq enable/disable. > > Just to recap: > > 1. Yes I am using the libertas driver, and with the latest stock > davinci-2.6 git kernel (latest commit is > f9719b2d8f29e5bef46a51594d79643fff045221 from January 20th) , the > libertas and davinci_mmc drivers seems to load correctly: > > $> modprobe davinci_mmc > davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode I had an idea, I added the when loading the davinci_mmc driver: $> modprobe davinci_mmc use_dma=0 davinci_mmc davinci_mmc.0: Using PIO, 4-bit mode ... And now in PIO mode everything works fine, the Wifi chip is fully operational. I will obviously try to figure what is wrong with the failed DMA transfer. In the meantime, I will send a patch just to prevent a segfault with that NULL host->data pointer. Hugo V. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [PATCH]: ARM DaVinci ASoC: Fix module unload error
On Fri, 13 Feb 2009 12:39:39 +0530 chaithr...@ti.com wrote: > From: Chaithrika U S > > Fix for the error when the audio module is unloaded. > On unregistering the platform_device, platform_device_release will > free the platform data.If platform data is static the kernel panics > when it is freed. Instead use the platform device helper function to > add data. > > This change has been tested on DM644x EVM. > > Signed-off-by: Chaithrika U S > --- > sound/soc/davinci/davinci-evm.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/sound/soc/davinci/davinci-evm.c > b/sound/soc/davinci/davinci-evm.c index 1aad262..95c44bf 100644 > --- a/sound/soc/davinci/davinci-evm.c > +++ b/sound/soc/davinci/davinci-evm.c > @@ -225,7 +225,7 @@ static int __init evm_init(void) > > platform_set_drvdata(evm_snd_device, &evm_snd_devdata); > evm_snd_devdata.dev = &evm_snd_device->dev; > - evm_snd_device->dev.platform_data = data; > + platform_device_add_data(evm_snd_device, data, sizeof(data)); Hi, I modified your patch for the SFFSDR board and it also fixed the problem. Thank-you. Can you include the fix for the SFFSDR also in your patch? Here is the modification for the SFFSDR: diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c index a304ada..6e46258 100644 --- a/sound/soc/davinci/davinci-sffsdr.c +++ b/sound/soc/davinci/davinci-sffsdr.c @@ -128,7 +128,7 @@ static int __init sffsdr_init(void) platform_set_drvdata(sffsdr_snd_device, &sffsdr_snd_devdata); sffsdr_snd_devdata.dev = &sffsdr_snd_device->dev; - sffsdr_snd_device->dev.platform_data = &sffsdr_snd_data; + platform_device_add_data(sffsdr_snd_device, &sffsdr_snd_data, sizeof(sffsdr_snd_data)); ret = platform_device_add_resources(sffsdr_snd_device, sffsdr_snd_resources, ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Sync with ALSA to fix bugs
Hi Kevin, can you apply those two patches from ALSA to the linux-davinci-2.6.git tree to fix some running and compilation bugs? Here are the relevant patches infos: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=7f7ebad4cb7dba50c22e290363e113f055400d6a http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=04c5ca6a180c478beca953b3268cc3b806b6015d Thank-you, Hugo V. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: Sync with ALSA to fix bugs
On Thu, 05 Mar 2009 09:30:05 -0800 Kevin Hilman wrote: > Hugo Villeneuve writes: > > > Hi Kevin, > > can you apply those two patches from ALSA to the > > linux-davinci-2.6.git tree to fix some running and compilation bugs? > > > > Here are the relevant patches infos: > > > > http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=7f7ebad4cb7dba50c22e290363e113f055400d6a > > This one is already in DaVinci git as commit > 3a4250d4d77b5afc4195214e72439602c592f5e6 > > > http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=04c5ca6a180c478beca953b3268cc3b806b6015d > > > > This one I will cherry-pick into DaVinci git. > > Kevin Hi Kevin, I was referring to the git://source.mvista.com/git/linux-davinci-2.6.git tree :) These patches are needed to fix compilation errors and runtime bug. This MUSB patch is also required: commit 704a14854aaf9758a1248ea36a7d1b8cc42a4b3e So I would appreciate if you could cherry-pick those three patches and apply them to git://source.mvista.com/git/linux-davinci-2.6.git Thank-you. Hugo V. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/1] dm355 evm: make structure davinci_nand_partitions static
Signed-off-by: Hugo Villeneuve --- arch/arm/mach-davinci/board-dm355-evm.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c index 63d7a88..e104650 100644 --- a/arch/arm/mach-davinci/board-dm355-evm.c +++ b/arch/arm/mach-davinci/board-dm355-evm.c @@ -49,7 +49,7 @@ */ #define NAND_BLOCK_SIZESZ_128K -struct mtd_partition davinci_nand_partitions[] = { +static struct mtd_partition davinci_nand_partitions[] = { { /* UBL (a few copies) plus U-Boot */ .name = "bootloader", -- 1.5.4.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: Sync with ALSA to fix bugs
On Thu, 05 Mar 2009 11:50:58 -0800 Kevin Hilman wrote: > Hugo Villeneuve writes: > > > Hi Kevin, > > I was referring to the > > git://source.mvista.com/git/linux-davinci-2.6.git tree :) > > Ah, that tree is dead and is only for historic purposes. I will not > be doing any more updates to that tree. > > Is there some reason you cannot use the kernel.org davinci git repo? The only reason was to have some sort of tree and you said in an earlier message that you would be accepting patches for bug fixes for that tree. But that is not a big deal, I will try to re-synchronize everything with the kernel.org davinci git repository now. Hugo V. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/1] ALSA: ASoC: Davinci: Fix incorrect machine type for SFFSDR board
Signed-off-by: Hugo Villeneuve --- sound/soc/davinci/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/sound/soc/davinci/Kconfig b/sound/soc/davinci/Kconfig index 7d3a85d..411a710 100644 --- a/sound/soc/davinci/Kconfig +++ b/sound/soc/davinci/Kconfig @@ -21,7 +21,7 @@ config SND_DAVINCI_SOC_EVM config SND_DAVINCI_SOC_SFFSDR tristate "SoC Audio support for SFFSDR" - depends on SND_DAVINCI_SOC && MACH_DAVINCI_SFFSDR + depends on SND_DAVINCI_SOC && MACH_SFFSDR select SND_DAVINCI_SOC_I2S select SND_SOC_PCM3008 select SFFSDR_FPGA -- 1.5.4.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 2/4] ALSA: ASoC: Davinci: Replaced DAI format RIGHT_J by DSP_B for SFFSDR
Signed-off-by: Hugo Villeneuve --- sound/soc/davinci/davinci-sffsdr.c | 17 ++--- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c index 1d10957..b338c71 100644 --- a/sound/soc/davinci/davinci-sffsdr.c +++ b/sound/soc/davinci/davinci-sffsdr.c @@ -36,6 +36,14 @@ #include "davinci-pcm.h" #include "davinci-i2s.h" +/* + * CLKX and CLKR are the inputs for the Sample Rate Generator. + * FSX and FSR are outputs, driven by the sample Rate Generator. + */ +#define AUDIO_FORMAT (SND_SOC_DAIFMT_DSP_B | \ + SND_SOC_DAIFMT_CBM_CFS | \ + SND_SOC_DAIFMT_IB_NF) + static int sffsdr_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) @@ -56,13 +64,8 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream, } #endif - /* Set cpu DAI configuration: -* CLKX and CLKR are the inputs for the Sample Rate Generator. -* FSX and FSR are outputs, driven by the sample Rate Generator. */ - ret = snd_soc_dai_set_fmt(cpu_dai, - SND_SOC_DAIFMT_RIGHT_J | - SND_SOC_DAIFMT_CBM_CFS | - SND_SOC_DAIFMT_IB_NF); + /* set cpu DAI configuration */ + ret = snd_soc_dai_set_fmt(cpu_dai, AUDIO_FORMAT); if (ret < 0) return ret; -- 1.5.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Fix audio for Lyrtech SFFSDR board
These patches make the audio work again on the SFFSDR ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 3/4] ALSA: ASoC: Davinci: Updated sffsdr_hw_params() function to new format
Signed-off-by: Hugo Villeneuve --- sound/soc/davinci/davinci-sffsdr.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c index b338c71..7fdfba8 100644 --- a/sound/soc/davinci/davinci-sffsdr.c +++ b/sound/soc/davinci/davinci-sffsdr.c @@ -45,8 +45,7 @@ SND_SOC_DAIFMT_IB_NF) static int sffsdr_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params, - struct snd_soc_dai *dai) + struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; -- 1.5.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/4] ALSA: ASoC: Davinci: Fix SFFSDR FPGA module codec FS bug
This prevented the FPGA from properly configuring the codec FS when the SFFSDR FPGA was compiled as a module. Signed-off-by: Hugo Villeneuve --- sound/soc/davinci/davinci-sffsdr.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c index 74f1eb3..1d10957 100644 --- a/sound/soc/davinci/davinci-sffsdr.c +++ b/sound/soc/davinci/davinci-sffsdr.c @@ -25,10 +25,10 @@ #include #include -#ifdef CONFIG_SFFSDR_FPGA -#include -#endif +#if defined(CONFIG_SFFSDR_FPGA) || defined(CONFIG_SFFSDR_FPGA_MODULE) +#include +#endif #include #include @@ -48,7 +48,7 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream, /* Fsref can be 32000, 44100 or 48000. */ fs = params_rate(params); -#ifndef CONFIG_SFFSDR_FPGA +#if !defined(CONFIG_SFFSDR_FPGA) && !defined(CONFIG_SFFSDR_FPGA_MODULE) /* Without the FPGA module, the Fs is fixed at 44100 Hz */ if (fs != 44100) { pr_debug("warning: only 44.1 kHz is supported without SFFSDR FPGA module\n"); @@ -68,10 +68,10 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream, pr_debug("sffsdr_hw_params: rate = %d Hz\n", fs); -#ifndef CONFIG_SFFSDR_FPGA - return 0; -#else +#if defined(CONFIG_SFFSDR_FPGA) || defined(CONFIG_SFFSDR_FPGA_MODULE) return sffsdr_fpga_set_codec_fs(fs); +#else + return 0; #endif } -- 1.5.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR
Signed-off-by: Hugo Villeneuve --- sound/soc/davinci/davinci-sffsdr.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c index 7fdfba8..1fc53c1 100644 --- a/sound/soc/davinci/davinci-sffsdr.c +++ b/sound/soc/davinci/davinci-sffsdr.c @@ -31,6 +31,7 @@ #endif #include #include +#include #include "../codecs/pcm3008.h" #include "davinci-pcm.h" @@ -135,6 +136,8 @@ static int __init sffsdr_init(void) if (!machine_is_sffsdr()) return -EINVAL; + davinci_cfg_reg(DM644X_MCBSP); + sffsdr_snd_device = platform_device_alloc("soc-audio", 0); if (!sffsdr_snd_device) { printk(KERN_ERR "platform device allocation failed\n"); -- 1.5.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [alsa-devel] [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR
On Tue, 10 Mar 2009 10:29:23 + Mark Brown wrote: > On Mon, Mar 09, 2009 at 11:32:09PM -0400, Hugo Villeneuve wrote: > > return -EINVAL; > > > > + davinci_cfg_reg(DM644X_MCBSP); > > + > > I can't find any references to this function in mainline? Hi Mark, I based those patches on the latest linux-davinci git tree, which has the function. > Most of the > ARM variants do this sort of configuration in the arch/arm code which > was why I was looking for other users to see what was idiomatic for > DaVinci. In fact I just duplicated what was done for the evm board in sound/soc/davinci/davinci-evm.c, which also has the davinci_cfg_reg() function (in the linux-davinci tree): http://git.kernel.org/?p=linux/kernel/git/khilman/linux-davinci.git;a=commit;h=da57d7068350741e62671a7f619d5b4fad2727c0 > I've applied the other three patches. Thanks, Hugo V. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [alsa-devel] [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR
On Tue, 10 Mar 2009 15:16:32 + Mark Brown wrote: > On Tue, Mar 10, 2009 at 10:03:41AM -0400, Hugo Villeneuve wrote: > > > I based those patches on the latest linux-davinci git tree, which > > has the function. > > Do not submit patches for mainline which are not based on mainline > trees. Code which relies on out of tree changes needs to wait for > those out of tree changes to be merged before submitting to mainline. I did not know that these changes were not in mainline yet. I was told that all davinci ASoC code changes were to be submitted only to ALSA, and then were imported back into the davinci git tree. Apparently this is not quite like that anymore. Kevin, what is the new rule to submit davinci ASoC patches? Hugo V. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [alsa-devel] [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR
On Tue, 10 Mar 2009 08:55:06 -0700 Kevin Hilman wrote: > Hugo Villeneuve writes: > > > On Tue, 10 Mar 2009 15:16:32 + > > Mark Brown wrote: > > > >> On Tue, Mar 10, 2009 at 10:03:41AM -0400, Hugo Villeneuve wrote: > >> > >> > I based those patches on the latest linux-davinci git tree, which > >> > has the function. > >> > >> Do not submit patches for mainline which are not based on mainline > >> trees. Code which relies on out of tree changes needs to wait for > >> those out of tree changes to be merged before submitting to > >> mainline. > > > > I did not know that these changes were not in mainline yet. I was > > told that all davinci ASoC code changes were to be submitted only > > to ALSA, and then were imported back into the davinci git tree. > > Apparently this is not quite like that anymore. > > > > Kevin, what is the new rule to submit davinci ASoC patches? > > > > The DaVinci ASoC code is indeed in mainline, but not all of the > DaVinci core (in this case the pin mux) is yet in mainline. I will be > pushing it during the next merge window. That doesn't really answer my question. I can see that David Brownell pushed a patch to the davinci tree directly modifying sound/soc/davinci/davinci-evm.c which IS in mainline. Does this means that as of now all ASoC patches should be sent first to the Davinci list, and then you will push those to the mainline kernel? > On a related note, sound/soc/davinci/davinci-[evm,sffsdr].c is > actually board-level setup code and should not actually live in > sound/asoc/. It should live in arch/arm/mach-davinci/* and follow the > rest of the davinci chip/board code upstream. Kevin, you have said the same things months ago and I agree with you. When you or someone else move the evm stuff back into arch/arm/mach-davinci, I will be more than happy to do the same for the SFFSDR. Hugo V. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [alsa-devel] [PATCH 4/4] ALSA: ASoC: Davinci: Fixed missing McBSP pinmux for SFFSDR
On Tue, 10 Mar 2009 09:20:15 -0700 Kevin Hilman wrote: > Hugo Villeneuve writes: > > > On Tue, 10 Mar 2009 08:55:06 -0700 > > Kevin Hilman wrote: > > > >> Hugo Villeneuve writes: > >> > >> > On Tue, 10 Mar 2009 15:16:32 + > >> > Mark Brown wrote: > >> > > >> >> On Tue, Mar 10, 2009 at 10:03:41AM -0400, Hugo Villeneuve wrote: > >> >> > >> >> > I based those patches on the latest linux-davinci git tree, > >> >> > which has the function. > >> >> > >> >> Do not submit patches for mainline which are not based on > >> >> mainline trees. Code which relies on out of tree changes needs > >> >> to wait for those out of tree changes to be merged before > >> >> submitting to mainline. > >> > > >> > I did not know that these changes were not in mainline yet. I was > >> > told that all davinci ASoC code changes were to be submitted only > >> > to ALSA, and then were imported back into the davinci git tree. > >> > Apparently this is not quite like that anymore. > >> > > >> > Kevin, what is the new rule to submit davinci ASoC patches? > >> > > >> > >> The DaVinci ASoC code is indeed in mainline, but not all of the > >> DaVinci core (in this case the pin mux) is yet in mainline. I > >> will be pushing it during the next merge window. > > > > That doesn't really answer my question. > > > > I can see that David Brownell pushed a patch to the davinci tree > > directly modifying sound/soc/davinci/davinci-evm.c which IS in > > mainline. Does this means that as of now all ASoC patches should be > > sent first to the Davinci list, and then you will push those to the > > mainline kernel? > > > > No ASoc patches should be generated against an ASoC tree and submitted > to alsa-devel, and CC davinci list. > > This means that the until the DaVinci core is in mainline, DaVinci > git will have slightly different looking ASoC drivers, but those > changes will be minimal. Ok, so the patch affecting sound/soc/davinci/davinci-evm.c SHOULD have been submitted to ALSA first. It is not easy following you guys. You say something and then do the opposite. Hugo V. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
DM355 UART2 problem
Hi, I'm trying to use UART2 ont he DM355, but here is the error message I have when the kernel boots: ... Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled serial8250.0: ttyS0 at MMIO 0x1c2 (irq = 40) is a 16550A console [ttyS0] enabled serial8250.0: ttyS1 at MMIO 0x1c20400 (irq = 41) is a 16550A serial8250 serial8250.0: unable to register port at index 2 (IO0 MEM1e06000 IRQ14): -28 ... UART0 and UART1 seem to be fine. What could be the problem? thank-you, Hugo V. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: DM355 UART2 problem
On Mon, 16 Mar 2009 21:36:28 -0700 "Mark A. Greer" wrote: > On Mon, Mar 16, 2009 at 03:20:54PM -0500, Hugo Villeneuve wrote: > > Hi, > > I'm trying to use UART2 ont he DM355, but here is the error message > > I have when the kernel boots: > > > > ... > > Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled > > serial8250.0: ttyS0 at MMIO 0x1c2 (irq = 40) is a 16550A > > console [ttyS0] enabled > > serial8250.0: ttyS1 at MMIO 0x1c20400 (irq = 41) is a 16550A > > serial8250 serial8250.0: unable to register port at index 2 (IO0 > > MEM1e06000 IRQ14): -28 ... > > > > UART0 and UART1 seem to be fine. > > > > What could be the problem? > > I've run into this as well... > > Go into 'make menuconfig' (or whatever) and go into > 'Device Drivers/Character devices/Serial drivers' and set both > 'Maximum number of 8250/16550 serial ports' and > 'Number of 8250/16550 serial ports to register at runtime' to 3. > > That may not be sufficient to fix your problem but it is necessary. That did the trick, UART2 is working fine now :) Thank-you, Hugo. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/1] ARM: Davinci: UART: Fix bug with serial ports registration
This bug occurs when the davinci serial code tries to register UART(X) when UART(X-1) or UART(X-2) is not enabled in the structure uart_config of the board setup code: This works: .enabled_uarts = (1 << 0) This works: .enabled_uarts = (1 << 0) | (1 << 1) This works: .enabled_uarts = (1 << 0) | (1 << 1) | | (1 << 2) This fails: .enabled_uarts = (1 << 1) This fails: .enabled_uarts = (1 << 1) | (1 << 2) This fails: .enabled_uarts = (1 << 0) | (1 << 2) The bug is triggered by the fact that the 8250 serial driver stops parsing the serial_platform_data structure as soon as it sees a zero flags entry. Thus the davinci serial registration code (serial.c) must the serial_platform_data structure and only clear the flags entry when there is no more devices following. Tested on DM6446 and DM355 custom boards. Signed-off-by: Hugo Villeneuve --- arch/arm/mach-davinci/serial.c | 81 +++- 1 files changed, 38 insertions(+), 43 deletions(-) diff --git a/arch/arm/mach-davinci/serial.c b/arch/arm/mach-davinci/serial.c index 95c71b9..99102ac 100644 --- a/arch/arm/mach-davinci/serial.c +++ b/arch/arm/mach-davinci/serial.c @@ -49,36 +49,24 @@ static inline void serial_write_reg(struct plat_serial8250_port *p, int offset, __raw_writel(value, IO_ADDRESS(p->mapbase) + offset); } -static struct plat_serial8250_port serial_platform_data[] = { - { - .mapbase= DAVINCI_UART0_BASE, - .irq= IRQ_UARTINT0, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | - UPF_IOREMAP, - .iotype = UPIO_MEM, - .regshift = 2, - }, - { - .mapbase= DAVINCI_UART1_BASE, - .irq= IRQ_UARTINT1, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | - UPF_IOREMAP, - .iotype = UPIO_MEM, - .regshift = 2, - }, - { - .mapbase= DAVINCI_UART2_BASE, - .irq= IRQ_UARTINT2, - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | - UPF_IOREMAP, - .iotype = UPIO_MEM, - .regshift = 2, - }, - { - .flags = 0 - }, +static const resource_size_t serial_mapbase[] = { + DAVINCI_UART0_BASE, + DAVINCI_UART1_BASE, + DAVINCI_UART2_BASE, }; +static const unsigned int serial_irq[] = { + IRQ_UARTINT0, + IRQ_UARTINT1, + IRQ_UARTINT2, +}; + +/* + * The additional entry is present because the list must be terminated with a + * zero flags entry. + */ +static struct plat_serial8250_port serial_platform_data[DAVINCI_MAX_NR_UARTS + 1]; + static struct platform_device serial_device = { .name = "serial8250", .id = PLAT8250_DEV_PLATFORM, @@ -112,29 +100,31 @@ void __init davinci_serial_init(struct davinci_uart_config *info) char name[16]; struct clk *uart_clk; struct device *dev = &serial_device.dev; + struct plat_serial8250_port *p = serial_platform_data; /* * Make sure the serial ports are muxed on at this point. -* You have to mux them off in device drivers later on -* if not needed. +* You have to mux them off in device drivers later on if not needed. */ for (i = 0; i < DAVINCI_MAX_NR_UARTS; i++) { - struct plat_serial8250_port *p = serial_platform_data + i; - - if (!(info->enabled_uarts & (1 << i))) { - p->flags = 0; + if (!(info->enabled_uarts & (1 << i))) continue; - } - if (cpu_is_davinci_dm646x()) { - p->iotype = UPIO_MEM32; - } + /* fill-in common members */ + p->flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP; + p->regshift = 2; - if (cpu_is_davinci_dm355()) { - if (i == 2) { - p->mapbase = (unsigned long)DM355_UART2_BASE; - p->irq = IRQ_DM355_UARTINT2; - } + if (cpu_is_davinci_dm646x()) + p->iotype = UPIO_MEM32; + else + p->iotype = UPIO_MEM; + + if (cpu_is_davinci_dm355() && (i == 2)) { + p->mapbase = DM355_UART2_BASE; + p->irq = IRQ_DM355_UARTINT2; + } else { + p->mapbase = serial_mapbase[i]; + p->irq = serial_ir
Re: [PATCH 10/18] ARM: DaVinci - Move serial platform_device into SoC-specific files
On Sat, 28 Mar 2009 19:05:13 -0700 "Mark A. Greer" wrote: > From: Mark A. Greer > > Currently, there is one set of platform_device and platform_data > structures for all DaVinci SoCs. The differences in the data > between the various SoCs is handled by davinci_serial_init() > by checking the SoC type. However, as new SoCs appear, this > routine will become more & more cluttered. > > To clean up the routine and make it easier to add support for new > SoCs, move the platform_device and platform_data structures into the > SoC-specific code and use the SoC infrastructure to provide access > to the data. Hi Mark, In doing so, it seems you are re-introducing the bug that I fixed in commit aeb81be782b838f96b1eca90ff49b217035b8461 Can you please check that and correct this patch? Thank-you, Hugo V. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [PATCH 10/18] ARM: DaVinci - Move serial platform_device into SoC-specific files
On Mon, 30 Mar 2009 10:14:28 -0700 "Mark A. Greer" wrote: > On Sat, Mar 28, 2009 at 11:33:58PM -0400, Hugo Villeneuve wrote: > > On Sat, 28 Mar 2009 19:05:13 -0700 > > "Mark A. Greer" wrote: > > > > > From: Mark A. Greer > > > > > > Currently, there is one set of platform_device and platform_data > > > structures for all DaVinci SoCs. The differences in the data > > > between the various SoCs is handled by davinci_serial_init() > > > by checking the SoC type. However, as new SoCs appear, this > > > routine will become more & more cluttered. > > > > > > To clean up the routine and make it easier to add support for new > > > SoCs, move the platform_device and platform_data structures into > > > the SoC-specific code and use the SoC infrastructure to provide > > > access to the data. > > > > Hi Mark, > > In doing so, it seems you are re-introducing the bug that I fixed > > in commit aeb81be782b838f96b1eca90ff49b217035b8461 > > > > Can you please check that and correct this patch? > > Hi Hugo. > > I thought I captured the essence of your patch. Which, AFAICT, is to > replace the 'p->flags = 0' with a 'continue' inside the check if the > uart is enabled. Partly true, there is more to it tought... My patch has a static array containing the UART infos, and the a dynamic array which is filled based on the number of UARTs enabled. p should be a pointer where to WRITE the platform data i should be an index for READING static infos. For example, your code will not work if you only enable UART0 and UART2: i p === 0 dev->platform_data[0] p points to UART0 data 1 dev->platform_data[1] UART1 is not enabled, so p is not incremented (continue statement) 2 dev->platform_data[1] Wrong, your p still point to UART1 data, not UART2 So if you want your patch to work, you simply have to define like I did: static struct plat_serial8250_port serial_platform_data[DAVINCI_MAX_NR_UARTS + 1]; and initialize your p pointer to point to it, and read static data from dev->platform_data[i]. Hugo v. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [PATCH 10/18] ARM: DaVinci - Move serial platform_device into SoC-specific files
On Tue, 31 Mar 2009 21:31:13 -0700 Kevin Hilman wrote: > David Brownell writes: > > > On Tuesday 31 March 2009, Mark A. Greer wrote: > >> On Tue, Mar 31, 2009 at 01:43:41PM -0700, David Brownell wrote: > >> > On Tuesday 31 March 2009, Mark A. Greer wrote: > >> > > The serial infrastructure is pretty limited WRT this (I have > >> > > same issue on da830 evm--I only want to use uart2). > >> > > >> > Couldn't you add some kind of "ignore this one" flag to that > >> > infrastructure, and just have DaVinci use it? > >> > >> Yes and that's probably the right long-term solution. > >> Problem is that code is used by almost everyone so who knows how > >> long it'll take to get accepted. > > > > Accepted: should be easy with a sane patch. No existing > > driver would be setting that new flag. > > > > Used widely: happens over time, like always. > > We ran into this same problem in OMAP too. The solution we ame up > with is to just power-up all UARTs and an inactivity timer disables > unused UART clocks. > > I tried a solution to this in the 8250 driver, but the bigger problem > is that the 8250 driver is orphaned. Patches to add/fix features for > the 8250 driver go largely ignored on the serial list. This all seems overly complicated to me. I don't like the idea of registering a non-used serial port. I have no problem with having ttyS0 and ttyS1 if I register UART0 and UART2. Symbolic links can be used to make things more obvious like /dev/mydevice -> /dev/ttyS0. Hugo V. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [PATCH 10/18] ARM: DaVinci - Move serial platform_device into SoC-specific files
On Tue, 31 Mar 2009 22:04:46 -0700 Kevin Hilman wrote: > Hugo Villeneuve writes: > > > On Tue, 31 Mar 2009 21:31:13 -0700 > > Kevin Hilman wrote: > > > >> David Brownell writes: > >> > >> > On Tuesday 31 March 2009, Mark A. Greer wrote: > >> >> On Tue, Mar 31, 2009 at 01:43:41PM -0700, David Brownell wrote: > >> >> > On Tuesday 31 March 2009, Mark A. Greer wrote: > >> >> > > The serial infrastructure is pretty limited WRT this (I have > >> >> > > same issue on da830 evm--I only want to use uart2). > >> >> > > >> >> > Couldn't you add some kind of "ignore this one" flag to that > >> >> > infrastructure, and just have DaVinci use it? > >> >> > >> >> Yes and that's probably the right long-term solution. > >> >> Problem is that code is used by almost everyone so who knows how > >> >> long it'll take to get accepted. > >> > > >> > Accepted: should be easy with a sane patch. No existing > >> > driver would be setting that new flag. > >> > > >> > Used widely: happens over time, like always. > >> > >> We ran into this same problem in OMAP too. The solution we ame up > >> with is to just power-up all UARTs and an inactivity timer disables > >> unused UART clocks. > >> > >> I tried a solution to this in the 8250 driver, but the bigger > >> problem is that the 8250 driver is orphaned. Patches to add/fix > >> features for the 8250 driver go largely ignored on the serial list. > > > > This all seems overly complicated to me. I don't like the idea of > > registering a non-used serial port. I have no problem with having > > ttyS0 and ttyS1 if I register UART0 and UART2. Symbolic > > links can be used to make things more obvious like > > /dev/mydevice -> /dev/ttyS0. > > Yes, it is a bit complicated, but your solution leads to complications > and confusion as well. My solution is there to fix a bug. Before my patch, if you registered only UART0 and UART2, it didn't work. I prefer a little bit of confusion and to have something bug free for now. The real problem seems to be the way that the 8250 driver assigns its device numbers. If you disagree with that methodology, then fix the 8250 driver. Don't use some ugly hacks to avoid the real problem. Hugo V. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [PATCH 10/18] ARM: DaVinci - Move serial platform_device into SoC-specific files
On Fri, 3 Apr 2009 08:55:41 -0700 "Mark A. Greer" wrote: > On Tue, Mar 31, 2009 at 01:43:41PM -0700, David Brownell wrote: > > On Tuesday 31 March 2009, Mark A. Greer wrote: > > > The serial infrastructure is pretty limited WRT this (I have same > > > issue on da830 evm--I only want to use uart2). > > > > Couldn't you add some kind of "ignore this one" flag to that > > infrastructure, and just have DaVinci use it? > > > > This issue is hardly new to DaVinci chips, it's a longstanding > > annoyance. Happens on x86 too, ISTR ... > > Well, I wasted more of my life than I care to admit trying to better > understand (and tweak) the intricacies of the serial subsystem and > I'm not going to waste any more. > > If someone else wants to do this, they get a gold star. > > Hugo, I'm sorry but I'm going to back out most of your patch since > pretty much everyone (except you) agrees that misnaming uart2 is > unacceptable. I don't disagree, I just don't care, which is not the same :) First point: Before my patch, if you tried to enable UART0, UART1 and UART2, everything was fine. But if you tried to enable only UART0 and UART2, it failed miserably -> This is a BUG. Second point: If you remove what I did, how will you handle the case when I need to enable only UART0 and UART2? > If you don't care what uart2 is called, then why not > tweak the plat_serial8250_port data? Then it means that the serial platform data would need to go into the board setup code (board-sffsdr.c), and not into dm644x.c for example. If this is done like that, I don't mind, but it will need to be done for all the boards for consistency. Hugo V. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [PATCH 10/18] ARM: DaVinci - Move serial platform_device into SoC-specific files
On Fri, 3 Apr 2009 10:42:09 -0700 "Mark A. Greer" wrote: > On Fri, Apr 03, 2009 at 12:55:36PM -0500, Hugo Villeneuve wrote: > > On Fri, 3 Apr 2009 08:55:41 -0700 > > "Mark A. Greer" wrote: > > > > > On Tue, Mar 31, 2009 at 01:43:41PM -0700, David Brownell wrote: > > > > On Tuesday 31 March 2009, Mark A. Greer wrote: > > > > > The serial infrastructure is pretty limited WRT this (I have > > > > > same issue on da830 evm--I only want to use uart2). > > > > > > > > Couldn't you add some kind of "ignore this one" flag to that > > > > infrastructure, and just have DaVinci use it? > > > > > > > > This issue is hardly new to DaVinci chips, it's a longstanding > > > > annoyance. Happens on x86 too, ISTR ... > > > > > > Well, I wasted more of my life than I care to admit trying to > > > better understand (and tweak) the intricacies of the serial > > > subsystem and I'm not going to waste any more. > > > > > > If someone else wants to do this, they get a gold star. > > > > > > Hugo, I'm sorry but I'm going to back out most of your patch since > > > pretty much everyone (except you) agrees that misnaming uart2 is > > > unacceptable. > > > > I don't disagree, I just don't care, which is not the same :) > > :) > > > First point: Before my patch, if you tried to enable UART0, UART1 > > and UART2, everything was fine. But if you tried to enable only > > UART0 and UART2, it failed miserably -> This is a BUG. > > > > Second point: If you remove what I did, how will you handle the > > case when I need to enable only UART0 and UART2? > > I'll remove setting the flag to 0 but that doesn't really help since > serial8250_register_port() will fail on uart1 and, IIRC, stop there. > > I'm not saying there isn't a bug, I'm just saying we're swapping one > bug for another so I'm going back to the original bug. Sorry but having /dev/ttyS1 for UART2 may not be ideal, but it is not a bug. > What happens if you leave uart1 enabled on you board? I don't think it will explode :) ...but this is not right. Hugo V. > > > If you don't care what uart2 is called, then why not > > > tweak the plat_serial8250_port data? > > > > Then it means that the serial platform data would need to go into > > the board setup code (board-sffsdr.c), and not into dm644x.c for > > example. If this is done like that, I don't mind, but it will need > > to be done for all the boards for consistency. > > If/when my patches are enabled, that data will be pointed to by > soc_info pointer so you can change it in your board before calling > davinci_serial_init(). > > Mark > -- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: Kernel and U-boot status for DM355 EVM
On Wed, 22 Apr 2009 13:12:38 -0700 David Brownell wrote: > On Wednesday 22 April 2009, Jean-Philippe François wrote: > > Hi, > > > > I have been looking at the wiki, and could not find what is the > > current status of support for DM355 EVM > > > > Davinci git kernel tree seems to support some part of the DM355. > > Most non-Video parts work fine, other than 4-bit ECC on the NAND. > (Audio has some dropout issues; it should buffer in SRAM not DRAM.) > I have no idea about the video parts. > > > > U-boot also as some support for davinci boards, but from the wiki I > > understood that for the DM355 there was some TI provided code I > > could not find a link too. > > > > Here is the quote from the wiki : > > DM355 and similar recent DaVinci chips aren't yet supported in > > mainline U-Boot; use the code supplied by TI. > > > > Is there an online, updated version of this code, or should I use > > the DVSDK CD ? > > LSP 2.00 beta includes a 1.2.0 u-boot version. > > > https://www-a.ti.com/downloads/sds_support/targetcontent/psp/mv_lsp_2_00/index.html > > I have some patches that get the 2009.03-git versions of U-Boot > behaving with the DM355 EVM. Several of them have been submitted > for merge with u-boot, but most of that merging seems like it will > happen after 2009.05 goes out. (Or maybe not; I can't make sense > of what the merge plans are.) > > There's a dm9000 fix for reading bytes of the Ethernet address, > but other than that boot over Ethernet works ... and that's it. > I've not tried the USB support; USB host support seems to works fine for us so far, but we didn't test it extensively. We can access a USB key in HOST mode. Hugo V. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [U-Boot] U-Boot and CONFIG_SYS_DAVINCI_BROKEN_ECC
On Sun, 26 Apr 2009 16:56:40 -0700 David Brownell wrote: > On Sunday 26 April 2009, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > > > > > Before I submit a patch to remove it from U-Boot GIT (nothing > > > > > there enables it, and it will nastify 4-bit support), I > > > > > thought I'd see if anyone knows exactly what software it was > > > > > trying to emulate. ... > > > > > > > > maybe add it in the feature-removal-schedule.txt > > > > will let people time to explain why they need it > > > > > > Hm... I don't think this is needed. > > > > > > Since there are no users of this code in U-Boot, we can as well > > > remove it without warning. > > That was my thought. If it were important enough to keep in > *this* source base, someone would have submitted some board > that uses it. It's badly enough broken that I don't know who > would bother using it, though; anyone trying to use it has some > kind of (non-Linux?) support nightmare already. > > > > no necessarelly the boards Maintainer choose to use the other ECC > > but part of the U-Boot user may need it. > > So add it in the removal schedule make sense. We can evenif plan it > > for the next Release. > > I wouldn't mind doing that. > > > > > > After my only request will be to use the same ECC as the > > > > mainline kernel or if someone explain why he need it add on > > > > other ECC algo > > Right, mainline does not use that "broken" ECC. I can't > figure out who *does* use it, either... We certainly don't use it for the SFFSDR board. Hugo V. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Passing MAC address from U-Boot to kernel via command line
Hi all, I am wondering if there is still a way to pass the MAC address from U-Boot to the Linux kernel DaVinci EMAC driver with the command line parameters... There was a way a few weeks ago, but this code seems to have been removed (i2c-emac.c). Thank-you, Hugo v. Hugo Villeneuve Hardware developer | Concepteur matériel Lyrtech Phone/Tél. : (1) (418) 877-4644 #2395 Toll-free/Sans frais — Canada & USA : (1) (888) 922-4644 #2395 Fax/Téléc. : (1) (418) 877-7710 www.lyrtech.com Infinite possibilities…TM ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH] Add Right-Justified mode and Codec clock master to davinci-i2s driver
Add Right-Justified mode and Codec clock master to davinci-i2s driver The EVM board uses the SND_SOC_DAIFMT_CBM_CFM & I2S formats, but the SFFSDR board uses the SND_SOC_DAIFMT_CBM_CFS & RIGHT-JUSTIFIED formats Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> --- sound/soc/davinci/davinci-i2s.c | 40 -- 1 files changed, 33 insertions(+), 7 deletions(-) diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c index 5ebf1ff..0ef76c0 100644 --- a/sound/soc/davinci/davinci-i2s.c +++ b/sound/soc/davinci/davinci-i2s.c @@ -59,6 +59,7 @@ #define DAVINCI_MCBSP_PCR_CLKXP(1 << 1) #define DAVINCI_MCBSP_PCR_FSRP (1 << 2) #define DAVINCI_MCBSP_PCR_FSXP (1 << 3) +#define DAVINCI_MCBSP_PCR_SCLKME (1 << 7) #define DAVINCI_MCBSP_PCR_CLKRM(1 << 8) #define DAVINCI_MCBSP_PCR_CLKXM(1 << 9) #define DAVINCI_MCBSP_PCR_FSRM (1 << 10) @@ -171,6 +172,16 @@ static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai, davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SRGR_REG, DAVINCI_MCBSP_SRGR_FSGM); break; + case SND_SOC_DAIFMT_CBM_CFS: + /* McBSP CLKR pin is the input for the Sample Rate Generator. +* McBSP FSR and FSX are driven by the Sample Rate Generator. */ + davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_PCR_REG, + DAVINCI_MCBSP_PCR_SCLKME | + DAVINCI_MCBSP_PCR_FSXM | + DAVINCI_MCBSP_PCR_FSRM); + davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SRGR_REG, + DAVINCI_MCBSP_SRGR_FSGM); + break; case SND_SOC_DAIFMT_CBM_CFM: davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_PCR_REG, 0); break; @@ -205,6 +216,28 @@ static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai, return -EINVAL; } + switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { + case SND_SOC_DAIFMT_RIGHT_J: + davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, + DAVINCI_MCBSP_RCR_RFRLEN1(1) | + DAVINCI_MCBSP_RCR_RDATDLY(0)); + davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, + DAVINCI_MCBSP_XCR_XFRLEN1(1) | + DAVINCI_MCBSP_XCR_XDATDLY(0) | + DAVINCI_MCBSP_XCR_XFIG); + break; + case SND_SOC_DAIFMT_I2S: + default: + davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, + DAVINCI_MCBSP_RCR_RFRLEN1(1) | + DAVINCI_MCBSP_RCR_RDATDLY(1)); + davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, + DAVINCI_MCBSP_XCR_XFRLEN1(1) | + DAVINCI_MCBSP_XCR_XDATDLY(1) | + DAVINCI_MCBSP_XCR_XFIG); + break; + } + return 0; } @@ -223,13 +256,6 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream, DAVINCI_MCBSP_SPCR_RINTM(3) | DAVINCI_MCBSP_SPCR_XINTM(3) | DAVINCI_MCBSP_SPCR_FREE); - davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, - DAVINCI_MCBSP_RCR_RFRLEN1(1) | - DAVINCI_MCBSP_RCR_RDATDLY(1)); - davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, - DAVINCI_MCBSP_XCR_XFRLEN1(1) | - DAVINCI_MCBSP_XCR_XDATDLY(1) | - DAVINCI_MCBSP_XCR_XFIG); i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS); w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SRGR_REG); ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 3/4] ARM DaVinci: Add PCM3008 soc ALSA driver for the Lyrtech SFFSDR board
From: Hugo Villeneuve <[EMAIL PROTECTED]> ARM DaVinci: Add PCM3008 soc ALSA driver for the Lyrtech SFFSDR board The PCM3008 is used on the Lyrtech SFFSDR board, with an FPGA that generates the bit clock and the master clock Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> --- sound/soc/codecs/Kconfig |4 + sound/soc/codecs/Makefile |2 + sound/soc/codecs/pcm3008.c | 223 sound/soc/codecs/pcm3008.h | 25 sound/soc/davinci/Kconfig |9 ++ sound/soc/davinci/Makefile |2 + sound/soc/davinci/davinci-sffsdr.c | 138 ++ 7 files changed, 403 insertions(+), 0 deletions(-) diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index b1a5eed..21479ac 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -5,6 +5,10 @@ config SND_SOC_AC97_CODEC config SND_SOC_AK4535 tristate +config SND_SOC_PCM3008 + tristate + depends on LYRTECH_SFFSDR_FPGA + config SND_SOC_UDA1380 tristate diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index a519ced..53afbcb 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -1,5 +1,6 @@ snd-soc-ac97-objs := ac97.o snd-soc-ak4535-objs := ak4535.o +snd-soc-pcm3008-objs := pcm3008.o snd-soc-uda1380-objs := uda1380.o snd-soc-wm8510-objs := wm8510.o snd-soc-wm8731-objs := wm8731.o @@ -14,6 +15,7 @@ snd-soc-twl4030-objs := twl4030.o obj-$(CONFIG_SND_SOC_AC97_CODEC) += snd-soc-ac97.o obj-$(CONFIG_SND_SOC_AK4535) += snd-soc-ak4535.o +obj-$(CONFIG_SND_SOC_PCM3008) += snd-soc-pcm3008.o obj-$(CONFIG_SND_SOC_UDA1380) += snd-soc-uda1380.o obj-$(CONFIG_SND_SOC_WM8510) += snd-soc-wm8510.o obj-$(CONFIG_SND_SOC_WM8731) += snd-soc-wm8731.o diff --git a/sound/soc/codecs/pcm3008.c b/sound/soc/codecs/pcm3008.c new file mode 100644 index 000..c738a5d --- /dev/null +++ b/sound/soc/codecs/pcm3008.c @@ -0,0 +1,223 @@ +/* + * ALSA Soc PCM3008 codec support + * + * Author: Hugo Villeneuve + * Copyright (C) 2008 Lyrtech inc + * + * Based on AC97 Soc codec, original copyright follow: + * + * Copyright 2005 Wolfson Microelectronics PLC. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * Generic PCM3008 support. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include <../../../drivers/char/sffsdr_fpga/chardev.h> + +#include "pcm3008.h" + +#define PCM3008_VERSION "0.1" + +#define PCM3008_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ + SNDRV_PCM_RATE_48000) + +static int pcm3008_hw_params(struct snd_pcm_substream *substream, +struct snd_pcm_hw_params *params) +{ + int fs; + + /* Fsref can be 32000, 44100 or 48000. */ + fs = params_rate(params); + + printk(KERN_INFO "pcm3008_hw_params: rate = %d Hz\n", fs); + + return sffsdr_fpga_set_codec_fs(fs); +} + +struct snd_soc_dai pcm3008_dai = { + .name = "PCM3008 HiFi", + .type = SND_SOC_DAI_I2S, + .playback = { + .stream_name = "PCM3008 Playback", + .channels_min = 1, + .channels_max = 2, + .rates = PCM3008_RATES, + .formats = SNDRV_PCM_FMTBIT_S16_LE, + }, + .capture = { + .stream_name = "PCM3008 Capture", + .channels_min = 1, + .channels_max = 2, + .rates = PCM3008_RATES, + .formats = SNDRV_PCM_FMTBIT_S16_LE, + }, + .ops = { + .hw_params = pcm3008_hw_params, + }, +}; +EXPORT_SYMBOL_GPL(pcm3008_dai); + +static int pcm3008_soc_probe(struct platform_device *pdev) +{ + struct snd_soc_device *socdev = platform_get_drvdata(pdev); + struct snd_soc_codec *codec; + struct pcm3008_setup_data *setup = socdev->codec_data; + int ret = 0; + + printk(KERN_INFO "PCM3008 SoC Audio Codec %s\n", PCM3008_VERSION); + + socdev->codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL); + if (!socdev->codec) + return -ENOMEM; + + codec = socdev->codec; + mutex_init(&codec->mutex); + + codec->name = "PCM3008"; + codec->owner = THIS_MODULE; + codec->dai = &pcm3008_dai; + codec->num_dai = 1; + codec->write = NULL; + codec->read = NULL; + INIT_LIST_HEAD(&codec->dapm_widgets); + INIT_LIST_HEAD(&codec->dapm_paths); + + /* Register PCMs. */ + ret = snd_soc_new_pcms(socdev, SNDRV_DE
[PATCH 1/4] ARM DaVinci: Add support for the Lyrtech SFFSDR board
From: Hugo Villeneuve <[EMAIL PROTECTED]> ARM DaVinci: Add support for the Lyrtech SFFSDR board The Lyrtech SFFSDR (Small form Factor Software Defined Radio) board is built around a TI DM6446 and a Xilinx Virtex-4 FPGA Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> --- arch/arm/mach-davinci/Kconfig|8 ++ arch/arm/mach-davinci/Makefile |1 + arch/arm/mach-davinci/board-sffsdr.c | 225 ++ 3 files changed, 234 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig index fd3f8bd..8c13092 100644 --- a/arch/arm/mach-davinci/Kconfig +++ b/arch/arm/mach-davinci/Kconfig @@ -18,6 +18,14 @@ config MACH_DAVINCI_EVM Configure this option to specify the whether the board used for development is a DaVinci EVM +config MACH_DAVINCI_SFFSDR + bool "Lyrtech SFFSDR" + default n + depends on ARCH_DAVINCI644x + help + Say Y here to select the Lyrtech Small Form Factor + Software Defined Radio (SFFSDR) board. + config DAVINCI_MCBSP bool prompt "DaVinci McBSP Driver" if SOUND_DAVINCI=n diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile index 945ee80..28232c4 100644 --- a/arch/arm/mach-davinci/Makefile +++ b/arch/arm/mach-davinci/Makefile @@ -9,4 +9,5 @@ obj-y := time.o irq.o clock.o serial.o io.o id.o psc.o \ # Board specific obj-$(CONFIG_MACH_DAVINCI_EVM) += board-evm.o +obj-$(CONFIG_MACH_DAVINCI_SFFSDR) += board-sffsdr.o obj-$(CONFIG_DAVINCI_MCBSP)+= mcbsp.o diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c new file mode 100644 index 000..d02890f --- /dev/null +++ b/arch/arm/mach-davinci/board-sffsdr.c @@ -0,0 +1,225 @@ +/* + * Lyrtech SFFSDR board support. + * + * Copyright (C) 2008 Philip Balister, OpenSDR <[EMAIL PROTECTED]> + * Copyright (C) 2008 Lyrtech + * + * Based on DV-EVM platform, original copyright follows: + * + * Copyright (C) 2007 MontaVista Software, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +/* other misc. init functions */ +void __init davinci_psc_init(void); +void __init davinci_irq_init(void); +void __init davinci_map_common_io(void); +void __init davinci_init_common_hw(void); + +#if defined(CONFIG_MTD_NAND_DAVINCI) +struct mtd_partition davinci_sffsdr_nandflash_partition[] = { + /* U-Boot Environment: Block 0 +* UBL:Block 1 +* U-Boot: Blocks 6-7 (256 kb) +* Integrity Kernel: Blocks 8-31 (3 Mb) +* Integrity Data: Blocks 100-END +*/ + { + .name = "Linux Kernel", + .offset = 32 * SZ_128K, + .size = 16 * SZ_128K, /* 2 Mb */ + .mask_flags = MTD_WRITEABLE, /* Force read-only */ + }, + { + .name = "Linux ROOT", + .offset = MTDPART_OFS_APPEND, + .size = 256 * SZ_128K, /* 32 Mb */ + .mask_flags = 0, /* R/W */ + }, +}; + +static struct flash_platform_data davinci_sffsdr_nandflash_data = { + .parts = davinci_sffsdr_nandflash_partition, + .nr_parts = ARRAY_SIZE(davinci_sffsdr_nandflash_partition), +}; + +static struct resource davinci_sffsdr_nandflash_resource = { + .start = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE, + .end= DAVINCI_ASYNC_EMIF_DATA_CE0_BASE + SZ_16M - 1, + .flags = IORESOURCE_MEM, +}; + +static struct platform_device davinci_sffsdr_nandflash_device = { + .name = "davinci_nand", /* Name of driver */ + .id = 0, + .dev= { + .platform_data = &davinci_sffsdr_nandflash_data, + }, + .num_resources = 1, + .resource = &davinci_sffsdr_nandflash_resource, +};
[PATCH 2/4] ARM DaVinci: Add FPGA driver for the Lyrtech SFFSDR board
From: Hugo Villeneuve <[EMAIL PROTECTED]> ARM DaVinci: Add FPGA driver for the Lyrtech SFFSDR board This driver loads a bitstream into the FPGA using the SelectMAP parallel interface Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> --- drivers/char/Kconfig | 12 + drivers/char/Makefile |2 + drivers/char/sffsdr_fpga/Makefile |6 + drivers/char/sffsdr_fpga/bitstream_load.c | 353 ++ drivers/char/sffsdr_fpga/bitstream_load.h | 53 drivers/char/sffsdr_fpga/chardev.c| 387 + drivers/char/sffsdr_fpga/chardev.h| 53 drivers/char/sffsdr_fpga/common.h | 43 drivers/char/sffsdr_fpga/sffsdr_fpga0.h | 72 ++ 9 files changed, 981 insertions(+), 0 deletions(-) diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index caff851..8668730 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -1104,5 +1104,17 @@ config DEVPORT source "drivers/s390/char/Kconfig" +config LYRTECH_SFFSDR_FPGA + tristate "Lyrtech SFFSDR FPGA Driver Support" + depends on ARCH_DAVINCI && MACH_DAVINCI_SFFSDR + help + This option enables support for the Lyrtech SFFSDR + FPGA access driver. + + To compile this driver as a module, choose M here: the + module will be called sffsdr_fpga. + + If unsure, say N. + endmenu diff --git a/drivers/char/Makefile b/drivers/char/Makefile index 6850f6d..3b62030 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile @@ -106,6 +106,8 @@ obj-$(CONFIG_IPMI_HANDLER) += ipmi/ obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o obj-$(CONFIG_TCG_TPM) += tpm/ +obj-$(CONFIG_LYRTECH_SFFSDR_FPGA) += sffsdr_fpga/ + obj-$(CONFIG_PS3_FLASH)+= ps3flash.o obj-$(CONFIG_JS_RTC) += js-rtc.o diff --git a/drivers/char/sffsdr_fpga/Makefile b/drivers/char/sffsdr_fpga/Makefile new file mode 100644 index 000..e6c6a97 --- /dev/null +++ b/drivers/char/sffsdr_fpga/Makefile @@ -0,0 +1,6 @@ +# +# Makefile for the Lyrtech SFFSDR FPGA access driver +# + +obj-$(CONFIG_LYRTECH_SFFSDR_FPGA) += sffsdr_fpga.o +sffsdr_fpga-objs := bitstream_load.o chardev.o diff --git a/drivers/char/sffsdr_fpga/bitstream_load.c b/drivers/char/sffsdr_fpga/bitstream_load.c new file mode 100644 index 000..a0a5303 --- /dev/null +++ b/drivers/char/sffsdr_fpga/bitstream_load.c @@ -0,0 +1,353 @@ +/* + * FPGA bitstream loader on the + * SFF-SDR development board. + * + * Copyright (C) 2008 Lyrtech + * + * The FPGA is loaded using the SelectMAP mode through + * the EMIF interface and some dedicated control signals: + * + * FPGA DM6446 + * + * PROGRAM_B GPIO37 + * DONE GPIO39 + * INIT GPIO40 + * DOUT_BUSY GPIO42 + * CS_B EMIF_A13 OR CS3n + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "sffsdr_fpga0.h" +#include "bitstream_load.h" + +/* Select MAP register address. */ +#define FPGA_SELECT_MAP_REG_OFFSET 0x + +#define FPGA_DONE_TIMEOUT 10 + +#define BITSTREAM_SYNC_BYTE1 (0xAA) +#define BITSTREAM_SYNC_BYTE2 (0x99) +#define BITSTREAM_SYNC_BYTE3 (0x55) +#define BITSTREAM_SYNC_BYTE4 (0x66) + +#define BITSTREAM_PACKET_HEADER_TYPE1 (1) +#define BITSTREAM_PACKET_HEADER_TYPE2 (2) + +#define BITSTREAM_TYPE1_OPCODE_WRITE (2) + +#define BITSTREAM_TYPE1_REG_ADDR_FDRI (2) + +/* The Virtex-4 device only drives BUSY during readback. + * Define this to check the state of thwe BUSY pin before each write. */ +#undef SFFSDR_FPGA_CHECK_BUSY_PIN + +/* Structure of a TYPE1 packet. */ +struct type1_packet_t { + uint32_t word_count:11; + uint32_t reserved2:2; + uint32_t address:5; + uint32_t reserved1:9; + uint32_t opcode:2; + uint32_t header:3; +}; + +/* Structure of a TYPE2 packet. */ +struct type2_packet_t { + uint32_t word_count:27; + uint32_t opcode:2; /* Reserved. */ + uint32_t header:3; +}; + +static void *fpga_mmio_addr; +static u8 fpg
[PATCH 4/4] ARM DaVinci: Add defconfig for the Lyrtech SFFSDR board
From: Hugo Villeneuve <[EMAIL PROTECTED]> ARM DaVinci: Add defconfig for the Lyrtech SFFSDR board Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> --- arch/arm/configs/davinci_sffsdr_defconfig | 1113 + 1 files changed, 1113 insertions(+), 0 deletions(-) diff --git a/arch/arm/configs/davinci_sffsdr_defconfig b/arch/arm/configs/davinci_sffsdr_defconfig new file mode 100644 index 000..50e80cd --- /dev/null +++ b/arch/arm/configs/davinci_sffsdr_defconfig @@ -0,0 +1,1113 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.27-rc6-davinci1 +# Thu Oct 16 17:41:16 2008 +# +CONFIG_ARM=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_GENERIC_GPIO=y +CONFIG_GENERIC_TIME=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_MMU=y +# CONFIG_NO_IOPORT is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_ARCH_SUPPORTS_AOUT=y +CONFIG_ZONE_DMA=y +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +CONFIG_VECTORS_BASE=0x +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +# CONFIG_SWAP is not set +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_TASKSTATS is not set +# CONFIG_AUDIT is not set +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_CGROUPS is not set +# CONFIG_GROUP_SCHED is not set +CONFIG_SYSFS_DEPRECATED=y +CONFIG_SYSFS_DEPRECATED_V2=y +# CONFIG_RELAY is not set +# CONFIG_NAMESPACES is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y +CONFIG_EMBEDDED=y +CONFIG_UID16=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +# CONFIG_COMPAT_BRK is not set +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_ANON_INODES=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +# CONFIG_SHMEM is not set +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +# CONFIG_PROFILING is not set +# CONFIG_MARKERS is not set +CONFIG_HAVE_OPROFILE=y +# CONFIG_KPROBES is not set +# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set +# CONFIG_HAVE_IOREMAP_PROT is not set +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +# CONFIG_HAVE_ARCH_TRACEHOOK is not set +# CONFIG_HAVE_DMA_ATTRS is not set +# CONFIG_USE_GENERIC_SMP_HELPERS is not set +CONFIG_HAVE_CLK=y +CONFIG_PROC_PAGE_MONITOR=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +CONFIG_TINY_SHMEM=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_LOAD is not set +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y +CONFIG_BLOCK=y +# CONFIG_LBD is not set +# CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_LSF is not set +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +CONFIG_IOSCHED_DEADLINE=y +# CONFIG_IOSCHED_CFQ is not set +# CONFIG_DEFAULT_AS is not set +CONFIG_DEFAULT_DEADLINE=y +# CONFIG_DEFAULT_CFQ is not set +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="deadline" +CONFIG_CLASSIC_RCU=y + +# +# System Type +# +# CONFIG_ARCH_AAEC2000 is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_REALVIEW is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_AT91 is not set +# CONFIG_ARCH_CLPS7500 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_EP93XX is not set +# CONFIG_ARCH_FOOTBRIDGE is not set +# CONFIG_ARCH_NETX is not set +# CONFIG_ARCH_H720X is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_IOP13XX is not set +# CONFIG_ARCH_IOP32X is not set +# CONFIG_ARCH_IOP33X is not set +# CONFIG_ARCH_IXP23XX is not set +# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_KIRKWOOD is not set +# CONFIG_ARCH_KS8695 is not set +# CONFIG_ARCH_NS9XXX is not set +# CONFIG_ARCH_LOKI is not set +# CONFIG_ARCH_MV78XX0 is not set +# CONFIG_ARCH_MXC is not set +# CONFIG_ARCH_ORION5X is not set +# CONFIG_ARCH_PNX4008 is not set +# CONFIG_ARCH_PXA is not set +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_SA1100 is not set +# CONFIG_ARCH_S3C2410 is not set +# CONFIG_ARCH_SHARK is not set
RE: [PATCH] Add Right-Justified mode and Codec clock master todavinci-i2s driver
[EMAIL PROTECTED] wrote: > Add Right-Justified mode and Codec clock master to davinci-i2s driver > > The EVM board uses the SND_SOC_DAIFMT_CBM_CFM & I2S formats, but the > SFFSDR board uses the SND_SOC_DAIFMT_CBM_CFS & RIGHT-JUSTIFIED > formats > > Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> > --- > sound/soc/davinci/davinci-i2s.c | 40 > -- 1 files changed, 33 > insertions(+), 7 deletions(-) I just want to know if someone reviewed this patch, and the following patches that I sent to support the SFFSDR board? Thank-you, Hugo V. Hugo Villeneuve Hardware developer | Concepteur matériel Lyrtech Phone/Tél. : (1) (418) 877-4644 #2395 Toll-free/Sans frais - Canada & USA : (1) (888) 922-4644 #2395 Fax/Téléc. : (1) (418) 877-7710 www.lyrtech.com Infinite possibilities...TM ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Status of linux-davinci-2.6 git kernel
Hi, Over two weeks ago I sent patches to add functionality and a new board to the linux-davinci-2.6 kernel. So far, I haven't received any responses as to know if my patches will be accepted or not. Is there a maintainer for the linux-davinci-2.6 git kernel? Are patches for new boards based on DaVinci accepted into this kernel? Thank-you, Hugo Villeneuve. Hugo Villeneuve Hardware developer | Concepteur matériel Lyrtech Phone/Tél. : (1) (418) 877-4644 #2395 Toll-free/Sans frais — Canada & USA : (1) (888) 922-4644 #2395 Fax/Téléc. : (1) (418) 877-7710 www.lyrtech.com Infinite possibilities…TM ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
RE: Status of linux-davinci-2.6 git kernel
Kevin Hilman wrote: > "Hugo Villeneuve" <[EMAIL PROTECTED]> writes: > >> Over two weeks ago I sent patches to add functionality and a new >> board to the linux-davinci-2.6 kernel. So far, I haven't received >> any responses as to know if my patches will be accepted or not. >> >> Is there a maintainer for the linux-davinci-2.6 git kernel? >> >> Are patches for new boards based on DaVinci accepted into this >> kernel? >> > > Hugo, > > Sorry for not getting back to you sooner. Earlier this month I > contacted the other folks who hat submitted patches to tell them I > would not have the time to look at patches until the end of October, > but looks like I left you out. Sorry. > > I left my previous job and started my own small consulting business, > so while getting my business off the ground I have not had time to > work on DaVinci git. > > Starting next week, I will be back to regular patch review and > integration on DaVinci git. TI will now be sponsoring some of my > work, so that will help keep me focused as well. ;) > > Sorry for the poor communication, > > Kevin Hi Kevin, Thank-you for your response. I will wait for your feedback then :) Hugo V. Hugo Villeneuve Hardware developer | Concepteur matériel Lyrtech Phone/Tél. : (1) (418) 877-4644 #2395 Toll-free/Sans frais - Canada & USA : (1) (888) 922-4644 #2395 Fax/Téléc. : (1) (418) 877-7710 www.lyrtech.com Infinite possibilities...TM ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
RE: Serial Loader poll.
[EMAIL PROTECTED] wrote: > The utility should work under either Windows or Linux. If run under > Linux, it requires that Mono be installed. There have been a few > reports of problems using it under some versions of Linux when a USB > to Serial adaptor is used instead of a serial port. DVFlasher doesn´t work on Linux for me even when using a true serial port. Hugo Villeneuve. Hugo Villeneuve Hardware developer | Concepteur matériel Lyrtech Phone/Tél. : (1) (418) 877-4644 #2395 Toll-free/Sans frais - Canada & USA : (1) (888) 922-4644 #2395 Fax/Téléc. : (1) (418) 877-7710 www.lyrtech.com Infinite possibilities...TM ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH] ARM DaVinci: Add Right-Justified mode and Codec clock master to davinci-i2s
From: Hugo Villeneuve <[EMAIL PROTECTED]> ARM DaVinci: Add Right-Justified mode and Codec clock master to davinci-i2s The TI DVEVM board uses the SND_SOC_DAIFMT_CBM_CFM & I2S formats, but the Lyrtech SFFSDR board uses the SND_SOC_DAIFMT_CBM_CFS & RIGHT-JUSTIFIED formats. Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> --- sound/soc/davinci/davinci-i2s.c | 40 -- 1 files changed, 33 insertions(+), 7 deletions(-) diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c index abb5fed..d814ec8 100644 --- a/sound/soc/davinci/davinci-i2s.c +++ b/sound/soc/davinci/davinci-i2s.c @@ -59,6 +59,7 @@ #define DAVINCI_MCBSP_PCR_CLKXP(1 << 1) #define DAVINCI_MCBSP_PCR_FSRP (1 << 2) #define DAVINCI_MCBSP_PCR_FSXP (1 << 3) +#define DAVINCI_MCBSP_PCR_SCLKME (1 << 7) #define DAVINCI_MCBSP_PCR_CLKRM(1 << 8) #define DAVINCI_MCBSP_PCR_CLKXM(1 << 9) #define DAVINCI_MCBSP_PCR_FSRM (1 << 10) @@ -171,6 +172,16 @@ static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai, davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SRGR_REG, DAVINCI_MCBSP_SRGR_FSGM); break; + case SND_SOC_DAIFMT_CBM_CFS: + /* McBSP CLKR pin is the input for the Sample Rate Generator. +* McBSP FSR and FSX are driven by the Sample Rate Generator. */ + davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_PCR_REG, + DAVINCI_MCBSP_PCR_SCLKME | + DAVINCI_MCBSP_PCR_FSXM | + DAVINCI_MCBSP_PCR_FSRM); + davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SRGR_REG, + DAVINCI_MCBSP_SRGR_FSGM); + break; case SND_SOC_DAIFMT_CBM_CFM: davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_PCR_REG, 0); break; @@ -205,6 +216,28 @@ static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai, return -EINVAL; } + switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { + case SND_SOC_DAIFMT_RIGHT_J: + davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, + DAVINCI_MCBSP_RCR_RFRLEN1(1) | + DAVINCI_MCBSP_RCR_RDATDLY(0)); + davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, + DAVINCI_MCBSP_XCR_XFRLEN1(1) | + DAVINCI_MCBSP_XCR_XDATDLY(0) | + DAVINCI_MCBSP_XCR_XFIG); + break; + case SND_SOC_DAIFMT_I2S: + default: + davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, + DAVINCI_MCBSP_RCR_RFRLEN1(1) | + DAVINCI_MCBSP_RCR_RDATDLY(1)); + davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, + DAVINCI_MCBSP_XCR_XFRLEN1(1) | + DAVINCI_MCBSP_XCR_XDATDLY(1) | + DAVINCI_MCBSP_XCR_XFIG); + break; + } + return 0; } @@ -223,13 +256,6 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream, DAVINCI_MCBSP_SPCR_RINTM(3) | DAVINCI_MCBSP_SPCR_XINTM(3) | DAVINCI_MCBSP_SPCR_FREE); - davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, - DAVINCI_MCBSP_RCR_RFRLEN1(1) | - DAVINCI_MCBSP_RCR_RDATDLY(1)); - davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, - DAVINCI_MCBSP_XCR_XFRLEN1(1) | - DAVINCI_MCBSP_XCR_XDATDLY(1) | - DAVINCI_MCBSP_XCR_XFIG); i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS); w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SRGR_REG); ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
RE: [alsa-devel] [PATCH] ARM DaVinci: Add Right-Justified mode and Codec clock master to davinci-i2s
Mark Brown wrote: > On Sat, Nov 08, 2008 at 01:26:09PM -0500, [EMAIL PROTECTED] > wrote: >> From: Hugo Villeneuve <[EMAIL PROTECTED]> > >> ARM DaVinci: Add Right-Justified mode and Codec clock master to >> davinci-i2s > > Not a big deal but you shouldn't repeat the subject line of your patch > in the body - it causes automated tools like git am to duplicate it in > the commit mesage. That´s right. Thanks for the tip! >> The TI DVEVM board uses the SND_SOC_DAIFMT_CBM_CFM & I2S formats, >> but the Lyrtech SFFSDR board uses the SND_SOC_DAIFMT_CBM_CFS & >> RIGHT-JUSTIFIED formats. > > Is there any news on the progress of the new DaVinci DMA API to > mainline? I´m not familiar with that, maybe someone from the DaVinci list can answer. Hugo V. Hugo Villeneuve Hardware developer | Concepteur matériel Lyrtech Phone/Tél. : (1) (418) 877-4644 #2395 Toll-free/Sans frais - Canada & USA : (1) (888) 922-4644 #2395 Fax/Téléc. : (1) (418) 877-7710 www.lyrtech.com Infinite possibilities...TM ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
RE: [PATCH 1/4] ARM DaVinci: Add support for the Lyrtech SFFSDR board
Kevin Hilman wrote: > [EMAIL PROTECTED] writes: > >> From: Hugo Villeneuve <[EMAIL PROTECTED]> >> >> ARM DaVinci: Add support for the Lyrtech SFFSDR board >> >> The Lyrtech SFFSDR (Small form Factor Software Defined Radio) board >> is built around a TI DM6446 and a Xilinx Virtex-4 FPGA >> >> Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> > > Hi Hugo, > > Thanks for the support for this new board. I'm just about ready to > push your board support, but I'd like a few minor changes. > > Your patch does some of the same things that the dm355 patch does that > I will be reworking slightly. > > Could you please rework your patch on top of the 'tmp/ti-staging-2' > branch? In doing so, you can rework some things that I will note > below. Ok, no problem. I will do that today or during the weekend. >> +/* other misc. init functions */ >> +void __init davinci_psc_init(void); >> +void __init davinci_irq_init(void); >> +void __init davinci_map_common_io(void); >> +void __init davinci_init_common_hw(void); > > Please drop these declarations. Instead, add > > #include > #include > > Which contain the declarations. Ok. >> +#if defined(CONFIG_MTD_NAND_DAVINCI) > > Your #if only catches when NAND is built-in, so it wont work if NAND > is built as a module. > > But in any case, you should drop these #ifs all together in board init > code. The upstream preference is to always compile these in just in > case a driver is built later and then can be loaded as a module. Ok, it makes sense. >> +#if defined(CONFIG_TI_DAVINCI_EMAC) > > Please drop the #ifdef Ok. >> +/* Get Ethernet address from kernel boot params */ >> +static u8 davinci_sffsdr_mac_addr[6] = {0xFF, 0xFF, 0xFF, 0xFF, >> 0xFF, 0xFF}; +#endif /* CONFIG_TI_DAVINCI_EMAC) */ >> + >> +static struct at24_platform_data eeprom_info = { >> +.byte_len = (64*1024) / 8, >> +.page_size = 32, >> +.flags = AT24_FLAG_ADDR16, >> +}; >> + >> +static struct i2c_board_info __initdata i2c_info[] = { + { >> +I2C_BOARD_INFO("24LC64", 0x50), >> +.platform_data = &eeprom_info, >> +}, >> +/* Other I2C devices: >> + * MSP430, addr 0x23 >> + * PCA9543, addr 0x70 (setup done by U-Boot) >> + * ADS7828, addr 0x48 (ADC for voltage monitoring.) +*/ >> +}; > > Does your board also have a MAC in this EEPROM? If so could > you use that like the dm6446 EVM board code does? The thing is that we must parse a structure and do some computations to extract the MAC address, and this code is already present in U-Boot. I think it is more logical for the bootloader to simply pass the MAC address to the kernel, instead of duplicating the code that extracts the MAC address from the EEPROM. Is there an official mechanism that we could use to pass information like that from U-Boot to Linux? >> +/* The msp430 uses a slow bitbanged I2C implementation (ergo 20 >> KHz), + * which requires 100 usec of idle bus after i2c writes sent >> to it. + */ > > Does your board really have the same msp430 firmware problem as the > DM6446 EVM? Or is this a cut-and-paste problem? Our board also has a MSP430 with a bitbang I2C, but it currently doesn´t work. I will remove that part. >> +static struct davinci_i2c_platform_data i2c_pdata = { + .bus_freq >> = >> 20 /* kHz */, + .bus_delay = 100 /* usec */, >> +}; >> + >> +static void __init sffsdr_init_i2c(void) >> +{ >> +davinci_init_i2c(&i2c_pdata); >> +i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info)); +} >> + >> +static struct platform_device *davinci_sffsdr_devices[] __initdata >> = { +#if defined(CONFIG_MTD_NAND_DAVINCI) > > Drop #if >> +&davinci_sffsdr_nandflash_device, >> +#endif >> +}; >> + >> +static struct davinci_uart_config davinci_sffsdr_uart_config >> __initdata = { + .enabled_uarts = (1 << 0), +}; >> + >> +static struct davinci_board_config_kernel davinci_sffsdr_config[] >> __initdata = { + { DAVINCI_TAG_UART, &davinci_sffsdr_uart_config }, >> +}; + >> +static void __init >> +davinci_sffsdr_map_io(void) >> +{ >> +davinci_map_common_io(); >> +} >> + >> +static __init void davinci_sffsdr_init(void) >> +{ >> +davinci_psc_init(); >> +platform_add_devices(davinci_sffsdr_devices, >> + ARRAY_SIZE(davinci_sffsdr_devices)); >> +sffsdr_init_i2c(); >> +davinci_b
Error compiling in tmp/ti-staging-2 branch
I encountered the following error while trying to rebase my SFFSDR patches against the tmp/ti-staging-2 branch: make[1]: *** No rule to make target `arch/arm/mach-davinci/iram.o', needed by `arch/arm/mach-davinci/built-in.o'. Stop. make: *** [arch/arm/mach-davinci] Error 2 make: INTERNAL: Exiting with 9 jobserver tokens available; should be 8! Hugo Villeneuve. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 2/4] ARM DaVinci: Add support for the Lyrtech SFFSDR board
The Lyrtech SFFSDR (Small form Factor Software Defined Radio) board is built around a TI DM6446 and a Xilinx Virtex-4 (SX-35) FPGA. This patch adds board setup code for the SFFSDR and a device driver for the Virtex-4 FPGA. Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> --- arch/arm/mach-davinci/Kconfig | 23 ++ arch/arm/mach-davinci/Makefile|2 + arch/arm/mach-davinci/board-sffsdr.c | 223 + arch/arm/mach-davinci/sffsdr-fpga.c | 501 + include/asm-arm/plat-sffsdr/sffsdr-fpga.h | 30 ++ 5 files changed, 779 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-davinci/board-sffsdr.c create mode 100644 arch/arm/mach-davinci/sffsdr-fpga.c create mode 100644 include/asm-arm/plat-sffsdr/sffsdr-fpga.h diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig index 43b6359..0f46228 100644 --- a/arch/arm/mach-davinci/Kconfig +++ b/arch/arm/mach-davinci/Kconfig @@ -42,6 +42,29 @@ config MACH_DAVINCI_DM355_EVM Configure this option to specify the whether the board used for development is a DM355 EVM +config MACH_DAVINCI_SFFSDR + bool "Lyrtech SFFSDR" + default n + depends on ARCH_DAVINCI_DM644x + help + Say Y here to select the Lyrtech Small Form Factor + Software Defined Radio (SFFSDR) board. + +config SFFSDR_FPGA + tristate "SFFSDR SX-35 FPGA support" + default n + depends on MACH_DAVINCI_SFFSDR + select FPGALOAD + select FW_LOADER + help + This driver supports the SX-35 FPGA on the Lyrtech SFFSDR board. + Amongst other things, the FPGA is used to generate the clocks + for the audio codec and for transferring data to/from the other + stacked boards (using the EMIF or VPSS ports). + + To compile this driver as module, choose M here: the + module will be called sffsdr-fpga. + config DAVINCI_RESET_CLOCKS bool "Reset unused clocks during boot" depends on ARCH_DAVINCI diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile index 420a33e..8478220 100644 --- a/arch/arm/mach-davinci/Makefile +++ b/arch/arm/mach-davinci/Makefile @@ -11,3 +11,5 @@ obj-y := time.o irq.o clock.o serial.o io.o id.o psc.o \ obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o obj-$(CONFIG_MACH_DAVINCI_DM646X_EVM) += board-dm646x-evm.o obj-$(CONFIG_MACH_DAVINCI_DM355_EVM) += board-dm355-evm.o +obj-$(CONFIG_MACH_DAVINCI_SFFSDR) += board-sffsdr.o +obj-$(CONFIG_SFFSDR_FPGA) += sffsdr-fpga.o diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c new file mode 100644 index 000..0b03ce5 --- /dev/null +++ b/arch/arm/mach-davinci/board-sffsdr.c @@ -0,0 +1,223 @@ +/* + * Lyrtech SFFSDR board support. + * + * Copyright (C) 2008 Philip Balister, OpenSDR <[EMAIL PROTECTED]> + * Copyright (C) 2008 Lyrtech + * + * Based on DV-EVM platform, original copyright follows: + * + * Copyright (C) 2007 MontaVista Software, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x0200 + +struct mtd_partition davinci_sffsdr_nandflash_partition[] = { + /* U-Boot Environment: Block 0 +* UBL:Block 1 +* U-Boot: Blocks 6-7 (256 kb) +* Integrity Kernel: Blocks 8-31 (3 Mb) +* Integrity Data: Blocks 100-END +*/ + { + .name = "Linux Kernel", + .offset = 32 * SZ_128K, + .size = 16 * SZ_128K, /* 2 Mb */ + .mask_flags = MTD_WRITEABLE, /* Force read-only */ + }, + { + .name = "Linux ROOT", + .offset = MTDPART_OFS_APPEND, + .size = 256 * SZ_128K, /* 32 Mb */ +
[PATCH 4/4] ARM DaVinci: Add defconfig for the Lyrtech SFFSDR board
Add the /arch/arm/configs/davinci_sffsdr_defconfig file for the Lyrtech SFFSDR board Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> --- arch/arm/configs/davinci_sffsdr_defconfig | 1067 + 1 files changed, 1067 insertions(+), 0 deletions(-) create mode 100644 arch/arm/configs/davinci_sffsdr_defconfig diff --git a/arch/arm/configs/davinci_sffsdr_defconfig b/arch/arm/configs/davinci_sffsdr_defconfig new file mode 100644 index 000..d1cb666 --- /dev/null +++ b/arch/arm/configs/davinci_sffsdr_defconfig @@ -0,0 +1,1067 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.28-rc4-davinci1 +# Sun Nov 16 15:29:24 2008 +# +CONFIG_ARM=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_GENERIC_GPIO=y +CONFIG_GENERIC_TIME=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_MMU=y +# CONFIG_NO_IOPORT is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_ZONE_DMA=y +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +CONFIG_VECTORS_BASE=0x +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +# CONFIG_SWAP is not set +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_TASKSTATS is not set +# CONFIG_AUDIT is not set +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_CGROUPS is not set +# CONFIG_GROUP_SCHED is not set +# CONFIG_SYSFS_DEPRECATED_V2 is not set +# CONFIG_RELAY is not set +# CONFIG_NAMESPACES is not set +# CONFIG_BLK_DEV_INITRD is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y +CONFIG_EMBEDDED=y +CONFIG_UID16=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +# CONFIG_COMPAT_BRK is not set +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_ANON_INODES=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +# CONFIG_SHMEM is not set +CONFIG_AIO=y +# CONFIG_VM_EVENT_COUNTERS is not set +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +# CONFIG_PROFILING is not set +# CONFIG_MARKERS is not set +CONFIG_HAVE_OPROFILE=y +# CONFIG_KPROBES is not set +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +CONFIG_TINY_SHMEM=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_LOAD is not set +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y +CONFIG_BLOCK=y +# CONFIG_LBD is not set +# CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_LSF is not set +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +CONFIG_IOSCHED_DEADLINE=y +# CONFIG_IOSCHED_CFQ is not set +# CONFIG_DEFAULT_AS is not set +CONFIG_DEFAULT_DEADLINE=y +# CONFIG_DEFAULT_CFQ is not set +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="deadline" +CONFIG_CLASSIC_RCU=y +# CONFIG_FREEZER is not set + +# +# System Type +# +# CONFIG_ARCH_AAEC2000 is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_REALVIEW is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_AT91 is not set +# CONFIG_ARCH_CLPS7500 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_EP93XX is not set +# CONFIG_ARCH_FOOTBRIDGE is not set +# CONFIG_ARCH_NETX is not set +# CONFIG_ARCH_H720X is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_IOP13XX is not set +# CONFIG_ARCH_IOP32X is not set +# CONFIG_ARCH_IOP33X is not set +# CONFIG_ARCH_IXP23XX is not set +# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_KIRKWOOD is not set +# CONFIG_ARCH_KS8695 is not set +# CONFIG_ARCH_NS9XXX is not set +# CONFIG_ARCH_LOKI is not set +# CONFIG_ARCH_MV78XX0 is not set +# CONFIG_ARCH_MXC is not set +# CONFIG_ARCH_ORION5X is not set +# CONFIG_ARCH_PNX4008 is not set +# CONFIG_ARCH_PXA is not set +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_SA1100 is not set +# CONFIG_ARCH_S3C2410 is not set +# CONFIG_ARCH_SHARK is not set +# CONFIG_ARCH_LH7A40X is not set +CONFIG_ARCH_DAVINCI=y +# CONFIG_ARCH_OMAP is not set +# CONFIG_ARCH_MSM is not set + +# +# Boot options +# + +# +# Power management +# + +# +# TI DaVinci Implementations +# + +# +# DaVinci C
[PATCH 1/4] Add fpgaload, a FPGA bitstream loader
This driver is a generic interface for programming a bitstream into a Xilinx FPGA. This driver is passed a structure containing the GPIO pins to use (DONE, PROG and INIT), and a write_byte() callback to program each byte. It also supports partial reconfiguration. Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> --- drivers/misc/Kconfig | 10 + drivers/misc/Makefile|1 + drivers/misc/fpgaload.c | 430 ++ include/linux/fpgaload.h | 50 ++ 4 files changed, 491 insertions(+), 0 deletions(-) create mode 100644 drivers/misc/fpgaload.c create mode 100644 include/linux/fpgaload.h diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 4e84e90..6c2c3c8 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -500,4 +500,14 @@ config SGI_GRU_DEBUG This option enables addition debugging code for the SGI GRU driver. If you are unsure, say N. +config FPGALOAD + tristate "FPGA bitstream loader support" + help + This option enables support for the FPGA bitstream loader. + + To compile this driver as a module, choose M here: the + module will be called fpgaload. + + If unsure, say N. + endif # MISC_DEVICES diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index ed7e1d0..c9bd8e8 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -32,3 +32,4 @@ obj-$(CONFIG_KGDB_TESTS) += kgdbts.o obj-$(CONFIG_SGI_XP) += sgi-xp/ obj-$(CONFIG_SGI_GRU) += sgi-gru/ obj-$(CONFIG_HP_ILO) += hpilo.o +obj-$(CONFIG_FPGALOAD) += fpgaload.o diff --git a/drivers/misc/fpgaload.c b/drivers/misc/fpgaload.c new file mode 100644 index 000..d4f2408 --- /dev/null +++ b/drivers/misc/fpgaload.c @@ -0,0 +1,430 @@ +/* + * fpgaload driver + * + * Copyright (C) 2008 Lyrtech + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define MODULE_NAME "fpgaload" + +/* Define this to have verbose debug messages. */ +#define FPGALOAD_DEBUG 1 + +#ifdef FPGALOAD_DEBUG +#define DBGMSG(fmt, args...) \ +printk(KERN_INFO "%s: "fmt"\n" , MODULE_NAME, ## args) +#define FAILMSG(fmt, args...) \ +printk(KERN_ERR "%s: "fmt"\n" , MODULE_NAME, ## args) +#else +#define DBGMSG(fmt, args...) +#define FAILMSG(fmt, args...) +#endif + +#define FPGA_WAIT_TIMEOUT 10 +#define XFER_SIZE 100 + +#define XC3S_WORD_SIZE 2 +#define XC4V_WORD_SIZE 4 + +/* Normally, we should check if INIT_B is low during configuration, indicating + * a configuration error. But this may cause problems for bitstreams where the + * INIT_B pin is used as a GPIO after configuration. */ +/* #define CHECK_INIT_LOW_DURING_PROG 1 */ + +#define BITSTREAM_SYNC_BYTE1 (0xAA) +#define BITSTREAM_SYNC_BYTE2 (0x99) +#define BITSTREAM_SYNC_BYTE3 (0x55) +#define BITSTREAM_SYNC_BYTE4 (0x66) + +#define BITSTREAM_PACKET_HEADER_TYPE1 (1) +#define BITSTREAM_PACKET_HEADER_TYPE2 (2) + +#define BITSTREAM_TYPE1_OPCODE_WRITE (2) + +#define BITSTREAM_TYPE1_REG_ADDR_FDRI (2) + +/* Structure of a TYPE1 packet. */ +struct t1_pkt_xc4v_t { + u32 word_count:11; + u32 reserved2:2; + u32 address:5; + u32 reserved1:9; + u32 opcode:2; + u32 header:3; +}; + +struct t1_pkt_xc3s_t { + u16 word_count:5; + u16 address:6; + u16 opcode:2; + u16 header:3; /* type */ +}; + +/* Structure of a TYPE2 packet. */ +struct t2_pkt_xc4v_t { + u32 word_count:27; + u32 opcode:2; /* Reserved. */ + u32 header:3; +}; + +struct t2_pkt_xc3s_t { + u16 word_count:11; + u16 opcode:2; /* Reserved. */ + u16 header:3; +}; + +/* + * Toggles the CCLK line on the board-specific interface the number of times + * specified by . + */ +static int bitstr_load_make_clock(const struct fpgaload_t *fpgaload, int cycles) +{ + int retval; + int k; + u8 dummy = 0; + + for (k = 0; k < cycles; k++) { + retval = fpgaload->write_byte(&dummy, 1); + if (retval < 0) + return retval; +
[PATCH 3/4] ARM DaVinci: Add PCM3008 ALSA SoC driver for the Lyrtech SFFSDR board
The PCM3008 is used on the Lyrtech SFFSDR board, in conjunction with an FPGA that generates the bit clock and the master clock Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> --- sound/soc/codecs/Kconfig |4 + sound/soc/codecs/Makefile |2 + sound/soc/codecs/pcm3008.c | 223 sound/soc/codecs/pcm3008.h | 25 sound/soc/davinci/Kconfig |9 ++ sound/soc/davinci/Makefile |2 + sound/soc/davinci/davinci-sffsdr.c | 145 +++ 7 files changed, 410 insertions(+), 0 deletions(-) create mode 100644 sound/soc/codecs/pcm3008.c create mode 100644 sound/soc/codecs/pcm3008.h create mode 100644 sound/soc/davinci/davinci-sffsdr.c diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 5df7402..dc58ce2 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -80,6 +80,10 @@ config SND_SOC_TWL4030 tristate depends on TWL4030_CORE +config SND_SOC_PCM3008 + tristate + depends on SFFSDR_FPGA + config SND_SOC_UDA1380 tristate diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index 3b9b58a..7af88e7 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -3,6 +3,7 @@ snd-soc-ad1980-objs := ad1980.o snd-soc-ad73311-objs := ad73311.o snd-soc-ak4535-objs := ak4535.o snd-soc-cs4270-objs := cs4270.o +snd-soc-pcm3008-objs := pcm3008.o snd-soc-ssm2602-objs := ssm2602.o snd-soc-tlv320aic23-objs := tlv320aic23.o snd-soc-tlv320aic26-objs := tlv320aic26.o @@ -26,6 +27,7 @@ obj-$(CONFIG_SND_SOC_AD1980) += snd-soc-ad1980.o obj-$(CONFIG_SND_SOC_AD73311) += snd-soc-ad73311.o obj-$(CONFIG_SND_SOC_AK4535) += snd-soc-ak4535.o obj-$(CONFIG_SND_SOC_CS4270) += snd-soc-cs4270.o +obj-$(CONFIG_SND_SOC_PCM3008) += snd-soc-pcm3008.o obj-$(CONFIG_SND_SOC_SSM2602) += snd-soc-ssm2602.o obj-$(CONFIG_SND_SOC_TLV320AIC23) += snd-soc-tlv320aic23.o obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o diff --git a/sound/soc/codecs/pcm3008.c b/sound/soc/codecs/pcm3008.c new file mode 100644 index 000..20d8b94 --- /dev/null +++ b/sound/soc/codecs/pcm3008.c @@ -0,0 +1,223 @@ +/* + * ALSA Soc PCM3008 codec support + * + * Author: Hugo Villeneuve + * Copyright (C) 2008 Lyrtech inc + * + * Based on AC97 Soc codec, original copyright follow: + * + * Copyright 2005 Wolfson Microelectronics PLC. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * Generic PCM3008 support. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pcm3008.h" + +#define PCM3008_VERSION "0.1" + +#define PCM3008_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ + SNDRV_PCM_RATE_48000) + +static int pcm3008_hw_params(struct snd_pcm_substream *substream, +struct snd_pcm_hw_params *params) +{ + int fs; + + /* Fsref can be 32000, 44100 or 48000. */ + fs = params_rate(params); + + printk(KERN_INFO "pcm3008_hw_params: rate = %d Hz\n", fs); + + return sffsdr_fpga_set_codec_fs(fs); +} + +struct snd_soc_dai pcm3008_dai = { + .name = "PCM3008 HiFi", + .type = SND_SOC_DAI_I2S, + .playback = { + .stream_name = "PCM3008 Playback", + .channels_min = 1, + .channels_max = 2, + .rates = PCM3008_RATES, + .formats = SNDRV_PCM_FMTBIT_S16_LE, + }, + .capture = { + .stream_name = "PCM3008 Capture", + .channels_min = 1, + .channels_max = 2, + .rates = PCM3008_RATES, + .formats = SNDRV_PCM_FMTBIT_S16_LE, + }, + .ops = { + .hw_params = pcm3008_hw_params, + }, +}; +EXPORT_SYMBOL_GPL(pcm3008_dai); + +static void pcm3008_gpio_free(struct pcm3008_setup_data *setup) +{ + gpio_free(setup->dem0_pin); + gpio_free(setup->dem1_pin); + gpio_free(setup->pdad_pin); + gpio_free(setup->pdda_pin); +} + +static int pcm3008_soc_probe(struct platform_device *pdev) +{ + struct snd_soc_device *socdev = platform_get_drvdata(pdev); + struct snd_soc_codec *codec; + struct pcm3008_setup_data *setup = socdev->codec_data; + int ret = 0; + + printk(KERN_INFO "PCM3008 SoC Audio Codec %s\n", PCM3008_VERSION); + + socdev->codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL); + if (!socdev->codec) + return -ENOMEM; + + codec = socdev->codec; + mutex_init(&codec->mutex); + + codec->name
Lyrtech SFFSDR board
The following patches are for the Lyrtech SFFSDR board, rebased against the ti-staging-2 branch. I modified the original patches, especially the fpga load driver, to use platform data from the board setup code, which was not the case before. The fpgaload driver is necessary to program the FPGA bitstream. The FPGA must be running for the audio to work. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH] ARM DaVinci: Add PCM3008 ALSA SoC driver for the Lyrtech SFFSDR board
The PCM3008 is used on the Lyrtech SFFSDR board, in conjunction with an FPGA that generates the bit clock and the master clock Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> --- sound/soc/codecs/Kconfig |4 + sound/soc/codecs/Makefile |2 + sound/soc/codecs/pcm3008.c | 223 sound/soc/codecs/pcm3008.h | 25 sound/soc/davinci/Kconfig |9 ++ sound/soc/davinci/Makefile |2 + sound/soc/davinci/davinci-sffsdr.c | 145 +++ 7 files changed, 410 insertions(+), 0 deletions(-) create mode 100644 sound/soc/codecs/pcm3008.c create mode 100644 sound/soc/codecs/pcm3008.h create mode 100644 sound/soc/davinci/davinci-sffsdr.c diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 5df7402..dc58ce2 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -80,6 +80,10 @@ config SND_SOC_TWL4030 tristate depends on TWL4030_CORE +config SND_SOC_PCM3008 + tristate + depends on SFFSDR_FPGA + config SND_SOC_UDA1380 tristate diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index 3b9b58a..7af88e7 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -3,6 +3,7 @@ snd-soc-ad1980-objs := ad1980.o snd-soc-ad73311-objs := ad73311.o snd-soc-ak4535-objs := ak4535.o snd-soc-cs4270-objs := cs4270.o +snd-soc-pcm3008-objs := pcm3008.o snd-soc-ssm2602-objs := ssm2602.o snd-soc-tlv320aic23-objs := tlv320aic23.o snd-soc-tlv320aic26-objs := tlv320aic26.o @@ -26,6 +27,7 @@ obj-$(CONFIG_SND_SOC_AD1980) += snd-soc-ad1980.o obj-$(CONFIG_SND_SOC_AD73311) += snd-soc-ad73311.o obj-$(CONFIG_SND_SOC_AK4535) += snd-soc-ak4535.o obj-$(CONFIG_SND_SOC_CS4270) += snd-soc-cs4270.o +obj-$(CONFIG_SND_SOC_PCM3008) += snd-soc-pcm3008.o obj-$(CONFIG_SND_SOC_SSM2602) += snd-soc-ssm2602.o obj-$(CONFIG_SND_SOC_TLV320AIC23) += snd-soc-tlv320aic23.o obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o diff --git a/sound/soc/codecs/pcm3008.c b/sound/soc/codecs/pcm3008.c new file mode 100644 index 000..20d8b94 --- /dev/null +++ b/sound/soc/codecs/pcm3008.c @@ -0,0 +1,223 @@ +/* + * ALSA Soc PCM3008 codec support + * + * Author: Hugo Villeneuve + * Copyright (C) 2008 Lyrtech inc + * + * Based on AC97 Soc codec, original copyright follow: + * + * Copyright 2005 Wolfson Microelectronics PLC. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * Generic PCM3008 support. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pcm3008.h" + +#define PCM3008_VERSION "0.1" + +#define PCM3008_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ + SNDRV_PCM_RATE_48000) + +static int pcm3008_hw_params(struct snd_pcm_substream *substream, +struct snd_pcm_hw_params *params) +{ + int fs; + + /* Fsref can be 32000, 44100 or 48000. */ + fs = params_rate(params); + + printk(KERN_INFO "pcm3008_hw_params: rate = %d Hz\n", fs); + + return sffsdr_fpga_set_codec_fs(fs); +} + +struct snd_soc_dai pcm3008_dai = { + .name = "PCM3008 HiFi", + .type = SND_SOC_DAI_I2S, + .playback = { + .stream_name = "PCM3008 Playback", + .channels_min = 1, + .channels_max = 2, + .rates = PCM3008_RATES, + .formats = SNDRV_PCM_FMTBIT_S16_LE, + }, + .capture = { + .stream_name = "PCM3008 Capture", + .channels_min = 1, + .channels_max = 2, + .rates = PCM3008_RATES, + .formats = SNDRV_PCM_FMTBIT_S16_LE, + }, + .ops = { + .hw_params = pcm3008_hw_params, + }, +}; +EXPORT_SYMBOL_GPL(pcm3008_dai); + +static void pcm3008_gpio_free(struct pcm3008_setup_data *setup) +{ + gpio_free(setup->dem0_pin); + gpio_free(setup->dem1_pin); + gpio_free(setup->pdad_pin); + gpio_free(setup->pdda_pin); +} + +static int pcm3008_soc_probe(struct platform_device *pdev) +{ + struct snd_soc_device *socdev = platform_get_drvdata(pdev); + struct snd_soc_codec *codec; + struct pcm3008_setup_data *setup = socdev->codec_data; + int ret = 0; + + printk(KERN_INFO "PCM3008 SoC Audio Codec %s\n", PCM3008_VERSION); + + socdev->codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL); + if (!socdev->codec) + return -ENOMEM; + + codec = socdev->codec; + mutex_init(&codec->mutex); + + codec->name
Re: [PATCH 3/4] ARM DaVinci: Add PCM3008 ALSA SoC driver for the Lyrtech SFFSDR board
On Mon, 17 Nov 2008 10:34:39 -0800 Kevin Hilman <[EMAIL PROTECTED]> wrote: > Hugo Villeneuve <[EMAIL PROTECTED]> writes: > > > The PCM3008 is used on the Lyrtech SFFSDR board, in conjunction > > with an FPGA that generates the bit clock and the master clock > > > > Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> > > --- > > sound/soc/codecs/Kconfig |4 + > > sound/soc/codecs/Makefile |2 + > > sound/soc/codecs/pcm3008.c | 223 + > > +++ sound/soc/codecs/pcm3008.h | 25 > > sound/soc/davinci/Kconfig |9 ++ > > sound/soc/davinci/Makefile |2 + > > sound/soc/davinci/davinci-sffsdr.c | 145 +++ > > 7 files changed, 410 insertions(+), 0 deletions(-) > > create mode 100644 sound/soc/codecs/pcm3008.c > > create mode 100644 sound/soc/codecs/pcm3008.h > > create mode 100644 sound/soc/davinci/davinci-sffsdr.c > > All the ALSA SoC stuff should be merged via the ALSA list (alsa-devel) > since this subsystem is already in mainline. Ok, I submitted the patch to ALSA. > That being said, most of the stuff in davinci-sffsdr.c is board > specific init code, and should be a separate patch and live in > arch/arm/mach-davinci/board-sffsdr-audio.c. I agree. Then it makes sense if sound/soc/davinci/davinci-evm.c is also moved to arch/arm/mach-davinci/board-evm-audio.c? Thank-you, Hugo. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/2] ARM DaVinci: Add base support for the Lyrtech SFFSDR board
The Lyrtech SFFSDR (Small form Factor Software Defined Radio) board is built around a TI DM6446 and a Xilinx Virtex-4 (SX-35) FPGA. This patch adds basic board setup code for the SFFSDR. Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> --- arch/arm/mach-davinci/Kconfig|8 ++ arch/arm/mach-davinci/Makefile |1 + arch/arm/mach-davinci/board-sffsdr.c | 196 ++ 3 files changed, 205 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-davinci/board-sffsdr.c diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig index 43b6359..f82e6f4 100644 --- a/arch/arm/mach-davinci/Kconfig +++ b/arch/arm/mach-davinci/Kconfig @@ -42,6 +42,14 @@ config MACH_DAVINCI_DM355_EVM Configure this option to specify the whether the board used for development is a DM355 EVM +config MACH_DAVINCI_SFFSDR + bool "Lyrtech SFFSDR" + default n + depends on ARCH_DAVINCI_DM644x + help + Say Y here to select the Lyrtech Small Form Factor + Software Defined Radio (SFFSDR) board. + config DAVINCI_RESET_CLOCKS bool "Reset unused clocks during boot" depends on ARCH_DAVINCI diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile index 8075090..2a339db 100644 --- a/arch/arm/mach-davinci/Makefile +++ b/arch/arm/mach-davinci/Makefile @@ -11,3 +11,4 @@ obj-y := time.o irq.o clock.o serial.o io.o id.o psc.o \ obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o obj-$(CONFIG_MACH_DAVINCI_DM646X_EVM) += board-dm646x-evm.o obj-$(CONFIG_MACH_DAVINCI_DM355_EVM) += board-dm355-evm.o +obj-$(CONFIG_MACH_DAVINCI_SFFSDR) += board-sffsdr.o diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c new file mode 100644 index 000..a9f1627 --- /dev/null +++ b/arch/arm/mach-davinci/board-sffsdr.c @@ -0,0 +1,196 @@ +/* + * Lyrtech SFFSDR board support. + * + * Copyright (C) 2008 Philip Balister, OpenSDR <[EMAIL PROTECTED]> + * Copyright (C) 2008 Lyrtech + * + * Based on DV-EVM platform, original copyright follows: + * + * Copyright (C) 2007 MontaVista Software, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x0200 + +struct mtd_partition davinci_sffsdr_nandflash_partition[] = { + /* U-Boot Environment: Block 0 +* UBL:Block 1 +* U-Boot: Blocks 6-7 (256 kb) +* Integrity Kernel: Blocks 8-31 (3 Mb) +* Integrity Data: Blocks 100-END +*/ + { + .name = "Linux Kernel", + .offset = 32 * SZ_128K, + .size = 16 * SZ_128K, /* 2 Mb */ + .mask_flags = MTD_WRITEABLE, /* Force read-only */ + }, + { + .name = "Linux ROOT", + .offset = MTDPART_OFS_APPEND, + .size = 256 * SZ_128K, /* 32 Mb */ + .mask_flags = 0, /* R/W */ + }, +}; + +static struct flash_platform_data davinci_sffsdr_nandflash_data = { + .parts = davinci_sffsdr_nandflash_partition, + .nr_parts = ARRAY_SIZE(davinci_sffsdr_nandflash_partition), +}; + +static struct resource davinci_sffsdr_nandflash_resource = { + .start = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE, + .end= DAVINCI_ASYNC_EMIF_DATA_CE0_BASE + SZ_16M - 1, + .flags = IORESOURCE_MEM, +}; + +static struct platform_device davinci_sffsdr_nandflash_device = { + .name = "davinci_nand", /* Name of driver */ + .id = 0, + .dev= { + .platform_data = &davinci_sffsdr_nandflash_data, + }, + .num_resources = 1, + .resource = &davinci_sffsdr_nandflash_resource, +}; + +/* Get Ethernet address from kernel boot par
Lyrtech SFFSDR board v2
I have rebased my SFFSDR patches against the tip of DaVinci git. I have also removed the audio and FPGA drivers. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 2/2] ARM DaVinci: Add defconfig for the Lyrtech SFFSDR board
Add the /arch/arm/configs/davinci_sffsdr_defconfig file for the Lyrtech SFFSDR board Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> --- arch/arm/configs/davinci_sffsdr_defconfig | 1050 + 1 files changed, 1050 insertions(+), 0 deletions(-) create mode 100644 arch/arm/configs/davinci_sffsdr_defconfig diff --git a/arch/arm/configs/davinci_sffsdr_defconfig b/arch/arm/configs/davinci_sffsdr_defconfig new file mode 100644 index 000..8454279 --- /dev/null +++ b/arch/arm/configs/davinci_sffsdr_defconfig @@ -0,0 +1,1050 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.28-rc4-davinci1 +# Tue Nov 18 00:23:35 2008 +# +CONFIG_ARM=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_GENERIC_GPIO=y +CONFIG_GENERIC_TIME=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_MMU=y +# CONFIG_NO_IOPORT is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_ZONE_DMA=y +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +CONFIG_VECTORS_BASE=0x +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +# CONFIG_SWAP is not set +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_TASKSTATS is not set +# CONFIG_AUDIT is not set +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_CGROUPS is not set +# CONFIG_GROUP_SCHED is not set +# CONFIG_SYSFS_DEPRECATED_V2 is not set +# CONFIG_RELAY is not set +# CONFIG_NAMESPACES is not set +# CONFIG_BLK_DEV_INITRD is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y +CONFIG_EMBEDDED=y +# CONFIG_UID16 is not set +# CONFIG_SYSCTL_SYSCALL is not set +# CONFIG_KALLSYMS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +# CONFIG_ELF_CORE is not set +# CONFIG_COMPAT_BRK is not set +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_ANON_INODES=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +# CONFIG_SHMEM is not set +CONFIG_AIO=y +# CONFIG_VM_EVENT_COUNTERS is not set +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +# CONFIG_PROFILING is not set +# CONFIG_MARKERS is not set +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +CONFIG_TINY_SHMEM=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_LOAD is not set +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y +CONFIG_BLOCK=y +# CONFIG_LBD is not set +# CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_LSF is not set +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +CONFIG_IOSCHED_DEADLINE=y +# CONFIG_IOSCHED_CFQ is not set +# CONFIG_DEFAULT_AS is not set +CONFIG_DEFAULT_DEADLINE=y +# CONFIG_DEFAULT_CFQ is not set +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="deadline" +CONFIG_CLASSIC_RCU=y +# CONFIG_FREEZER is not set + +# +# System Type +# +# CONFIG_ARCH_AAEC2000 is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_REALVIEW is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_AT91 is not set +# CONFIG_ARCH_CLPS7500 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_EP93XX is not set +# CONFIG_ARCH_FOOTBRIDGE is not set +# CONFIG_ARCH_NETX is not set +# CONFIG_ARCH_H720X is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_IOP13XX is not set +# CONFIG_ARCH_IOP32X is not set +# CONFIG_ARCH_IOP33X is not set +# CONFIG_ARCH_IXP23XX is not set +# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_KIRKWOOD is not set +# CONFIG_ARCH_KS8695 is not set +# CONFIG_ARCH_NS9XXX is not set +# CONFIG_ARCH_LOKI is not set +# CONFIG_ARCH_MV78XX0 is not set +# CONFIG_ARCH_MXC is not set +# CONFIG_ARCH_ORION5X is not set +# CONFIG_ARCH_PNX4008 is not set +# CONFIG_ARCH_PXA is not set +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_SA1100 is not set +# CONFIG_ARCH_S3C2410 is not set +# CONFIG_ARCH_SHARK is not set +# CONFIG_ARCH_LH7A40X is not set +CONFIG_ARCH_DAVINCI=y +# CONFIG_ARCH_OMAP is not set +# CONFIG_ARCH_MSM is not set + +# +# Boot options +# + +# +# Power management +# + +# +# TI DaVinci Implementations +# + +# +# DaVinci Core Type +# +CONFIG_ARCH_DAVINCI_DM644x=y +# CONFIG_ARCH_DAVINCI_DM646x is no
[PATCH 1/2] ALSA SoC: Add PCM3008 ALSA SoC driver
The PCM3008 is a 16-bit stereo audio codec. It accepts left-justified format for ADC, and right-justified format for DAC. Independent power-down modes for ADC and DAC are provided, as well as a digital de-emphasis filter (4 modes). Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> --- sound/soc/codecs/Kconfig |4 + sound/soc/codecs/Makefile |2 + sound/soc/codecs/pcm3008.c | 201 sound/soc/codecs/pcm3008.h | 25 ++ 4 files changed, 232 insertions(+), 0 deletions(-) create mode 100644 sound/soc/codecs/pcm3008.c create mode 100644 sound/soc/codecs/pcm3008.h diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 5df7402..906e11e 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -11,6 +11,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_TLV320AIC26 select SND_SOC_TLV320AIC3X select SND_SOC_TWL4030 + select SND_SOC_PCM3008 select SND_SOC_UDA1380 select SND_SOC_WM8510 select SND_SOC_WM8580 @@ -80,6 +81,9 @@ config SND_SOC_TWL4030 tristate depends on TWL4030_CORE +config SND_SOC_PCM3008 + tristate + config SND_SOC_UDA1380 tristate diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index 3b9b58a..7af88e7 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -3,6 +3,7 @@ snd-soc-ad1980-objs := ad1980.o snd-soc-ad73311-objs := ad73311.o snd-soc-ak4535-objs := ak4535.o snd-soc-cs4270-objs := cs4270.o +snd-soc-pcm3008-objs := pcm3008.o snd-soc-ssm2602-objs := ssm2602.o snd-soc-tlv320aic23-objs := tlv320aic23.o snd-soc-tlv320aic26-objs := tlv320aic26.o @@ -26,6 +27,7 @@ obj-$(CONFIG_SND_SOC_AD1980) += snd-soc-ad1980.o obj-$(CONFIG_SND_SOC_AD73311) += snd-soc-ad73311.o obj-$(CONFIG_SND_SOC_AK4535) += snd-soc-ak4535.o obj-$(CONFIG_SND_SOC_CS4270) += snd-soc-cs4270.o +obj-$(CONFIG_SND_SOC_PCM3008) += snd-soc-pcm3008.o obj-$(CONFIG_SND_SOC_SSM2602) += snd-soc-ssm2602.o obj-$(CONFIG_SND_SOC_TLV320AIC23) += snd-soc-tlv320aic23.o obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o diff --git a/sound/soc/codecs/pcm3008.c b/sound/soc/codecs/pcm3008.c new file mode 100644 index 000..d020ed5 --- /dev/null +++ b/sound/soc/codecs/pcm3008.c @@ -0,0 +1,201 @@ +/* + * ALSA Soc PCM3008 codec support + * + * Author: Hugo Villeneuve + * Copyright (C) 2008 Lyrtech inc + * + * Based on AC97 Soc codec, original copyright follow: + * Copyright 2005 Wolfson Microelectronics PLC. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * Generic PCM3008 support. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pcm3008.h" + +#define PCM3008_VERSION "0.2" + +#define PCM3008_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ + SNDRV_PCM_RATE_48000) + +struct snd_soc_dai pcm3008_dai = { + .name = "PCM3008 HiFi", + .type = SND_SOC_DAI_I2S, + .playback = { + .stream_name = "PCM3008 Playback", + .channels_min = 1, + .channels_max = 2, + .rates = PCM3008_RATES, + .formats = SNDRV_PCM_FMTBIT_S16_LE, + }, + .capture = { + .stream_name = "PCM3008 Capture", + .channels_min = 1, + .channels_max = 2, + .rates = PCM3008_RATES, + .formats = SNDRV_PCM_FMTBIT_S16_LE, + }, +}; +EXPORT_SYMBOL_GPL(pcm3008_dai); + +static void pcm3008_gpio_free(struct pcm3008_setup_data *setup) +{ + gpio_free(setup->dem0_pin); + gpio_free(setup->dem1_pin); + gpio_free(setup->pdad_pin); + gpio_free(setup->pdda_pin); +} + +static int pcm3008_soc_probe(struct platform_device *pdev) +{ + struct snd_soc_device *socdev = platform_get_drvdata(pdev); + struct snd_soc_codec *codec; + struct pcm3008_setup_data *setup = socdev->codec_data; + int ret = 0; + + printk(KERN_INFO "PCM3008 SoC Audio Codec %s\n", PCM3008_VERSION); + + socdev->codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL); + if (!socdev->codec) + return -ENOMEM; + + codec = socdev->codec; + mutex_init(&codec->mutex); + + codec->name = "PCM3008"; + codec->owner = THIS_MODULE; + codec->dai = &pcm3008_dai; + codec->num_dai = 1; + codec->write = NULL; + codec->read = NULL; + INIT_LIST_HEAD(&codec->dapm_widgets); + INIT_LIST_HEAD(&codec->dapm_paths); + + /* Register PCMs. */ + ret = snd_soc_new
PCM3008 ALSA Soc driver and Lyrtech SFFSDR board audio support (v2)
Reworked and splitted patch based on Mark Brown comments. Mark, thank-you for your comments. I implemented almost all of your suggestions, except for the de-emphasis control because I don't really know how I can export (and test) that interface. Like you said, maybe we or someone else can do it later. Hugo Villeneuve ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 2/2] ARM DaVinci: Add ALSA SoC driver for the Lyrtech SFFSDR board
The PCM3008 is used on the Lyrtech SFFSDR board, in conjunction with an FPGA that generates the bit clock and the master clock Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> --- sound/soc/davinci/Kconfig | 10 +++ sound/soc/davinci/Makefile |2 + sound/soc/davinci/davinci-sffsdr.c | 156 3 files changed, 168 insertions(+), 0 deletions(-) create mode 100644 sound/soc/davinci/davinci-sffsdr.c diff --git a/sound/soc/davinci/Kconfig b/sound/soc/davinci/Kconfig index 8f7e338..b502741 100644 --- a/sound/soc/davinci/Kconfig +++ b/sound/soc/davinci/Kconfig @@ -17,3 +17,13 @@ config SND_DAVINCI_SOC_EVM help Say Y if you want to add support for SoC audio on TI DaVinci EVM platform. + +config SND_DAVINCI_SOC_SFFSDR + tristate "SoC Audio support for SFFSDR" + depends on SND_DAVINCI_SOC && MACH_DAVINCI_SFFSDR + select SND_DAVINCI_SOC_I2S + select SND_SOC_PCM3008 + select SFFSDR_FPGA + help + Say Y if you want to add support for SoC audio on + Lyrtech SFFSDR board. diff --git a/sound/soc/davinci/Makefile b/sound/soc/davinci/Makefile index ca772e5..ca8bae1 100644 --- a/sound/soc/davinci/Makefile +++ b/sound/soc/davinci/Makefile @@ -7,5 +7,7 @@ obj-$(CONFIG_SND_DAVINCI_SOC_I2S) += snd-soc-davinci-i2s.o # DAVINCI Machine Support snd-soc-evm-objs := davinci-evm.o +snd-soc-sffsdr-objs := davinci-sffsdr.o obj-$(CONFIG_SND_DAVINCI_SOC_EVM) += snd-soc-evm.o +obj-$(CONFIG_SND_DAVINCI_SOC_SFFSDR) += snd-soc-sffsdr.o diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c new file mode 100644 index 000..64983d4 --- /dev/null +++ b/sound/soc/davinci/davinci-sffsdr.c @@ -0,0 +1,156 @@ +/* + * ASoC driver for Lyrtech SFFSDR board. + * + * Author: Hugo Villeneuve + * Copyright (C) 2008 Lyrtech inc + * + * Based on ASoC driver for TI DAVINCI EVM platform, original copyright follow: + * Copyright: (C) 2007 MontaVista Software, Inc., <[EMAIL PROTECTED]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "../codecs/pcm3008.h" +#include "davinci-pcm.h" +#include "davinci-i2s.h" + +static int sffsdr_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; + int fs; + int ret = 0; + + /* Set cpu DAI configuration: +* CLKX and CLKR are the inputs for the Sample Rate Generator. +* FSX and FSR are outputs, driven by the sample Rate Generator. */ + ret = snd_soc_dai_set_fmt(cpu_dai, + SND_SOC_DAIFMT_RIGHT_J | + SND_SOC_DAIFMT_CBM_CFS | + SND_SOC_DAIFMT_IB_NF); + if (ret < 0) + return ret; + + /* Fsref can be 32000, 44100 or 48000. */ + fs = params_rate(params); + + printk(KERN_INFO "sffsdr_hw_params: rate = %d Hz\n", fs); + + return sffsdr_fpga_set_codec_fs(fs); +} + +static struct snd_soc_ops sffsdr_ops = { + .hw_params = sffsdr_hw_params, +}; + +/* davinci-sffsdr digital audio interface glue - connects codec <--> CPU */ +static struct snd_soc_dai_link sffsdr_dai = { + .name = "PCM3008", /* Codec name */ + .stream_name = "PCM3008 HiFi", + .cpu_dai = &davinci_i2s_dai, + .codec_dai = &pcm3008_dai, + .ops = &sffsdr_ops, +}; + +/* davinci-sffsdr audio machine driver */ +static struct snd_soc_machine snd_soc_machine_sffsdr = { + .name = "DaVinci SFFSDR", + .dai_link = &sffsdr_dai, + .num_links = 1, +}; + +/* sffsdr audio private data */ +static struct pcm3008_setup_data sffsdr_pcm3008_setup = { + .dem0_pin = GPIO(45), + .dem1_pin = GPIO(46), + .pdad_pin = GPIO(47), + .pdda_pin = GPIO(38), +}; + +/* sffsdr audio subsystem */ +static struct snd_soc_device sffsdr_snd_devdata = { + .machine = &snd_soc_machine_sffsdr, + .platform = &davinci_soc_platform, + .codec_dev = &soc_codec_dev_pcm3008, + .codec_data = &sffsdr_pcm3008_setup, +}; + +static struct resource sffsdr_snd_resources[] = { + { + .start = DAVINCI_MCBSP_BASE, + .end = DAVINCI_MCBSP_BASE + SZ_8K - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct evm_snd_platform_data sffsdr_snd_data = { + .tx_dma_ch = DAVINCI_DMA_MC
Re: [alsa-devel] [PATCH 2/2] ARM DaVinci: Add ALSA SoC driver for the Lyrtech SFFSDR board
On Wed, 19 Nov 2008 11:11:17 + Mark Brown <[EMAIL PROTECTED]> wrote: > On Wed, Nov 19, 2008 at 01:37:32AM -0500, Hugo Villeneuve wrote: > > The PCM3008 is used on the Lyrtech SFFSDR board, in conjunction > > with an FPGA that generates the bit clock and the master clock > > > Signed-off-by: Hugo Villeneuve <[EMAIL PROTECTED]> > > Acked-by: Mark Brown <[EMAIL PROTECTED]> > > but I'll... > > > + printk(KERN_INFO "sffsdr_hw_params: rate = %d Hz\n", fs); > > ...change this to a pr_debug() before pushing it since displaying this > every time playback or record starts is excessive for normal use. Ok, no problem, it was only there for initial debugging. Hugo V. --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
New UNIX/Linux DaVinci serial loader/flasher -- dvnixload
Hi Everyone, After some frustration using DVFlasher and MONO to program my DaVinci board, I have decided to write a pure UNIX/Linux serial loader/flasher application called dvnixload. Here is the project web page: http://www.hugovil.com/en/dvnixload/ I have tested it successfully to program the UBL[1] and U-Boot in the NAND flash on my DM6446-based SFFSDR board. Tests were done with an old-fashioned serial port as well as a USB to serial converter with success. It is very simple to use as you don't have to pass command line arguments to specify the UBL or application load address: this information is automatically extracted from the ELF headers (input files are in ELF format). If some people find it useful, maybe we could post a link about it on the TI DaVinci wiki. Comments/suggestions/patches are welcomed. Hugo Villeneuve. [1] Use the UBL from this location: http://trac.geekisp.com/opensdr/browser/HW_tools/sff_sdr/serial_loader/trunk/DVFlasher/ubl See the manual for the explanation ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: New UNIX/Linux DaVinci serial loader/flasher -- dvnixload
On Thu, 4 Dec 2008 09:16:29 +0100 Andrea Gasparini <[EMAIL PROTECTED]> wrote: > > > Hi Everyone, > > After some frustration using DVFlasher and MONO to program my > > DaVinci board, I have decided to write a pure UNIX/Linux serial > > loader/flasher application called dvnixload > > Yooo!! :D > You rock, Hugo... thank you very much! > > JFY, have you planned a port for dm35x family? I was writing a > "pythonesque" one some days ago, but time to spend with this has dropped > down and I'm still stopped. Hi Andrea, I have a new board coming with a DM355 on it, so I would like to add support for the DM355 very soon. > Perhaps when I'll have time to dedicate at some serial loader, I can > instead work on a port of your code on dm355. > (...but time is a uncommon resource, lately...) ;) Great. Thanks, Hugo. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
VLYNQ support
These patches are necessary to enable the VLYNQ module (power and clock), and to configure it properly (interface width). Tested with a custom VLYNQ driver on the SFFSDR board. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/2] ARM DaVinci: Add support for VLYNQ module and its clock
Signed-off-by: Hugo Villeneuve --- arch/arm/mach-davinci/clock.c |5 + arch/arm/mach-davinci/psc.c |3 +++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c index 0771b34..c010a24 100644 --- a/arch/arm/mach-davinci/clock.c +++ b/arch/arm/mach-davinci/clock.c @@ -322,6 +322,11 @@ static struct clk davinci_clks[] = { .rate = &commonrate, .lpsc = DAVINCI_LPSC_AEMIF, .usecount = 1, + }, + { + .name = "VLYNQCLK", + .rate = &commonrate, + .lpsc = DAVINCI_LPSC_VLYNQ, } }; static struct clk davinci_dm646x_clks[] = { diff --git a/arch/arm/mach-davinci/psc.c b/arch/arm/mach-davinci/psc.c index b1dd02c..a5ca76e 100644 --- a/arch/arm/mach-davinci/psc.c +++ b/arch/arm/mach-davinci/psc.c @@ -65,6 +65,9 @@ static void dm6446_psc_mux(unsigned int id) case DAVINCI_LPSC_McBSP: davinci_mux_peripheral(DAVINCI_MUX_ASP, 1); break; + case DAVINCI_LPSC_VLYNQ: + davinci_mux_peripheral(DAVINCI_MUX_VLYNQEN, 1); + break; default: break; } -- 1.5.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 2/2] ARM DaVinci: Added function to select VLYNQ interface width
This function can be called in board setup code or in a VLYNQ driver to select the interface width. Oddly enough, the values 3 and 4 are used to select an interface width of 4 and 3 bits respectively, according to the TI datasheet. Signed-off-by: Hugo Villeneuve --- arch/arm/mach-davinci/include/mach/mux.h |2 + arch/arm/mach-davinci/mux.c | 38 ++ 2 files changed, 40 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h index 9e7cf69..541b5fa 100644 --- a/arch/arm/mach-davinci/include/mach/mux.h +++ b/arch/arm/mach-davinci/include/mach/mux.h @@ -57,4 +57,6 @@ extern void davinci_mux_peripheral(unsigned int mux, unsigned int enable); +extern int davinci_mux_set_vlynq_width(int width); + #endif /* __ASM_ARCH_MUX_H */ diff --git a/arch/arm/mach-davinci/mux.c b/arch/arm/mach-davinci/mux.c index be33108..8c120a9 100644 --- a/arch/arm/mach-davinci/mux.c +++ b/arch/arm/mach-davinci/mux.c @@ -37,3 +37,41 @@ void davinci_mux_peripheral(unsigned int mux, unsigned int enable) spin_unlock(&mux_lock); } EXPORT_SYMBOL(davinci_mux_peripheral); + +/* + * VLYNQ interface width configuration: + * + * VLYNQWD1 VLYNQWD0 Interface width + * --- + *0 0 1 + *0 1 2 + *1 0 4 + *1 1 3 + */ +int davinci_mux_set_vlynq_width(int width) +{ + if ((width < 1) || (width > 4)) + return -EINVAL; + + switch (width) { + case 1: + davinci_mux_peripheral(DAVINCI_MUX_VLYNQWD1, 0); + davinci_mux_peripheral(DAVINCI_MUX_VLYNQWD0, 0); + break; + case 2: + davinci_mux_peripheral(DAVINCI_MUX_VLYNQWD1, 0); + davinci_mux_peripheral(DAVINCI_MUX_VLYNQWD0, 1); + break; + case 3: + davinci_mux_peripheral(DAVINCI_MUX_VLYNQWD1, 1); + davinci_mux_peripheral(DAVINCI_MUX_VLYNQWD0, 1); + break; + case 4: + davinci_mux_peripheral(DAVINCI_MUX_VLYNQWD1, 1); + davinci_mux_peripheral(DAVINCI_MUX_VLYNQWD0, 0); + break; + } + + return 0; +} +EXPORT_SYMBOL(davinci_mux_set_vlynq_width); -- 1.5.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: VLYNQ support
On Wed, 17 Dec 2008 11:14:19 +0100 Ottavio Campana wrote: > Hugo Villeneuve ha scritto: > > These patches are necessary to enable the VLYNQ module (power and > > clock), and to configure it properly (interface width). Tested with > > a custom VLYNQ driver on the SFFSDR board. > > > > Dear Hugo, have you ever seen this ? > > https://dev.openwrt.org/browser/trunk/target/linux/ar7/files/drivers/vlynq/vlynq.c > > I saw it a few months ago, but eventually we decided to drop support > for vlynq, and I don't even know if it is compatible with your work > or not, but maybe it could be interesting for you. > > Ottavio Hi Ottavio, Yes, in fact my driver is based on that code :) Hugo V. --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/1] Fix compilation errors with musb/cppi_dma.c
From: Hugo Villeneuve These compilation errors are related to incorrect debugging macro and variable names and generated the following errors: drivers/usb/musb/cppi_dma.c:437:5: warning: "MUSB_DEBUG" is not defined drivers/usb/musb/cppi_dma.c: In function 'cppi_next_rx_segment': drivers/usb/musb/cppi_dma.c:884: error: 'debug' undeclared (first use in this function) Signed-off-by: Hugo Villeneuve --- drivers/usb/musb/cppi_dma.c | 11 +-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c index 5ad6d08..3aac8d5 100644 --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c @@ -41,6 +41,9 @@ #define NUM_TXCHAN_BD 64 #define NUM_RXCHAN_BD 64 +/* Defined in musb_core.c */ +extern unsigned musb_debug; + static inline void cpu_drain_writebuffer(void) { wmb(); @@ -423,6 +426,7 @@ cppi_rndis_update(struct cppi_channel *c, int is_rx, } } +#ifdef CONFIG_USB_MUSB_DEBUG static void cppi_dump_rxbd(const char *tag, struct cppi_descriptor *bd) { pr_debug("RXBD/%s %08x: " @@ -431,10 +435,11 @@ static void cppi_dump_rxbd(const char *tag, struct cppi_descriptor *bd) bd->hw_next, bd->hw_bufp, bd->hw_off_len, bd->hw_options); } +#endif static void cppi_dump_rxq(int level, const char *tag, struct cppi_channel *rx) { -#if MUSB_DEBUG > 0 +#ifdef CONFIG_USB_MUSB_DEBUG struct cppi_descriptor *bd; if (!_dbg_level(level)) @@ -881,12 +886,14 @@ cppi_next_rx_segment(struct musb *musb, struct cppi_channel *rx, int onepacket) bd->hw_options |= CPPI_SOP_SET; tail->hw_options |= CPPI_EOP_SET; - if (debug >= 5) { +#ifdef CONFIG_USB_MUSB_DEBUG + if (musb_debug >= 5) { struct cppi_descriptor *d; for (d = rx->head; d; d = d->next) cppi_dump_rxbd("S", d); } +#endif /* in case the preceding transfer left some state... */ tail = rx->last_processed; -- 1.5.4.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/1] ASoC: Fix compilation error with davinci-sffsdr module
The SFFSDR audio codec sampling frequency clock is generated by a FPGA, and set by the FPGA driver. The FPGA driver is not yet in the mainline kernel, so that is why an extern declaration is used in the meantime. Signed-off-by: Hugo Villeneuve --- sound/soc/davinci/davinci-sffsdr.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c index 1bbde3e..0a03b41 100644 --- a/sound/soc/davinci/davinci-sffsdr.c +++ b/sound/soc/davinci/davinci-sffsdr.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include @@ -34,6 +33,11 @@ #include "davinci-pcm.h" #include "davinci-i2s.h" +/* The SFFSDR audio codec sampling frequency clock is generated by a FPGA. + * The FPGA driver is not yet in the mainline kernel, so that is + * why an extern declaration is used in the meantime. */ +extern int sffsdr_fpga_set_codec_fs(int fs); + static int sffsdr_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { -- 1.5.4.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [alsa-devel] [PATCH 1/1] ASoC: Fix compilation error with davinci-sffsdr module
On Tue, 6 Jan 2009 21:31:17 + Mark Brown wrote: > On Tue, Jan 06, 2009 at 04:23:45PM -0500, Hugo Villeneuve wrote: > > The SFFSDR audio codec sampling frequency clock is generated by > > a FPGA, and set by the FPGA driver. The FPGA driver is not yet > > in the mainline kernel, so that is why an extern declaration is > > used in the meantime. > > > Signed-off-by: Hugo Villeneuve > > If the driver is for is not yet in mainline I'd be more inclined to > fix this by providing the relevant Kconfig dependency to exclude it > from the build rather than changing the C file - the dependency will > be needed anyway when the FPGA driver is in mainline. Hi Mark, The problem is that some people may want to do modifications to this soc driver, and they won´t be able to test that their changes are valid (ex: do not break compilation). > Do the DaVinci drivers build at all in mainline, anyway? Last time I > checked they required out of tree DMA patches. I just sucessfully compiled the davinci-sffsdr soc driver (although audio seems broken for me at the moment when I actually test it). Hugo V. --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [PATCH] ARM: DaVinci: New pinmux layer for DaVinci SoCs
On Wed, 3 Dec 2008 10:17:25 +0530 Sudhakar Rajashekhara wrote: > New PIN MUX layer support for TI DaVinci SoCs > ... > This patch adds a new pinmux layer for TI DaVinci SoC. The existing > pinmux layer works only when the PINMUX register has single bit field > to enable the secondary function. DM646x can support secondary as > well as tertiary pin functions. This new pinmux layer is similar to > the one being used by OMAP architecture. > ... > -/* System control register bits */ > -#define DAVINCI_MUX_AEAW00 > -#define DAVINCI_MUX_AEAW11 > -#define DAVINCI_MUX_AEAW22 > -#define DAVINCI_MUX_AEAW33 > -#define DAVINCI_MUX_AEAW44 > -#define DAVINCI_MUX_AECS410 > -#define DAVINCI_MUX_AECS511 > -#define DAVINCI_MUX_VLYNQWD0 12 > -#define DAVINCI_MUX_VLYNQWD1 13 > -#define DAVINCI_MUX_VLSCREN 14 > -#define DAVINCI_MUX_VLYNQEN 15 > -#define DAVINCI_MUX_HDIREN 16 > -#define DAVINCI_MUX_ATAEN17 > -#define DAVINCI_MUX_RGB666 22 > -#define DAVINCI_MUX_RGB888 23 > -#define DAVINCI_MUX_LOEEN24 > -#define DAVINCI_MUX_LFLDEN 25 > -#define DAVINCI_MUX_CWEN 26 > -#define DAVINCI_MUX_CFLDEN 27 > -#define DAVINCI_MUX_HPIEN29 > -#define DAVINCI_MUX_1394EN 30 > -#define DAVINCI_MUX_EMACEN 31 > - > -#define DAVINCI_MUX_LEVEL2 32 > -#define DAVINCI_MUX_UART0(DAVINCI_MUX_LEVEL2 + 0) > -#define DAVINCI_MUX_UART1(DAVINCI_MUX_LEVEL2 + 1) > -#define DAVINCI_MUX_UART2(DAVINCI_MUX_LEVEL2 + 2) How can I enable UART2 with the new architecture? I don´t see any UART2 in the enum davinci_dm644x_index (mux.h) Hugo V. --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: VLYNQ support
On Tue, 16 Dec 2008 14:30:30 -0500 Hugo Villeneuve wrote: > These patches are necessary to enable the VLYNQ module (power and > clock), and to configure it properly (interface width). Tested with a > custom VLYNQ driver on the SFFSDR board. I never had a response for these two patches. But anyway, it was such a long time ago that they no longer work with the latest git tree. I will once again resubmit based on the latest git, and hope that I will get some feedback this time. Hugo V. ------- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/1] Add VLYNQ mux support.
Signed-off-by: Hugo Villeneuve --- arch/arm/mach-davinci/psc.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/psc.c b/arch/arm/mach-davinci/psc.c index 0f1c1cd..275387a 100644 --- a/arch/arm/mach-davinci/psc.c +++ b/arch/arm/mach-davinci/psc.c @@ -65,6 +65,10 @@ static void dm6446_psc_mux(unsigned int id) case DAVINCI_LPSC_McBSP: davinci_cfg_reg(DM644X_MCBSP); break; + case DAVINCI_LPSC_VLYNQ: + davinci_cfg_reg(DM644X_VLYNQEN); + davinci_cfg_reg(DM644X_VLYNQWD); + break; default: break; } -- 1.5.4.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/1] Add support for VLYNQ module clock.
Signed-off-by: Hugo Villeneuve --- arch/arm/mach-davinci/clock.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c index c23243f..67ab35d 100644 --- a/arch/arm/mach-davinci/clock.c +++ b/arch/arm/mach-davinci/clock.c @@ -323,6 +323,11 @@ static struct clk davinci_clks[] = { .lpsc = DAVINCI_LPSC_USB, }, { + .name = "VLYNQCLK", + .rate = &commonrate, + .lpsc = DAVINCI_LPSC_VLYNQ, + }, + { .name = "AEMIFCLK", .rate = &commonrate, .lpsc = DAVINCI_LPSC_AEMIF, -- 1.5.4.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/1] Fix MUSB_HDRC compilation error
With CONFIG_USB_MUSB_HDRC selected, we have the following compilation errors: drivers/usb/musb/cppi_dma.c:437:5: warning: "MUSB_DEBUG" is not defined drivers/usb/musb/cppi_dma.c: In function 'cppi_next_rx_segment': drivers/usb/musb/cppi_dma.c:884: error: 'debug' undeclared (first use in this function) These compilation errors are related to incorrect debugging macro and variable names. Signed-off-by: Hugo Villeneuve --- drivers/usb/musb/cppi_dma.c | 11 +-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c index 5ad6d08..3aac8d5 100644 --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c @@ -41,6 +41,9 @@ #define NUM_TXCHAN_BD 64 #define NUM_RXCHAN_BD 64 +/* Defined in musb_core.c */ +extern unsigned musb_debug; + static inline void cpu_drain_writebuffer(void) { wmb(); @@ -423,6 +426,7 @@ cppi_rndis_update(struct cppi_channel *c, int is_rx, } } +#ifdef CONFIG_USB_MUSB_DEBUG static void cppi_dump_rxbd(const char *tag, struct cppi_descriptor *bd) { pr_debug("RXBD/%s %08x: " @@ -431,10 +435,11 @@ static void cppi_dump_rxbd(const char *tag, struct cppi_descriptor *bd) bd->hw_next, bd->hw_bufp, bd->hw_off_len, bd->hw_options); } +#endif static void cppi_dump_rxq(int level, const char *tag, struct cppi_channel *rx) { -#if MUSB_DEBUG > 0 +#ifdef CONFIG_USB_MUSB_DEBUG struct cppi_descriptor *bd; if (!_dbg_level(level)) @@ -881,12 +886,14 @@ cppi_next_rx_segment(struct musb *musb, struct cppi_channel *rx, int onepacket) bd->hw_options |= CPPI_SOP_SET; tail->hw_options |= CPPI_EOP_SET; - if (debug >= 5) { +#ifdef CONFIG_USB_MUSB_DEBUG + if (musb_debug >= 5) { struct cppi_descriptor *d; for (d = rx->head; d; d = d->next) cppi_dump_rxbd("S", d); } +#endif /* in case the preceding transfer left some state... */ tail = rx->last_processed; -- 1.5.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [alsa-devel] [PATCH 1/1] ASoC: Fix compilation error with davinci-sffsdr module
On Tue, 6 Jan 2009 22:00:06 + Mark Brown wrote: > On Tue, Jan 06, 2009 at 04:41:20PM -0500, Hugo Villeneuve wrote: > > Mark Brown wrote: > > > > If the driver is for is not yet in mainline I'd be more inclined > > > to fix this by providing the relevant Kconfig dependency to > > > exclude it > > > The problem is that some people may want to do modifications to this > > soc driver, and they won?t be able to test that their changes are > > valid (ex: do not break compilation). > > Speaking as the person who I expect most frequently tries that I > wouldn't worry about it - it's easy enough to see what's happened and > there will still be errors at link time even with the extern. No, there won´t be errors when compiling as a module. Only when actually loading the module. > I'd certainly want to see the Kconfig fix as well, independantly of > this. I will look into this eventually. > > > Do the DaVinci drivers build at all in mainline, anyway? Last > > > time I checked they required out of tree DMA patches. > > > I just sucessfully compiled the davinci-sffsdr soc driver (although > > audio seems broken for me at the moment when I actually test it). > > That's good news - previously it would fail to build at all. What > sort of breakage are you seeing (and what was the version you used > when you developed the driver)? I developped the driver with version 2.6.27-rc6-davinci1-05187-g91c2c53. The breakage I see when I run the aplay utility is this: aplay: pcm_write:1394: write error: Input/output error davinci-git version is the latest as of january 14 (2.6.28-davinci1-06546-gcfb152b) > [Your MUA isn't doing word wrapping, BTW.] Fixed, thanks :) Hugo v. --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [alsa-devel] [PATCH 1/1] ASoC: Fix compilation error with davinci-sffsdr module
On Thu, 15 Jan 2009 11:18:07 + Mark Brown wrote: > ") > Fcc: +sent-mail > > On Wed, Jan 14, 2009 at 03:54:06PM -0500, Hugo Villeneuve wrote: > > Mark Brown wrote: > > > > Speaking as the person who I expect most frequently tries that I > > > wouldn't worry about it - it's easy enough to see what's happened > > > and there will still be errors at link time even with the extern. > > > No, there won?t be errors when compiling as a module. Only when > > actually loading the module. > > Check again - the kernel will detect those errors at build time. The > module itself will compile but once all the modules are built Kbuild > verifies that all the symbols they use can be found. Hi Mark, I just checked again and at first I tought you were wrong :) Just to be sure, I cloned a fresh copy of linux-davinci-git kernel. This tree doesn´t have the SFFSDR FPGA module with the sffsdr_fpga_set_codec_fs() function. If I compile this tree as is for the SFFSDR board, I sure have the error for the missing header file , containing the declaration for the function sffsdr_fpga_set_codec_fs. But if I remove the #include for that header file and add the following extern declaration: extern int sffsdr_fpga_set_codec_fs(int fs); I can successfully compile the whole kernel and all the selected modules without any errors. But in fact you were right, because I just found out that someone has added the following check to sffsdr_init() in davinci-sffsdr.c: if (!machine_is_sffsdr()) return -EINVAL; For a reason that I don´t yet understand, that function doesn´t seem to be defined (always return 0) and so gcc has correctly optimised my module by removing the sffsdr_hw_params function, and thus also removing the call to my sffsdr_fpga_set_codec_fs function, and this is why Kbuild never complained! > > > That's good news - previously it would fail to build at all. What > > > sort of breakage are you seeing (and what was the version you used > > > when you developed the driver)? > > > I developped the driver with version > > 2.6.27-rc6-davinci1-05187-g91c2c53. > > > The breakage I see when I run the aplay utility is this: > > > aplay: pcm_write:1394: write error: Input/output error > > > davinci-git version is the latest as of january 14 > > (2.6.28-davinci1-06546-gcfb152b) > > Hrm, OK. That's not terribly informative - does the error get > reported after about 10 seconds by any chance? I suspect that DMA > just isn't happening. Sorry about the non-verbosity :) Yes it happens almost exactly after 10 seconds. I´m not an expert with audio nor DMA, but can you indicate me where I should be looking for signs of trouble (which source files for example)? Thank-you, Hugo. --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [alsa-devel] [PATCH 1/1] ASoC: Fix compilation error with davinci-sffsdr module
On Thu, 15 Jan 2009 20:01:22 + Mark Brown wrote: > On Thu, Jan 15, 2009 at 02:54:54PM -0500, Hugo Villeneuve wrote: > > Mark Brown wrote: > > > > > The breakage I see when I run the aplay utility is this: > > > > > aplay: pcm_write:1394: write error: Input/output error > > > > > davinci-git version is the latest as of january 14 > > > > (2.6.28-davinci1-06546-gcfb152b) > > > > Hrm, OK. That's not terribly informative - does the error get > > > reported after about 10 seconds by any chance? I suspect that DMA > > > just isn't happening. > > > Sorry about the non-verbosity :) > > I actually meant the error message rather than your posting, sorry! I know :) In the meantime, I will send you a patch that will fix the compilation problems for the SFFSDR ASoC module. > Yes it happens almost exactly after 10 seconds. I?m not an expert > > with audio nor DMA, but can you indicate me where I should be > > looking for signs of trouble (which source files for example)? > > sound/soc/davinci/davinci-pcm.c and the underlying DMA APIs it > calls. I wouldn't be surprised if either there had been some change > in the DMA APIs that required an update in the driver or the DMA APIs > haven't been fully merged. > > Hopefully a comparison of the mainline and DaVinci trees will show > something... Anyone on the DaVinci mailing list that could shed some light on this issue? Thank-you, Hugo. --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug.
Removed call to machine_is_sffsdr() in module init function because it always returns zero and causes GCC to optimise and remove all functions of the module. Signed-off-by: Hugo Villeneuve --- sound/soc/davinci/davinci-sffsdr.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c index 1bbde3e..3e8e6cd 100644 --- a/sound/soc/davinci/davinci-sffsdr.c +++ b/sound/soc/davinci/davinci-sffsdr.c @@ -115,9 +115,6 @@ static int __init sffsdr_init(void) { int ret; - if (!machine_is_sffsdr()) - return -EINVAL; - sffsdr_snd_device = platform_device_alloc("soc-audio", 0); if (!sffsdr_snd_device) { printk(KERN_ERR "platform device allocation failed\n"); -- 1.5.4.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR compilation error.
Remove dependency on sffsdr_fpga_set_codec_fs() when the SFFSDR FPGA module is not selected. Signed-off-by: Hugo Villeneuve --- sound/soc/davinci/davinci-sffsdr.c | 20 +--- 1 files changed, 17 insertions(+), 3 deletions(-) diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c index 3e8e6cd..e3ea07a 100644 --- a/sound/soc/davinci/davinci-sffsdr.c +++ b/sound/soc/davinci/davinci-sffsdr.c @@ -25,7 +25,9 @@ #include #include #include +#ifdef CONFIG_SFFSDR_FPGA #include +#endif #include #include @@ -42,6 +44,17 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream, int fs; int ret = 0; + /* Fsref can be 32000, 44100 or 48000. */ + fs = params_rate(params); + +#ifndef CONFIG_SFFSDR_FPGA + /* Without the FPGA module, the Fs is fixed at 44100 Hz */ + if (fs != 44100) { + pr_debug("warning: only 44.1 kHz is supported without SFFSDR FPGA module\n"); + return -EINVAL; + } +#endif + /* Set cpu DAI configuration: * CLKX and CLKR are the inputs for the Sample Rate Generator. * FSX and FSR are outputs, driven by the sample Rate Generator. */ @@ -52,12 +65,13 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream, if (ret < 0) return ret; - /* Fsref can be 32000, 44100 or 48000. */ - fs = params_rate(params); - pr_debug("sffsdr_hw_params: rate = %d Hz\n", fs); +#ifndef CONFIG_SFFSDR_FPGA + return 0; +#else return sffsdr_fpga_set_codec_fs(fs); +#endif } static struct snd_soc_ops sffsdr_ops = { -- 1.5.4.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [alsa-devel] [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug.
On Thu, 15 Jan 2009 20:57:53 + Mark Brown wrote: > On Thu, Jan 15, 2009 at 03:39:52PM -0500, Hugo Villeneuve wrote: > > Removed call to machine_is_sffsdr() in module init > > function because it always returns zero and causes > > GCC to optimise and remove all functions of the module. > > > Signed-off-by: Hugo Villeneuve > > This should be replaced with the appropriate machine_is_() call for > the system. It is the appropriate call, but at compile time it always return false. Hugo. --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [alsa-devel] [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug.
On Thu, 15 Jan 2009 21:09:12 + Mark Brown wrote: > On Thu, Jan 15, 2009 at 04:02:57PM -0500, Hugo Villeneuve wrote: > > On Thu, 15 Jan 2009 20:57:53 + > > Mark Brown wrote: > > > > This should be replaced with the appropriate machine_is_() call > > > for the system. > > > It is the appropriate call, but at compile time it always return > > false. > > Sounds like that should be fixed instead, then? If someone wants to fix it, fine. I tried but couldn´t find what is wrong. Maybe the person who added that piece of code (not me) should fix it... Ciao, Hugo. --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR compilation error.
On Thu, 15 Jan 2009 13:23:09 -0800 David Brownell wrote: > On Thursday 15 January 2009, Hugo Villeneuve wrote: > > Remove dependency on sffsdr_fpga_set_codec_fs() when the > > SFFSDR FPGA module is not selected. > > > > Signed-off-by: Hugo Villeneuve > > --- > > Something looks broken in the config you're building with. > As in, very deeply broken. You should fix the config instead > of hacking around those bugs with ifdefs. Nothing is broken, it is an optional feature. Hugo. --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [alsa-devel] [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug.
On Thu, 15 Jan 2009 21:40:41 + Mark Brown wrote: > On Thu, Jan 15, 2009 at 04:17:00PM -0500, Hugo Villeneuve wrote: > > Mark Brown wrote: > > > > Sounds like that should be fixed instead, then? > > > If someone wants to fix it, fine. I tried but couldn?t find what is > > wrong. Maybe the person who added that piece of code (not me) should > > fix it... > > It was added by David Brownell to prevent the module being used on the > wrong hardware, which is perfectly reasonable. The machine_is_foo() > tests are a very standard part of the ARM infrastructure and are > widely used - if they're not working that's where the fix is. Are > you sure that your .config has MACH_SFFSDR set? There appears to be > no mainline support for the core machine so you'd have to have > patched that in... I just found the cause. I created the SFFSDR machine on the ARM website, and this automatically defined the macro CONFIG_MACH_SFFSDR, and not CONFIG_MACH_DAVINCI_SFFSDR like it is currently in the Kconfig. I will submit a patch to rename CONFIG_MACH_DAVINCI_SFFSDR to CONFIG_MACH_SFFSDR in the Kconfig file. Thank-you everyone for your help. Hugo. --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [alsa-devel] [PATCH 1/1] ASoC: Fix compilation error with davinci-sffsdr module
On Thu, 15 Jan 2009 15:10:01 -0700 Troy Kisky wrote: > > Hopefully a comparison of the mainline and DaVinci trees will show > > something... > > In davinci-sffsdr.c I see > > ret = snd_soc_dai_set_fmt(cpu_dai, > SND_SOC_DAIFMT_RIGHT_J | > SND_SOC_DAIFMT_CBM_CFS | > SND_SOC_DAIFMT_IB_NF); > > When I changed the evm board flags passed, I didn't change this file. > So, you'll need something like > > ret = snd_soc_dai_set_fmt(cpu_dai, > SND_SOC_DAIFMT_DSP_A | > SND_SOC_DAIFMT_CBM_CFS | > SND_SOC_DAIFMT_NB_NF); I´m not using the same codec as on the EVM. I´m using the PCM3008 and I need to use the right-justified mode and the SND_SOC_DAIFMT_IB_NF flag for it to work (it used to work a few weeks/months ago). > But, you should be seeing error messages. Did someone test the latest git tree and audio on a DM644x EVM to see if it still works? Hugo. --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [alsa-devel] [PATCH 1/1] ASoC: Fix compilation error with davinci-sffsdr module
On Thu, 15 Jan 2009 15:50:52 -0700 Troy Kisky wrote: > Hugo Villeneuve wrote: > > On Thu, 15 Jan 2009 15:10:01 -0700 > > Troy Kisky wrote: > > > >>> Hopefully a comparison of the mainline and DaVinci trees will show > >>> something... > >> In davinci-sffsdr.c I see > >> > >>ret = snd_soc_dai_set_fmt(cpu_dai, > >> SND_SOC_DAIFMT_RIGHT_J | > >> SND_SOC_DAIFMT_CBM_CFS | > >> SND_SOC_DAIFMT_IB_NF); > >> > >> When I changed the evm board flags passed, I didn't change this > >> file. So, you'll need something like > >> > >>ret = snd_soc_dai_set_fmt(cpu_dai, > >> SND_SOC_DAIFMT_DSP_A | > >> SND_SOC_DAIFMT_CBM_CFS | > >> SND_SOC_DAIFMT_NB_NF); > > > > > > Actually, that should be > > ret = snd_soc_dai_set_fmt(cpu_dai, > SND_SOC_DAIFMT_DSP_B | > SND_SOC_DAIFMT_CBM_CFS | > SND_SOC_DAIFMT_NB_NF); > > > I had dsp_a and dsp_b backwards again. Hi Troy, Finally the problem was hardware related. The PLL feeding the clocks to the ASP was dead, so that is why the DMA were never triggered. I replaced it and everything is working fine now, using my original config: SND_SOC_DAIFMT_RIGHT_J | SND_SOC_DAIFMT_CBM_CFS | SND_SOC_DAIFMT_IB_NF); Mark: this also means that the latest davinci git tree has working audio support (without needing any DMA patch) :) Thank-you all, Hugo. --- Hugo Villeneuve www.hugovil.com --- ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/2] Changed MACH_DAVINCI_SFFSDR to MACH_SFFSDR
In , the SFFSDR board is defined as MACH_SFFSDR. Signed-off-by: Hugo Villeneuve --- arch/arm/configs/davinci_sffsdr_defconfig |2 +- arch/arm/mach-davinci/Kconfig |2 +- arch/arm/mach-davinci/Makefile|2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/configs/davinci_sffsdr_defconfig b/arch/arm/configs/davinci_sffsdr_defconfig index 8454279..b040df9 100644 --- a/arch/arm/configs/davinci_sffsdr_defconfig +++ b/arch/arm/configs/davinci_sffsdr_defconfig @@ -178,7 +178,7 @@ CONFIG_ARCH_DAVINCI_DM644x=y # DaVinci Board Type # # CONFIG_MACH_DAVINCI_EVM is not set -CONFIG_MACH_DAVINCI_SFFSDR=y +CONFIG_MACH_SFFSDR=y # CONFIG_DAVINCI_RESET_CLOCKS is not set CONFIG_DAVINCI_BOOT_TAG=y diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig index 20e55ea..6b6696d 100644 --- a/arch/arm/mach-davinci/Kconfig +++ b/arch/arm/mach-davinci/Kconfig @@ -42,7 +42,7 @@ config MACH_DAVINCI_DM355_EVM Configure this option to specify the whether the board used for development is a DM355 EVM -config MACH_DAVINCI_SFFSDR +config MACH_SFFSDR bool "Lyrtech SFFSDR" default n depends on ARCH_DAVINCI_DM644x diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile index 24a9195..bfaf7d5 100644 --- a/arch/arm/mach-davinci/Makefile +++ b/arch/arm/mach-davinci/Makefile @@ -13,4 +13,4 @@ obj-$(CONFIG_DAVINCI_MUX) += mux.o mux_cfg.o obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o obj-$(CONFIG_MACH_DAVINCI_DM646X_EVM) += board-dm646x-evm.o obj-$(CONFIG_MACH_DAVINCI_DM355_EVM) += board-dm355-evm.o -obj-$(CONFIG_MACH_DAVINCI_SFFSDR) += board-sffsdr.o +obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o -- 1.5.4.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 2/2] Update SFFSDR defconfig to match latest davinci git
Signed-off-by: Hugo Villeneuve --- arch/arm/configs/davinci_sffsdr_defconfig | 53 ++--- 1 files changed, 18 insertions(+), 35 deletions(-) diff --git a/arch/arm/configs/davinci_sffsdr_defconfig b/arch/arm/configs/davinci_sffsdr_defconfig index b040df9..8c17858 100644 --- a/arch/arm/configs/davinci_sffsdr_defconfig +++ b/arch/arm/configs/davinci_sffsdr_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.28-rc4-davinci1 -# Tue Nov 18 00:23:35 2008 +# Linux kernel version: 2.6.28-davinci1 +# Fri Jan 16 12:33:07 2009 # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -179,6 +179,9 @@ CONFIG_ARCH_DAVINCI_DM644x=y # # CONFIG_MACH_DAVINCI_EVM is not set CONFIG_MACH_SFFSDR=y +CONFIG_DAVINCI_MUX=y +# CONFIG_DAVINCI_MUX_DEBUG is not set +# CONFIG_DAVINCI_MUX_WARNINGS is not set # CONFIG_DAVINCI_RESET_CLOCKS is not set CONFIG_DAVINCI_BOOT_TAG=y @@ -419,6 +422,7 @@ CONFIG_LXT_PHY=y # CONFIG_BROADCOM_PHY is not set # CONFIG_ICPLUS_PHY is not set # CONFIG_REALTEK_PHY is not set +# CONFIG_LSI_ET1011C_PHY is not set # CONFIG_FIXED_PHY is not set # CONFIG_MDIO_BITBANG is not set CONFIG_NET_ETHERNET=y @@ -535,7 +539,6 @@ CONFIG_I2C_DAVINCI=y # CONFIG_SENSORS_PCA9539 is not set # CONFIG_SENSORS_PCF8591 is not set # CONFIG_TPS65010 is not set -# CONFIG_SENSORS_TLV320AIC33 is not set # CONFIG_SENSORS_MAX6875 is not set # CONFIG_SENSORS_TSL2550 is not set # CONFIG_LP5521 is not set @@ -550,6 +553,10 @@ CONFIG_GPIOLIB=y # CONFIG_GPIO_SYSFS is not set # +# Memory mapped GPIO expanders: +# + +# # I2C GPIO expanders: # # CONFIG_GPIO_MAX732X is not set @@ -569,11 +576,11 @@ CONFIG_GPIOLIB=y # CONFIG_THERMAL is not set # CONFIG_THERMAL_HWMON is not set # CONFIG_WATCHDOG is not set +CONFIG_SSB_POSSIBLE=y # # Sonics Silicon Backplane # -CONFIG_SSB_POSSIBLE=y # CONFIG_SSB is not set # @@ -584,6 +591,7 @@ CONFIG_SSB_POSSIBLE=y # CONFIG_MFD_ASIC3 is not set # CONFIG_HTC_EGPIO is not set # CONFIG_HTC_PASIC3 is not set +# CONFIG_TWL4030_CORE is not set # CONFIG_MFD_TMIO is not set # CONFIG_MFD_T7L66XB is not set # CONFIG_MFD_TC6387XB is not set @@ -637,38 +645,14 @@ CONFIG_SND_DYNAMIC_MINORS=y # CONFIG_SND_ARM is not set CONFIG_SND_SOC=y CONFIG_SND_DAVINCI_SOC=m +# CONFIG_SND_DAVINCI_SOC_SFFSDR is not set # CONFIG_SND_SOC_ALL_CODECS is not set # CONFIG_SOUND_PRIME is not set -CONFIG_USB_SUPPORT=y -CONFIG_USB_ARCH_HAS_HCD=y -# CONFIG_USB_ARCH_HAS_OHCI is not set -# CONFIG_USB_ARCH_HAS_EHCI is not set -# CONFIG_USB is not set -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set -CONFIG_USB_MUSB_HDRC=m -CONFIG_USB_MUSB_SOC=y - -# -# DaVinci 644x USB support -# +# CONFIG_USB_SUPPORT is not set # CONFIG_USB_MUSB_HOST is not set -CONFIG_USB_MUSB_PERIPHERAL=y +# CONFIG_USB_MUSB_PERIPHERAL is not set # CONFIG_USB_MUSB_OTG is not set -CONFIG_USB_GADGET_MUSB_HDRC=y -# CONFIG_MUSB_PIO_ONLY is not set -# CONFIG_USB_INVENTRA_DMA is not set -CONFIG_USB_TI_CPPI_DMA=y -# CONFIG_USB_MUSB_DEBUG is not set - -# -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -# -CONFIG_USB_GADGET=m -# CONFIG_USB_GADGET_DEBUG is not set -# CONFIG_USB_GADGET_DEBUG_FILES is not set -CONFIG_USB_GADGET_VBUS_DRAW=2 -CONFIG_USB_GADGET_SELECTED=y +# CONFIG_USB_GADGET_MUSB_HDRC is not set # CONFIG_USB_GADGET_AT91 is not set # CONFIG_USB_GADGET_ATMEL_USBA is not set # CONFIG_USB_GADGET_FSL_USB2 is not set @@ -683,12 +667,10 @@ CONFIG_USB_GADGET_SELECTED=y # CONFIG_USB_GADGET_NET2280 is not set # CONFIG_USB_GADGET_GOKU is not set # CONFIG_USB_GADGET_DUMMY_HCD is not set -CONFIG_USB_GADGET_DUALSPEED=y # CONFIG_USB_ZERO is not set # CONFIG_USB_ETH is not set # CONFIG_USB_GADGETFS is not set -CONFIG_USB_FILE_STORAGE=m -# CONFIG_USB_FILE_STORAGE_TEST is not set +# CONFIG_USB_FILE_STORAGE is not set # CONFIG_USB_G_SERIAL is not set # CONFIG_USB_MIDI_GADGET is not set # CONFIG_USB_G_PRINTER is not set @@ -956,6 +938,7 @@ CONFIG_CRYPTO=y # # CONFIG_CRYPTO_FIPS is not set # CONFIG_CRYPTO_MANAGER is not set +# CONFIG_CRYPTO_MANAGER2 is not set # CONFIG_CRYPTO_GF128MUL is not set # CONFIG_CRYPTO_NULL is not set # CONFIG_CRYPTO_CRYPTD is not set -- 1.5.4.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Lyrtech SFFSDR board
The first patch fix a problem with the machine type for the SFFSDR. The second patch updates the defconfig to match the latest davinci git tree. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
DaVinci serial ports patches
The following patches are for using serial ports 1 and 2 and to simplify enabling serial ports in board setup code. ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 2/2] Replace UARTx enable bits with macros in board setup code
Signed-off-by: Hugo Villeneuve --- arch/arm/mach-davinci/board-dm355-evm.c |2 +- arch/arm/mach-davinci/board-dm644x-evm.c|2 +- arch/arm/mach-davinci/board-dm646x-evm.c|2 +- arch/arm/mach-davinci/board-sffsdr.c|6 +- arch/arm/mach-davinci/include/mach/serial.h |5 + 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c index d62d19a..47a46d7 100644 --- a/arch/arm/mach-davinci/board-dm355-evm.c +++ b/arch/arm/mach-davinci/board-dm355-evm.c @@ -167,7 +167,7 @@ static struct platform_device *davinci_evm_devices[] __initdata = { }; static struct davinci_uart_config davinci_evm_uart_config __initdata = { - .enabled_uarts = (1 << 0), + .enabled_uarts = DAVINCI_UART0_ENABLE, }; static struct davinci_board_config_kernel davinci_evm_config[] __initdata = { diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index 359b754..5401911 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c @@ -583,7 +583,7 @@ static struct platform_device *davinci_evm_devices[] __initdata = { }; static struct davinci_uart_config davinci_evm_uart_config __initdata = { - .enabled_uarts = (1 << 0), + .enabled_uarts = DAVINCI_UART0_ENABLE, }; static struct davinci_board_config_kernel davinci_evm_config[] __initdata = { diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 6b1f323..868f721 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c @@ -47,7 +47,7 @@ #include static struct davinci_uart_config davinci_evm_uart_config __initdata = { - .enabled_uarts = (1 << 0), + .enabled_uarts = DAVINCI_UART0_ENABLE, }; static struct davinci_board_config_kernel davinci_evm_config[] __initdata = { diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c index 9dab21d..196c779 100644 --- a/arch/arm/mach-davinci/board-sffsdr.c +++ b/arch/arm/mach-davinci/board-sffsdr.c @@ -53,6 +53,7 @@ #include #include #include +#include #define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e0 #define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x0200 @@ -142,7 +143,7 @@ static struct platform_device *davinci_sffsdr_devices[] __initdata = { }; static struct davinci_uart_config davinci_sffsdr_uart_config __initdata = { - .enabled_uarts = (1 << 0), + .enabled_uarts = DAVINCI_UART0_ENABLE | DAVINCI_UART1_ENABLE, }; static struct davinci_board_config_kernel davinci_sffsdr_config[] __initdata = { @@ -156,6 +157,9 @@ static void __init davinci_sffsdr_map_io(void) static __init void davinci_sffsdr_init(void) { + /* Turn UART1 MUX ON. */ + davinci_cfg_reg(DM644X_UART1); + davinci_psc_init(); platform_add_devices(davinci_sffsdr_devices, ARRAY_SIZE(davinci_sffsdr_devices)); diff --git a/arch/arm/mach-davinci/include/mach/serial.h b/arch/arm/mach-davinci/include/mach/serial.h index 1508433..6df4765 100644 --- a/arch/arm/mach-davinci/include/mach/serial.h +++ b/arch/arm/mach-davinci/include/mach/serial.h @@ -25,6 +25,11 @@ #define UART_DM646X_SCR 0x10 #define UART_DM646X_SCR_TX_WATERMARK 0x08 +/* Use these macros in board setup code to enable a specific UART. */ +#define DAVINCI_UART0_ENABLE (1 << 0) +#define DAVINCI_UART1_ENABLE (1 << 1) +#define DAVINCI_UART2_ENABLE (1 << 2) + extern void davinci_serial_init(void); #endif /* __ASM_ARCH_SERIAL_H */ -- 1.5.4.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
[PATCH 1/2] Add support for UART1 and UART2 pinmux.
Signed-off-by: Hugo Villeneuve --- arch/arm/mach-davinci/include/mach/mux.h |6 ++ arch/arm/mach-davinci/mux_cfg.c |3 +++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h index 47e483b..497f540 100644 --- a/arch/arm/mach-davinci/include/mach/mux.h +++ b/arch/arm/mach-davinci/include/mach/mux.h @@ -62,6 +62,12 @@ enum davinci_dm644x_index { /* ASP function */ DM644X_MCBSP, + /* UART1 */ + DM644X_UART1, + + /* UART2 */ + DM644X_UART2, + /* PWM0 */ DM644X_PWM0, diff --git a/arch/arm/mach-davinci/mux_cfg.c b/arch/arm/mach-davinci/mux_cfg.c index dc87594..ed69246 100644 --- a/arch/arm/mach-davinci/mux_cfg.c +++ b/arch/arm/mach-davinci/mux_cfg.c @@ -75,6 +75,9 @@ MUX_CFG(DM644X, I2C, 1, 7, 1,1, false) MUX_CFG(DM644X, MCBSP, 1, 10,1,1, false) +MUX_CFG(DM644X, UART1, 1, 1, 1,1, true) +MUX_CFG(DM644X, UART2, 1, 2, 1,1, true) + MUX_CFG(DM644X, PWM0, 1, 4, 1,1, false) MUX_CFG(DM644X, PWM1, 1, 5, 1,1, false) -- 1.5.4.5 ___ Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Re: [PATCH 2/2] Replace UARTx enable bits with macros in board setup code
On Fri, 16 Jan 2009 14:17:28 -0800 Kevin Hilman wrote: > Hugo Villeneuve writes: > > > Signed-off-by: Hugo Villeneuve > > --- > > arch/arm/mach-davinci/board-dm355-evm.c |2 +- > > arch/arm/mach-davinci/board-dm644x-evm.c|2 +- > > arch/arm/mach-davinci/board-dm646x-evm.c|2 +- > > arch/arm/mach-davinci/board-sffsdr.c|6 +- > > arch/arm/mach-davinci/include/mach/serial.h |5 + > > 5 files changed, 13 insertions(+), 4 deletions(-) > > NAK. You changed the usage in the board files, but not the usage in > the common code (common.c, serial.c.) Yes, one step at a time. It is still much better than what is currently there. > In fact, I think the bitmasks here are clear enough without new > #defines. Also the serial init is going to be reworked a bit for > mainline submission as all the platform-specific TAGs have to go. Having to decode how the serial routine works to be able to figure out the bits to use is clearly wrong and bad programming practice. In fact, I tought at first that I figured it out correctly for UART2 but after many attempts I realized that I was not correctly shifting the bits. Please use macros instead of hard to read bits shifting. > So, please drop the serial stuff and send a new patch with the > mux updates for SFFSDR. > > Thanks, > > Kevin > > > > diff --git a/arch/arm/mach-davinci/board-dm355-evm.c > > b/arch/arm/mach-davinci/board-dm355-evm.c index d62d19a..47a46d7 > > 100644 > > --- a/arch/arm/mach-davinci/board-dm355-evm.c > > +++ b/arch/arm/mach-davinci/board-dm355-evm.c > > @@ -167,7 +167,7 @@ static struct platform_device > > *davinci_evm_devices[] __initdata = { }; > > > > static struct davinci_uart_config davinci_evm_uart_config > > __initdata = { > > - .enabled_uarts = (1 << 0), > > + .enabled_uarts = DAVINCI_UART0_ENABLE, > > }; > > > > static struct davinci_board_config_kernel davinci_evm_config[] > > __initdata = { diff --git > > a/arch/arm/mach-davinci/board-dm644x-evm.c > > b/arch/arm/mach-davinci/board-dm644x-evm.c index 359b754..5401911 > > 100644 > > --- a/arch/arm/mach-davinci/board-dm644x-evm.c > > +++ b/arch/arm/mach-davinci/board-dm644x-evm.c > > @@ -583,7 +583,7 @@ static struct platform_device > > *davinci_evm_devices[] __initdata = { }; > > > > static struct davinci_uart_config davinci_evm_uart_config > > __initdata = { > > - .enabled_uarts = (1 << 0), > > + .enabled_uarts = DAVINCI_UART0_ENABLE, > > }; > > > > static struct davinci_board_config_kernel davinci_evm_config[] > > __initdata = { diff --git > > a/arch/arm/mach-davinci/board-dm646x-evm.c > > b/arch/arm/mach-davinci/board-dm646x-evm.c index 6b1f323..868f721 > > 100644 > > --- a/arch/arm/mach-davinci/board-dm646x-evm.c > > +++ b/arch/arm/mach-davinci/board-dm646x-evm.c > > @@ -47,7 +47,7 @@ > > #include > > > > static struct davinci_uart_config davinci_evm_uart_config > > __initdata = { > > - .enabled_uarts = (1 << 0), > > + .enabled_uarts = DAVINCI_UART0_ENABLE, > > }; > > > > static struct davinci_board_config_kernel davinci_evm_config[] > > __initdata = { diff --git a/arch/arm/mach-davinci/board-sffsdr.c > > b/arch/arm/mach-davinci/board-sffsdr.c index 9dab21d..196c779 100644 > > --- a/arch/arm/mach-davinci/board-sffsdr.c > > +++ b/arch/arm/mach-davinci/board-sffsdr.c > > @@ -53,6 +53,7 @@ > > #include > > #include > > #include > > +#include > > > > #define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e0 > > #define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x0200 > > @@ -142,7 +143,7 @@ static struct platform_device > > *davinci_sffsdr_devices[] __initdata = { }; > > > > static struct davinci_uart_config davinci_sffsdr_uart_config > > __initdata = { > > - .enabled_uarts = (1 << 0), > > + .enabled_uarts = DAVINCI_UART0_ENABLE | > > DAVINCI_UART1_ENABLE, }; > > > > static struct davinci_board_config_kernel davinci_sffsdr_config[] > > __initdata = { @@ -156,6 +157,9 @@ static void __init > > davinci_sffsdr_map_io(void) > > static __init void davinci_sffsdr_init(void) > > { > > + /* Turn UART1 MUX ON. */ > > + davinci_cfg_reg(DM644X_UART1); > > + > > davinci_psc_init(); > > platform_add_devices(davinci_sffsdr_devices, > > ARRAY_SIZE(davinci_sffsdr_devices)); > > diff --git a/arch/arm/mach-davinci/include/mach/serial.h > > b/arch/arm/mach-davinci/includ