MXC patches for next merge window
Subsystems (3)
Sascha Hauer
maintainerHi,
Here are some patches for the next merge window to review which aim at sound and add Nand support for the pcm043 board.
Sascha
The following changes since commit 52d797c8c0b53e3940427ff0c43ef4356f1d668e:
Uwe Kleine-K?nig (1):
imx/gpio: Use handle_level_irq
are available in the git repository at:
git://git.pengutronix.de/git/imx/linux-2.6.git mxc-master-pu
Juergen Beisert (2):
MXC NFC: Add the clock resource to support NFC in i.MX35 MXC NFC: Fix NFCs address area on i.MX35
Sascha Hauer (7):
pca100: Add board to uncompress.h
pca100: use correct irq initialisation function
pcm043: Add NAND support
i.MX2: Add sound (ssi) resources
i.MX3: Add sound (ssi) resources
MXC: Add a digital audio multiplexer (DAM) driver i.MX35: Fix audmux clock
arch/arm/mach-mx2/Kconfig | 2 + arch/arm/mach-mx2/clock_imx27.c | 4 +- arch/arm/mach-mx2/devices.c | 78 +++++++++++++++++++++++++++ arch/arm/mach-mx2/devices.h | 3 +- arch/arm/mach-mx2/pca100.c | 2 +- arch/arm/mach-mx3/Kconfig | 2 + arch/arm/mach-mx3/clock-imx35.c | 41 ++++++++++++-- arch/arm/mach-mx3/devices.c | 44 +++++++++++++++- arch/arm/mach-mx3/devices.h | 2 + arch/arm/mach-mx3/pcm043.c | 7 +++ arch/arm/plat-mxc/Kconfig | 7 +++ arch/arm/plat-mxc/Makefile | 2 + arch/arm/plat-mxc/dam-v1.c | 33 +++++++++++ arch/arm/plat-mxc/dam-v2.c | 56 +++++++++++++++++++ arch/arm/plat-mxc/include/mach/dam.h | 45 +++++++++++++++ arch/arm/plat-mxc/include/mach/uncompress.h | 1 + 16 files changed, 318 insertions(+), 11 deletions(-) create mode 100644 arch/arm/plat-mxc/dam-v1.c create mode 100644 arch/arm/plat-mxc/dam-v2.c create mode 100644 arch/arm/plat-mxc/include/mach/dam.h
Sascha Hauer
maintainerPATCH 1/9 MXC NFC: Add the clock resource to support NFC in i.MX35
From: Juergen Beisert <[email protected]>
--- arch/arm/mach-mx3/clock-imx35.c | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-)
arch/arm/mach-mx3/clock-imx35.c +30 -0
@@ -387,6 +387,35 @@ DEFINE_CLOCK(csi_clk, 0, CCM_CGR3, 0, get_rate_csi, NULL);DEFINE_CLOCK (iim_clk,0 ,CCM_CGR3 ,2 ,NULL ,NULL );DEFINE_CLOCK (gpu2d_clk,0 ,CCM_CGR3 ,4 ,NULL ,NULL ); +static int clk_dummy_enable (struct clk *clk) +{ +return 0 ; +} + +static void clk_dummy_disable (struct clk *clk) +{ +} + +static unsigned long get_rate_nfc (struct clk *clk) +{ +unsigned long div1; + + div1 = (__raw_readl (CCM_BASE +CCM_PDR4 ) >>28 ) +1 ; + +return get_rate_ahb (NULL ) / div1; +} + +/* NAND Controller: It seems it can't be disabled */ +static struct clk nfc_clk = { + .id =0 , + .enable_reg =0 , + .enable_shift =0 , + .get_rate = get_rate_nfc, + .set_rate =NULL ,/* set_rate_nfc, */ + .enable = clk_dummy_enable, + .disable = clk_dummy_disable +}; +#define _REGISTER_CLOCK (d, n, c) \ { \ .dev_id = d, \
@@ -449,6 +478,7 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK(NULL, "csi", csi_clk) _REGISTER_CLOCK(NULL, "iim", iim_clk) _REGISTER_CLOCK(NULL, "gpu2d", gpu2d_clk) + _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) };int __init mx35_clocks_init ()
Signature · 1 line
1.6.5.2
Sascha Hauer
maintainerPATCH 2/9 MXC NFC: Fix NFCs address area on i.MX35
From: Juergen Beisert <[email protected]>
The address area of the NFS in the i.MX35 silicon is much larger than 4k.
--- arch/arm/mach-mx3/devices.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-mx3/devices.c +1 -1
@@ -546,7 +546,7 @@ static int mx3_devices_init(void) }if (cpu_is_mx35 ()) { mxc_nand_resources[0 ].start =MX35_NFC_BASE_ADDR ; - mxc_nand_resources[0 ].end =MX35_NFC_BASE_ADDR +0xfff ; + mxc_nand_resources[0 ].end =MX35_NFC_BASE_ADDR +0x1fff ; otg_resources[0 ].start =MX35_OTG_BASE_ADDR ; otg_resources[0 ].end =MX35_OTG_BASE_ADDR +0x1ff ; otg_resources[1 ].start =MXC_INT_USBOTG ;
Signature · 1 line
1.6.5.2
Sascha Hauer
maintainerPATCH 3/9 pca100: Add board to uncompress.h
--- arch/arm/plat-mxc/include/mach/uncompress.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/plat-mxc/include/mach/uncompress.h +1 -0
@@ -83,6 +83,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)case MACH_TYPE_MX27ADS :case MACH_TYPE_PCM038 :case MACH_TYPE_MX21ADS : +case MACH_TYPE_PCA100 : uart_base =MX2X_UART1_BASE_ADDR ;break ;case MACH_TYPE_MX31LITE :
Signature · 1 line
1.6.5.2
Sascha Hauer
maintainerPATCH 4/9 pca100: use correct irq initialisation function
--- arch/arm/mach-mx2/pca100.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-mx2/pca100.c +1 -1
@@ -237,7 +237,7 @@ MACHINE_START(PCA100, "phyCARD-i.MX27") .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, .boot_params = PHYS_OFFSET + 0x100, .map_io = mx27_map_io, - .init_irq = mxc_init_irq, + .init_irq = mx27_init_irq, .init_machine = pca100_init, .timer = &pca100_timer,MACHINE_END
Signature · 1 line
1.6.5.2
Sascha Hauer
maintainerPATCH 5/9 pcm043: Add NAND support
--- arch/arm/mach-mx3/pcm043.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/mach-mx3/pcm043.c +7 -0
@@ -43,6 +43,7 @@#include <mach/iomux-mx35.h> #include <mach/ipu.h> #include <mach/mx3fb.h> +#include <mach/mxc_nand.h> #include "devices.h"
@@ -206,6 +207,11 @@ static struct pad_desc pcm043_pads[] = { MX35_PAD_ATA_CS0__GPIO2_6, }; +static struct mxc_nand_platform_data pcm037_nand_board_info = { + .width =1 , + .hw_ecc =1 , +}; +/* * Board specific initialization. */
@@ -216,6 +222,7 @@ static void __init mxc_board_init(void)platform_add_devices (devices,ARRAY_SIZE (devices));mxc_register_device (&mxc_uart_device0, &uart_pdata); +mxc_register_device (&mxc_nand_device, &pcm037_nand_board_info);mxc_register_device (&mxc_uart_device1, &uart_pdata);
Signature · 1 line
1.6.5.2
Sascha Hauer
maintainerPATCH 6/9 i.MX2: Add sound (ssi) resources
--- arch/arm/mach-mx2/clock_imx27.c | 4 +- arch/arm/mach-mx2/devices.c | 78 +++++++++++++++++++++++++++++++++++++++ arch/arm/mach-mx2/devices.h | 3 +- 3 files changed, 82 insertions(+), 3 deletions(-)
arch/arm/mach-mx2/clock_imx27.c +2 -2
@@ -651,8 +651,8 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", usb_clk1) _REGISTER_CLOCK("mxc-ehci.2", "usb", usb_clk) _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_clk1) - _REGISTER_CLOCK(NULL, "ssi1", ssi1_clk) - _REGISTER_CLOCK(NULL, "ssi2", ssi2_clk) + _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) + _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) _REGISTER_CLOCK(NULL, "vpu", vpu_clk)_REGISTER_CLOCK (NULL ,"dma" , dma_clk)
arch/arm/mach-mx2/devices.c +78 -0
84 lines not on this page · raw message
arch/arm/mach-mx2/devices.h +2 -1
@@ -26,4 +26,5 @@ extern struct platform_device mxc_usbh2;extern struct platform_device mxc_spi_device0;extern struct platform_device mxc_spi_device1;extern struct platform_device mxc_spi_device2; - +extern struct platform_device imx_ssi_device0; +extern struct platform_device imx_ssi_device1;
Signature · 1 line
1.6.5.2
Sascha Hauer
maintainerPATCH 7/9 i.MX3: Add sound (ssi) resources
--- arch/arm/mach-mx3/clock-imx35.c | 4 +- arch/arm/mach-mx3/devices.c | 42 +++++++++++++++++++++++++++++++++++++++ arch/arm/mach-mx3/devices.h | 2 + 3 files changed, 46 insertions(+), 2 deletions(-)
arch/arm/mach-mx3/clock-imx35.c +2 -2
@@ -463,8 +463,8 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK(NULL, "sdma", sdma_clk) _REGISTER_CLOCK(NULL, "spba", spba_clk) _REGISTER_CLOCK(NULL, "spdif", spdif_clk) - _REGISTER_CLOCK(NULL, "ssi", ssi1_clk) - _REGISTER_CLOCK(NULL, "ssi", ssi2_clk) + _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) + _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)_REGISTER_CLOCK ("imx-uart.2" ,NULL , uart3_clk)
arch/arm/mach-mx3/devices.c +42 -0
54 lines not on this page · raw message
arch/arm/mach-mx3/devices.h +2 -0
@@ -23,4 +23,6 @@ extern struct platform_device mxc_rnga_device;extern struct platform_device imx_spi_device0;extern struct platform_device imx_spi_device1;extern struct platform_device imx_spi_device2; +extern struct platform_device imx_ssi_device0; +extern struct platform_device imx_ssi_device1;
Signature · 1 line
1.6.5.2
Sascha Hauer
maintainerPATCH 8/9 MXC: Add a digital audio multiplexer (DAM) driver
--- arch/arm/mach-mx2/Kconfig | 2 + arch/arm/mach-mx3/Kconfig | 2 + arch/arm/plat-mxc/Kconfig | 7 ++++ arch/arm/plat-mxc/Makefile | 2 + arch/arm/plat-mxc/dam-v1.c | 33 ++++++++++++++++++++ arch/arm/plat-mxc/dam-v2.c | 56 ++++++++++++++++++++++++++++++++++ arch/arm/plat-mxc/include/mach/dam.h | 45 +++++++++++++++++++++++++++ 7 files changed, 147 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-mxc/dam-v1.c create mode 100644 arch/arm/plat-mxc/dam-v2.c create mode 100644 arch/arm/plat-mxc/include/mach/dam.h
arch/arm/mach-mx2/Kconfig +2 -0
@@ -6,11 +6,13 @@ choice config MACH_MX21 bool "i.MX21 support" + select ARCH_MXC_DAM_V1 help This enables support for Freescale's MX2 based i.MX21 processor. config MACH_MX27 bool "i.MX27 support" + select ARCH_MXC_DAM_V1 help This enables support for Freescale's MX2 based i.MX27 processor.
arch/arm/mach-mx3/Kconfig +2 -0
@@ -2,11 +2,13 @@ if ARCH_MX3 config ARCH_MX31 select ARCH_HAS_RNGA + select ARCH_MXC_DAM_V2 bool config ARCH_MX35 bool select ARCH_MXC_IOMUX_V3 + select ARCH_MXC_DAM_V2 comment "MX3 platforms:"
arch/arm/plat-mxc/Kconfig +7 -0
@@ -78,4 +78,11 @@ config ARCH_HAS_RNGA config ARCH_MXC_IOMUX_V3 bool + +config ARCH_MXC_DAM_V1 + bool + +config ARCH_MXC_DAM_V2 + bool + endif
arch/arm/plat-mxc/Makefile +2 -0
@@ -10,3 +10,5 @@ obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o obj-$(CONFIG_MXC_PWM) += pwm.o obj-$(CONFIG_MXC_ULPI) += ulpi.o +obj-$(CONFIG_ARCH_MXC_DAM_V1) += dam-v1.o +obj-$(CONFIG_ARCH_MXC_DAM_V2) += dam-v2.o
arch/arm/plat-mxc/dam-v1.c new file +33 -0
@@ -0,0 +1,33 @@ + +#include <linux/module.h> +#include <linux/err.h> +#include <linux/io.h> +#include <linux/clk.h> +#include <mach/dam.h> +#include <mach/hardware.h> + +static void __iomem *dam_base; + +#define MXC_DAM_V1_PCR (x) ((x) * 4) + +int mxc_dam_v1_configure_port (unsigned int port,unsigned int pcr) +{ +if (!dam_base) { +printk ("%s: not configured\n" , __func__); +return -ENOSYS ; + } + +writel (pcr, dam_base +MXC_DAM_V1_PCR (port)); + +return 0 ; +} +EXPORT_SYMBOL_GPL (mxc_dam_v1_configure_port); + +static int mxc_dam_v1_init (void ) +{ +if (cpu_is_mx27 () ||cpu_is_mx21 ()) + dam_base =IO_ADDRESS (AUDMUX_BASE_ADDR ); +return 0 ; +} + +postcore_initcall (mxc_dam_v1_init);
arch/arm/plat-mxc/dam-v2.c new file +56 -0
56 lines not on this page · raw message
arch/arm/plat-mxc/include/mach/dam.h new file +45 -0
45 lines not on this page · raw message
Signature · 1 line
1.6.5.2
Sascha Hauer
maintainerPATCH 9/9 i.MX35: Fix audmux clock
The i.MX35 Datasheet claims that CCM_CGR0[4] is for the audio muxer, but hardware tests showed that really CCM_CGR2[30] is for the audio muxer (which is labelled as admux in the datasheet). Fix this.
--- arch/arm/mach-mx3/clock-imx35.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
arch/arm/mach-mx3/clock-imx35.c +3 -4
@@ -335,7 +335,7 @@ static void clk_cgr_disable(struct clk *clk)DEFINE_CLOCK (asrc_clk,0 ,CCM_CGR0 ,0 ,NULL ,NULL );DEFINE_CLOCK (ata_clk,0 ,CCM_CGR0 ,2 , get_rate_ipg,NULL ); -DEFINE_CLOCK (audmux_clk,0 ,CCM_CGR0 ,4 ,NULL ,NULL ); +/* DEFINE_CLOCK(audmux_clk, 0, CCM_CGR0, 4, NULL, NULL); */ DEFINE_CLOCK (can1_clk,0 ,CCM_CGR0 ,6 , get_rate_ipg,NULL );DEFINE_CLOCK (can2_clk,1 ,CCM_CGR0 ,8 , get_rate_ipg,NULL );DEFINE_CLOCK (cspi1_clk,0 ,CCM_CGR0 ,10 , get_rate_ipg,NULL );
@@ -381,7 +381,7 @@ DEFINE_CLOCK(uart3_clk, 2, CCM_CGR2, 20, get_rate_uart, NULL);DEFINE_CLOCK (usbotg_clk,0 ,CCM_CGR2 ,22 , get_rate_otg,NULL );DEFINE_CLOCK (wdog_clk,0 ,CCM_CGR2 ,24 ,NULL ,NULL );DEFINE_CLOCK (max_clk,0 ,CCM_CGR2 ,26 ,NULL ,NULL ); -DEFINE_CLOCK (admux_clk,0 ,CCM_CGR2 ,30 ,NULL ,NULL ); +DEFINE_CLOCK (audmux_clk,0 ,CCM_CGR2 ,30 ,NULL ,NULL );DEFINE_CLOCK (csi_clk,0 ,CCM_CGR3 ,0 , get_rate_csi,NULL );DEFINE_CLOCK (iim_clk,0 ,CCM_CGR3 ,2 ,NULL ,NULL );
@@ -426,7 +426,6 @@ static struct clk nfc_clk = {static struct clk_lookup lookups[] = { _REGISTER_CLOCK(NULL, "asrc", asrc_clk) _REGISTER_CLOCK(NULL, "ata", ata_clk) - _REGISTER_CLOCK(NULL, "audmux", audmux_clk) _REGISTER_CLOCK(NULL, "can", can1_clk) _REGISTER_CLOCK(NULL, "can", can2_clk)_REGISTER_CLOCK ("spi_imx.0" ,NULL , cspi1_clk)
@@ -474,7 +473,7 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk) _REGISTER_CLOCK("mxc_wdt.0", NULL, wdog_clk) _REGISTER_CLOCK(NULL, "max", max_clk) - _REGISTER_CLOCK(NULL, "admux", admux_clk) + _REGISTER_CLOCK(NULL, "audmux", audmux_clk) _REGISTER_CLOCK(NULL, "csi", csi_clk) _REGISTER_CLOCK(NULL, "iim", iim_clk)_REGISTER_CLOCK (NULL ,"gpu2d" , gpu2d_clk)
Signature · 1 line
1.6.5.2
PATCH 8/9 MXC: Add a digital audio multiplexer (DAM) driver
In reply to Sascha HauerQuoted 8 lines · Sascha Hauer
Signed-off-by Sascha Hauer <[email protected]>--- arch/arm/mach-mx2/Kconfig | 2 + arch/arm/mach-mx3/Kconfig | 2 + arch/arm/plat-mxc/Kconfig | 7 ++++ arch/arm/plat-mxc/Makefile | 2 + arch/arm/plat-mxc/dam-v1.c | 33 ++++++++++++++++++++ arch/arm/plat-mxc/dam-v2.c | 56 ++++++++++++++++++++++++++++++++++
Is there any great reason to use the DAM name rather than AUDMUX? I've never heard it called anything except AUDMUX before, though I may have been missing something.
Sascha Hauer
maintainerPATCH 8/9 MXC: Add a digital audio multiplexer (DAM) driver
Hi Mark,
Quoted 10 lines · Mark Brown
Quoted 8 lines · Sascha Hauer
Signed-off-by Sascha Hauer <[email protected]>--- arch/arm/mach-mx2/Kconfig | 2 + arch/arm/mach-mx3/Kconfig | 2 + arch/arm/plat-mxc/Kconfig | 7 ++++ arch/arm/plat-mxc/Makefile | 2 + arch/arm/plat-mxc/dam-v1.c | 33 ++++++++++++++++++++ arch/arm/plat-mxc/dam-v2.c | 56 ++++++++++++++++++++++++++++++++++
Quoted 3 lines
Is there any great reason to use the DAM name rather than AUDMUX? I've never heard it called anything except AUDMUX before, though I may have been missing something.
I don't know who invented this name, but audmux seems better to me, too. Will change this.
Sascha
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Sascha Hauer
maintainerPATCH v2 8/9 MXC: Add a digital audio multiplexer driver
In reply to Sascha HauerHere is an updated version of this patch with audmux instead of DAM
Sascha
--- arch/arm/mach-mx2/Kconfig | 2 + arch/arm/mach-mx3/Kconfig | 2 + arch/arm/plat-mxc/Kconfig | 7 +++ arch/arm/plat-mxc/Makefile | 2 + arch/arm/plat-mxc/audmux-v1.c | 53 +++++++++++++++++++++ arch/arm/plat-mxc/audmux-v2.c | 77 +++++++++++++++++++++++++++++++ arch/arm/plat-mxc/include/mach/audmux.h | 52 +++++++++++++++++++++ 7 files changed, 195 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-mxc/audmux-v1.c create mode 100644 arch/arm/plat-mxc/audmux-v2.c create mode 100644 arch/arm/plat-mxc/include/mach/audmux.h
arch/arm/mach-mx2/Kconfig +2 -0
@@ -6,11 +6,13 @@ choice config MACH_MX21 bool "i.MX21 support" + select ARCH_MXC_AUDMUX_V1 help This enables support for Freescale's MX2 based i.MX21 processor. config MACH_MX27 bool "i.MX27 support" + select ARCH_MXC_AUDMUX_V1 help This enables support for Freescale's MX2 based i.MX27 processor.
arch/arm/mach-mx3/Kconfig +2 -0
@@ -2,11 +2,13 @@ if ARCH_MX3 config ARCH_MX31 select ARCH_HAS_RNGA + select ARCH_MXC_AUDMUX_V2 bool config ARCH_MX35 bool select ARCH_MXC_IOMUX_V3 + select ARCH_MXC_AUDMUX_V2 comment "MX3 platforms:"
arch/arm/plat-mxc/Kconfig +7 -0
@@ -78,4 +78,11 @@ config ARCH_HAS_RNGA config ARCH_MXC_IOMUX_V3 bool + +config ARCH_MXC_AUDMUX_V1 + bool + +config ARCH_MXC_AUDMUX_V2 + bool + endif
arch/arm/plat-mxc/Makefile +2 -0
@@ -10,3 +10,5 @@ obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o obj-$(CONFIG_MXC_PWM) += pwm.o obj-$(CONFIG_MXC_ULPI) += ulpi.o +obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o +obj-$(CONFIG_ARCH_MXC_AUDMUX_V2) += audmux-v2.o
arch/arm/plat-mxc/audmux-v1.c new file +53 -0
53 lines not on this page · raw message
arch/arm/plat-mxc/audmux-v2.c new file +77 -0
77 lines not on this page · raw message
arch/arm/plat-mxc/include/mach/audmux.h new file +52 -0
52 lines not on this page · raw message
Signature · 7 lines
1.6.5.2 -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
PATCH v2 8/9 MXC: Add a digital audio multiplexer driver
Quoted 12 lines · Sascha Hauer
arch/arm/plat-mxc/audmux-v2.c new file +12
-0+static int mxc_audmux_v2_init (void ) +{ +int ret; + +if (cpu_is_mx31 () ||cpu_is_mx35 ()) + audmux_base =IO_ADDRESS (AUDMUX_BASE_ADDR ); +else +return 0 ; + +if (cpu_is_mx35 ()) { + audmux_clk =clk_get (NULL ,"audmux" ); +if (IS_ERR (audmux_clk)) {
arch/arm/plat-mxc/audmux-v2.c line 75
Quoted 10 lines
arch/arm/plat-mxc/audmux-v2.c new file +10
-0+ audmux_base =NULL ; + ret =PTR_ERR (audmux_clk); +printk (KERN_ERR "%s: cannot get clock: %d\n" , __func__, + ret); +return ret; + } + } + +return 0 ; +}
Hmm. Wouldn't something like:
if (cpu_is_mx35()) {
audmux_clk = clk_get(NULL, "audmux");
if (IS_ERR(audmux_clk)) {
int ret = PTR_ERR(audmux_clk);
printk(KERN_ERR "%s: cannot get clock: %d\n", __func__,
ret);
return ret;
}
}
if (cpu_is_mx31() || cpu_is_mx35())
audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR);
return 0;be a better and clearer way to write this?
Sascha Hauer
maintainerPATCH v2 8/9 MXC: Add a digital audio multiplexer driver
Quoted 41 lines · Russell King - ARM Linux
Quoted 12 lines · Sascha Hauer
arch/arm/plat-mxc/audmux-v2.c new file +12
-0+static int mxc_audmux_v2_init (void ) +{ +int ret; + +if (cpu_is_mx31 () ||cpu_is_mx35 ()) + audmux_base =IO_ADDRESS (AUDMUX_BASE_ADDR ); +else +return 0 ; + +if (cpu_is_mx35 ()) { + audmux_clk =clk_get (NULL ,"audmux" ); +if (IS_ERR (audmux_clk)) {arch/arm/plat-mxc/audmux-v2.c line 75
Quoted 10 lines
arch/arm/plat-mxc/audmux-v2.c new file +10
-0+ audmux_base =NULL ; + ret =PTR_ERR (audmux_clk); +printk (KERN_ERR "%s: cannot get clock: %d\n" , __func__, + ret); +return ret; + } + } + +return 0 ; +}Hmm. Wouldn't something like:
if (cpu_is_mx35()) { audmux_clk = clk_get(NULL, "audmux"); if (IS_ERR(audmux_clk)) { int ret = PTR_ERR(audmux_clk); printk(KERN_ERR "%s: cannot get clock: %d\n", __func__, ret); return ret; } } if (cpu_is_mx31() || cpu_is_mx35()) audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR); return 0;
Quoted 1 line
be a better and clearer way to write this?
Indeed. I Changed this.
Sascha
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
PATCH v2 8/9 MXC: Add a digital audio multiplexer driver
In reply to Sascha HauerHi Sascha,
as you know I have been testing your i.MX27 support and I have found a problem in this audmux patch.
Please, see my comment below:
+++ b/arch/arm/plat-mxc/audmux-v1.c
Quoted 23 lines
arch/arm/plat-mxc/audmux-v1.c new file +21
-0@@ -0,0 +1,53 @@ +/* +* Copyright 2009 Pengutronix, Sascha Hauer <[email protected]> +* +* Initial development of this code was funded by +* Phytec Messtechnik GmbH, http://www.phytec.de +* +* 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. +*/ +
arch/arm/plat-mxc/audmux-v1.c line 31
Quoted 10 lines
arch/arm/plat-mxc/audmux-v1.c new file +10
-0+#include <linux/module.h> +#include <linux/err.h> +#include <linux/io.h> +#include <linux/clk.h> +#include <mach/audmux.h> +#include <mach/hardware.h> + +static void __iomem *audmux_base; + +#define MXC_AUDMUX_V1_PCR (x) ((x) * 4)
You cannot calculate AUDMUX register offsets this way because according to i.MX27 manual:
0x1001_6000 (HPCR1)
0x1001_6004 (HPCR2)
0x1001_6008 (HPCR3)
0x1001_6010 (PPCR1) <-- You are using 0x0C for this 0x1001_6014 (PPCR2) <--- You are using 0x10 for this 0x1001_601C (PPCR3) <--- You are using 0x18 for this
+int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr)
Quoted 12 lines
arch/arm/plat-mxc/audmux-v1.c new file +10
-0+{ +if (!audmux_base) { +printk ("%s: not configured\n" , __func__); +return -ENOSYS ; + } + +writel (pcr, audmux_base +MXC_AUDMUX_V1_PCR (port)); + +return 0 ; +}
arch/arm/plat-mxc/audmux-v1.c line 53
Quoted 10 lines
arch/arm/plat-mxc/audmux-v1.c new file +10
-0+EXPORT_SYMBOL_GPL (mxc_audmux_v1_configure_port); + +static int mxc_audmux_v1_init (void ) +{ +if (cpu_is_mx27 () ||cpu_is_mx21 ()) + audmux_base =IO_ADDRESS (AUDMUX_BASE_ADDR ); +return 0 ; +} + +postcore_initcall (mxc_audmux_v1_init);
Thank you.
Signature · 10 lines
Javier Martin Vista Silicon S.L. CDTUC - FASE C - Oficina S-345 Avda de los Castros s/n 39005- Santander. Cantabria. Spain +34 942 25 32 60 www.vista-silicon.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091130/7a393e51/attachment-0001.htm>
Sascha Hauer
maintainerPATCH v2 8/9 MXC: Add a digital audio multiplexer driver
Quoted 45 lines · javier Martin
Hi Sascha,
as you know I have been testing your i.MX27 support and I have found a problem in this audmux patch.Please, see my comment below:
+++
b/arch/arm/plat-mxc/audmux-v1.cQuoted 23 lines
arch/arm/plat-mxc/audmux-v1.c new file +21
-0@@ -0,0 +1,53 @@ +/* +* Copyright 2009 Pengutronix, Sascha Hauer <[email protected]> +* +* Initial development of this code was funded by +* Phytec Messtechnik GmbH, http://www.phytec.de +* +* 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. +*/ +arch/arm/plat-mxc/audmux-v1.c line 31
Quoted 10 lines
arch/arm/plat-mxc/audmux-v1.c new file +10
-0+#include <linux/module.h> +#include <linux/err.h> +#include <linux/io.h> +#include <linux/clk.h> +#include <mach/audmux.h> +#include <mach/hardware.h> + +static void __iomem *audmux_base; + +#define MXC_AUDMUX_V1_PCR (x) ((x) * 4)You cannot calculate AUDMUX register offsets this way because according to i.MX27 manual:
Quoted 6 lines
0x1001_6000 (HPCR1)
0x1001_6004 (HPCR2)
0x1001_6008 (HPCR3)0x1001_6010 (PPCR1) <-- You are using 0x0C for this 0x1001_6014 (PPCR2) <--- You are using 0x10 for this 0x1001_601C (PPCR3) <--- You are using 0x18 for this
It's fine the way it is. See mach/audmux.h:
#define MX27_AUDMUX_HPCR1_SSI0 0
#define MX27_AUDMUX_HPCR2_SSI1 1
#define MX27_AUDMUX_HPCR3_SSI_PINS_4 2
#define MX27_AUDMUX_PPCR1_SSI_PINS_1 3
#define MX27_AUDMUX_PPCR2_SSI_PINS_2 4
#define MX27_AUDMUX_PPCR3_SSI_PINS_3 5
Sascha
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
PATCH v2 8/9 MXC: Add a digital audio multiplexer driver
Quoted 11 lines
Quoted 1 line
You cannot calculate AUDMUX register offsets this way because according
to
Quoted 8 lines
i.MX27 manual:
0x1001_6000 (HPCR1)
0x1001_6004 (HPCR2)
0x1001_6008 (HPCR3)0x1001_6010 (PPCR1) <-- You are using 0x0C for this 0x1001_6014 (PPCR2) <--- You are using 0x10 for this 0x1001_601C (PPCR3) <--- You are using 0x18 for this
Quoted 9 lines
It's fine the way it is. See
mach/audmux.h:#define MX27_AUDMUX_HPCR1_SSI0 0 #define MX27_AUDMUX_HPCR2_SSI1 1 #define MX27_AUDMUX_HPCR3_SSI_PINS_4 2 #define MX27_AUDMUX_PPCR1_SSI_PINS_1 3 #define MX27_AUDMUX_PPCR2_SSI_PINS_2 4 #define MX27_AUDMUX_PPCR3_SSI_PINS_3 5
Sorry for my insistence but, unless I am missing something weird, I have looked at mach/audmux.h and still think that it is wrong:
AUDMUX PORT Your offset i.MX27 Manual offset
--------------------------- ------------------
---------------------------------------
(0) HPCR1 (0 x 4) = 0x0 0x00 (1) HPCR2 (1 x 4) = 0x4 0x04 (2) HPCR3 (2 x 4) = 0x8 0x08 (3) PPCR1 (3 x 4) = 0xC 0x10 (4) HPCR2 (4 x 4) = 0x10 0x14 (5) HPCR3 (5 x 4) = 0x14 0x1C
Signature · 10 lines
Javier Martin Vista Silicon S.L. CDTUC - FASE C - Oficina S-345 Avda de los Castros s/n 39005- Santander. Cantabria. Spain +34 942 25 32 60 www.vista-silicon.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091130/92016fac/attachment-0001.htm>
Sascha Hauer
maintainerPATCH v2 8/9 MXC: Add a digital audio multiplexer driver
Quoted 28 lines · javier Martin
Quoted 11 lines
Quoted 1 line
You cannot calculate AUDMUX register offsets this way because according
to
Quoted 8 lines
i.MX27 manual:
0x1001_6000 (HPCR1)
0x1001_6004 (HPCR2)
0x1001_6008 (HPCR3)0x1001_6010 (PPCR1) <-- You are using 0x0C for this 0x1001_6014 (PPCR2) <--- You are using 0x10 for this 0x1001_601C (PPCR3) <--- You are using 0x18 for thisQuoted 9 lines
It's fine the way it is. See
mach/audmux.h:#define MX27_AUDMUX_HPCR1_SSI0 0 #define MX27_AUDMUX_HPCR2_SSI1 1 #define MX27_AUDMUX_HPCR3_SSI_PINS_4 2 #define MX27_AUDMUX_PPCR1_SSI_PINS_1 3 #define MX27_AUDMUX_PPCR2_SSI_PINS_2 4 #define MX27_AUDMUX_PPCR3_SSI_PINS_3 5Sorry for my insistence but, unless I am missing something weird, I have looked at
mach/audmux.hand still think that it is wrong:AUDMUX PORT Your offset i.MX27 Manual offset
--------------------------- ------------------
---------------------------------------
Quoted 6 lines
(0) HPCR1 (0 x 4) = 0x0 0x00 (1) HPCR2 (1 x 4) = 0x4 0x04 (2) HPCR3 (2 x 4) = 0x8 0x08 (3) PPCR1 (3 x 4) = 0xC 0x10 (4) HPCR2 (4 x 4) = 0x10 0x14 (5) HPCR3 (5 x 4) = 0x14 0x1C
Oops, you're right. I have overlooked this whole in the register space. The following should fix it.
Sascha
PATCH v2 8/9 MXC: Add a digital audio multiplexer driver
Quoted 2 lines
From [email protected] Fri Nov 6 13:01:15 2009
From: [email protected] ()
Date: Fri, 06 Nov 2009 18:01:15 -0000
Subject: No subject
Message-ID: <[email protected]>
Quoted 17 lines
From: Sascha Hauer <[email protected]>
Date: Mon, 30 Nov 2009 13:31:29 +0100
Subject: [PATCH] i.MX27 audmux: Fix register offsetsThe PPCR registers start at
0x10, not0xc. Fix this.Signed-off-by Sascha Hauer <[email protected]>--- arch/arm/plat-mxc/include/mach/audmux.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)arch/arm/plat-mxc/include/mach/audmux.h +0
-0
arch/arm/plat-mxc/include/mach/audmux.h line 10
Quoted 10 lines
arch/arm/plat-mxc/include/mach/audmux.h +3
-3@@ -4,9 +4,9 @@#define MX27_AUDMUX_HPCR1_SSI0 0#define MX27_AUDMUX_HPCR2_SSI1 1#define MX27_AUDMUX_HPCR3_SSI_PINS_4 2 -#define MX27_AUDMUX_PPCR1_SSI_PINS_1 3 -#define MX27_AUDMUX_PPCR2_SSI_PINS_2 4 -#define MX27_AUDMUX_PPCR3_SSI_PINS_3 5 +#define MX27_AUDMUX_PPCR1_SSI_PINS_1 4 +#define MX27_AUDMUX_PPCR2_SSI_PINS_2 5 +#define MX27_AUDMUX_PPCR3_SSI_PINS_3 6
Be careful,
I think this patch breaks some of the boards currently using MXC_AUDMUX_V1_PCR_RXDSEL(x) and similar macros defined in mach/audmux.h (for example pcm038).
For those macros the old AUDMUX register indexes are fine.
I suggest fixing this inside audmux_v1.c instead of modifying mach/audmux.h.
Thank you.
Signature · 11 lines
Javier Martin Vista Silicon S.L. CDTUC - FASE C - Oficina S-345 Avda de los Castros s/n 39005- Santander. Cantabria. Spain +34 942 25 32 60 www.vista-silicon.com --0016e6d58cb2408bb9047996596d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Quoted 1 line
From [email protected] Fri Nov 6 13:01:15 2009
From: [email protected] ()
Date: Fri, 06 Nov 2009 18:01:15 -0000
Subject: No subject
Message-ID: <[email protected]>
div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"border= -left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-lef=
t: 1ex;">
From: Sascha Hauer <<a href=3D"mailto:[email protected]">s.hauer at pe= ngutronix.de</a>><br>
Date: Mon, 30 Nov 2009 13:31:29 +0100<br>
Subject: [PATCH] i.MX27 audmux: Fix register offsets<br>
<br>
The PPCR registers start at 0x10, not 0xc. Fix this.<br>
<br>
.hauer at pengutronix.de</a>><br>
---<br>
=A0arch/arm/plat-mxc/include/mach/audmux.h | =A0 =A06 +++---<br> =A01 files changed, 3 insertions(+), 3 deletions(-)<br> <br>
arch/arm/plat-mxc/in= renamed from arch/arm/plat-mxc/include/mach/audmux.h +0 -0
clude/mach/audmux.h<br>
index 5cd6466..dcc12d4 100644<br>
arch/arm/plat-mxc/include/mach/audmux.h<br> +0 -0
@@ -4,9 +4,9 @@<br>
<div class=3D"im">=A0#define MX27_AUDMUX_HPCR1_SSI0 =A0 =A0 =A0 =A0 0<br> =A0#define MX27_AUDMUX_HPCR2_SSI1 =A0 =A0 =A0 =A0 1<br> =A0#define MX27_AUDMUX_HPCR3_SSI_PINS_4 =A0 2<br>
-#define MX27_AUDMUX_PPCR1_SSI_PINS_1 =A0 3<br>
-#define MX27_AUDMUX_PPCR2_SSI_PINS_2 =A0 4<br>
-#define MX27_AUDMUX_PPCR3_SSI_PINS_3 =A0 5<br>
</div>+#define MX27_AUDMUX_PPCR1_SSI_PINS_1 =A0 4<br>
+#define MX27_AUDMUX_PPCR2_SSI_PINS_2 =A0 5<br>
+#define MX27_AUDMUX_PPCR3_SSI_PINS_3 =A0 6<br></blockquote><br>Be careful,= <br>I think this patch breaks some of the boards currently using MXC_AUDMUX= _V1_PCR_RXDSEL(x) and similar macros defined in mach/audmux.h (for example = pcm038).<br>
For those macros the old AUDMUX register indexes are fine.<br><br>I suggest=
fixing this inside audmux_v1.c instead of modifying mach/audmux.h.<br><br>=
<br>Thank you.<br></div>-- <br>Javier Martin<br>Vista Silicon S.L.<br>CDTUC=
- FASE C - Oficina S-345<br>
Avda de los Castros s/n<br>39005- Santander. Cantabria. Spain<br>+34 942 25=
32 60<br><a href=3D"http://www.vista-silicon.com">www.vista-silicon.com</a=
Quoted 1 line
<br>
--0016e6d58cb2408bb9047996596d--
Sascha Hauer
maintainerPATCH v2 8/9 MXC: Add a digital audio multiplexer driver
Quoted 36 lines · javier Martin
From
fa87b65915e78ad29a8e4f3f22b26ed0fa6dc7f5Mon Sep 17 00:00:00 2001Quoted 17 lines
From: Sascha Hauer <[email protected]>
Date: Mon, 30 Nov 2009 13:31:29 +0100
Subject: [PATCH] i.MX27 audmux: Fix register offsetsThe PPCR registers start at
0x10, not0xc. Fix this.Signed-off-by Sascha Hauer <[email protected]>--- arch/arm/plat-mxc/include/mach/audmux.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)arch/arm/plat-mxc/include/mach/audmux.h +0
-0arch/arm/plat-mxc/include/mach/audmux.h line 10
Quoted 10 lines
arch/arm/plat-mxc/include/mach/audmux.h +3
-3@@ -4,9 +4,9 @@#define MX27_AUDMUX_HPCR1_SSI0 0#define MX27_AUDMUX_HPCR2_SSI1 1#define MX27_AUDMUX_HPCR3_SSI_PINS_4 2 -#define MX27_AUDMUX_PPCR1_SSI_PINS_1 3 -#define MX27_AUDMUX_PPCR2_SSI_PINS_2 4 -#define MX27_AUDMUX_PPCR3_SSI_PINS_3 5 +#define MX27_AUDMUX_PPCR1_SSI_PINS_1 4 +#define MX27_AUDMUX_PPCR2_SSI_PINS_2 5 +#define MX27_AUDMUX_PPCR3_SSI_PINS_3 6Be careful,
I think this patch breaks some of the boards currently usingMXC_AUDMUX_V1_PCR_RXDSEL(x)and similar macros defined inmach/audmux.h(for example pcm038).
For those macros the old AUDMUX register indexes are fine.
Quoted 1 line
I suggest fixing this inside
audmux_v1.cinstead of modifyingmach/audmux.h.
Ok. The AUDMUX V1 is used on i.MX21 and i.MX27 and both have this hole in the register space, so fixing it in the driver should be safe.
How about this one then?
Sascha
PATCH v2 8/9 MXC: Add a digital audio multiplexer driver
2009/11/30 Sascha Hauer <[email protected]>
Quoted 77 lines · javier Martin
Quoted 25 lines
From
fa87b65915e78ad29a8e4f3f22b26ed0fa6dc7f5Mon Sep 17 00:00:00 2001Quoted 23 lines
From: Sascha Hauer <[email protected]>
Date: Mon, 30 Nov 2009 13:31:29 +0100
Subject: [PATCH] i.MX27 audmux: Fix register offsetsThe PPCR registers start at
0x10, not0xc. Fix this.Signed-off-by Sascha Hauer <[email protected]>--- arch/arm/plat-mxc/include/mach/audmux.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)arch/arm/plat-mxc/include/mach/audmux.h +0
-3@@ -4,9 +4,9 @@#define MX27_AUDMUX_HPCR1_SSI0 0#define MX27_AUDMUX_HPCR2_SSI1 1#define MX27_AUDMUX_HPCR3_SSI_PINS_4 2 -#define MX27_AUDMUX_PPCR1_SSI_PINS_1 3 -#define MX27_AUDMUX_PPCR2_SSI_PINS_2 4 -#define MX27_AUDMUX_PPCR3_SSI_PINS_3 5Quoted 8 lines
arch/arm/plat-mxc/include/mach/audmux.h line 10
Quoted 4 lines
arch/arm/plat-mxc/include/mach/audmux.h +3
-0+#define MX27_AUDMUX_PPCR1_SSI_PINS_1 4 +#define MX27_AUDMUX_PPCR2_SSI_PINS_2 5 +#define MX27_AUDMUX_PPCR3_SSI_PINS_3 6Be careful,
I think this patch breaks some of the boards currently usingMXC_AUDMUX_V1_PCR_RXDSEL(x)and similar macros defined inmach/audmux.h(for
Quoted 4 lines
example pcm038).
For those macros the old AUDMUX register indexes are fine.I suggest fixing this inside
audmux_v1.cinstead of modifying
mach/audmux.h.Ok. The AUDMUX V1 is used on i.MX21 and i.MX27 and both have this hole in the register space, so fixing it in the driver should be safe.
How about this one then?
Sascha
From
297b5c4cea40c2e7023bbdb96a0c90c13b0e02a1Mon Sep 17 00:00:00 2001
From: Sascha Hauer <[email protected]>
Date: Mon, 30 Nov 2009 13:31:29 +0100
Subject: [PATCH] i.MX27 audmux: Fix register offsetsThe PPCR registers start at
0x10, not0xc. Fix this.Signed-off-by Sascha Hauer <[email protected]>--- arch/arm/plat-mxc/audmux-v1.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)arch/arm/plat-mxc/audmux-v1.c +4
-0@@ -37,6 +37,10 @@ int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr)return -ENOSYS ; } +/* handle hole in the register space */ +if (port >2 ) + port++; +writel (pcr, audmux_base +MXC_AUDMUX_V1_PCR (port));return 0;
Quoted 3 lines
--
1.6.5.2
Sascha,
there are actually two holes, with this current patch, PPCR3 still receives a wrong value:
0x1001_6000 (HPCR1)
0x1001_6004 (HPCR2)
0x1001_6008 (HPCR3)
0x1001_600C (hole)
0x1001_6010 (PPCR1)
0x1001_6014 (PPCR2)
0x1001_6018 (hole)
0x1001_601C (PPCR3)
Thank you.
Signature · 10 lines
Javier Martin Vista Silicon S.L. CDTUC - FASE C - Oficina S-345 Avda de los Castros s/n 39005- Santander. Cantabria. Spain +34 942 25 32 60 www.vista-silicon.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091130/33464ed9/attachment-0001.htm>
Quoted 1 line
From [email protected] Fri Nov 6 13:01:15 2009
From: [email protected] ()
Date: Fri, 06 Nov 2009 18:01:15 -0000
Subject: No subject
Message-ID: <[email protected]>
<div class=3D"im">From: Sascha Hauer <<a href=3D"mailto:s.hauer@pengutro= nix.de">s.hauer at pengutronix.de</a>><br>
Date: Mon, 30 Nov 2009 13:31:29 +0100<br>
Subject: [PATCH] i.MX27 audmux: Fix register offsets<br>
<br>
The PPCR registers start at 0x10, not 0xc. Fix this.<br>
<br>
.hauer at pengutronix.de</a>><br>
---<br>
</div>=A0arch/arm/plat-mxc/audmux-v1.c | =A0 =A04 ++++<br>
<div class=3D"im">=A01 files changed, 4 insertions(+), 0 deletions(-)<br> <br>
</div>diff --git a/arch/arm/plat-mxc/audmux-v1.c b/arch/arm/plat-mxc/audmux= -v1.c<br>
index 70ab5af..8fbce7b 100644<br>
arch/arm/plat-mxc/audmux-v1.c<br> +0 -0
@@ -37,6 +37,10 @@ int mxc_audmux_v1_configure_port(unsigned int port, unsi=
gned int pcr)<br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -ENOSYS;<br>
=A0 =A0 =A0 =A0}<br>
<br>
+ =A0 =A0 =A0 /* handle hole in the register space */<br>
+ =A0 =A0 =A0 if (port > 2)<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 port++;<br>
+<br>
<div class=3D"im"> =A0 =A0 =A0 =A0writel(pcr, audmux_base + MXC_AUDMUX_V1_P= CR(port));<br>
<br>
=A0 =A0 =A0 =A0return 0;<br>
</div><div><div></div><div>--<br> 1.6.5.2<br></div></div></blockquote><div>=A0<br>Sascha,<br>there are actual= ly two holes, with this current patch, PPCR3 still receives a wrong value:<= br><br></div>0x1001_6000 (HPCR1) <br>0x1001_6004 (HPCR2)<br>0x1001_6008 (HP= CR3) <br>
0x1001_600C (hole)<br>0x1001_6010 (PPCR1)<br>0x1001_6014 (PPCR2)<br>0x1001_= 6018 (hole)<br>0x1001_601C (PPCR3)<br><br></div><br clear=3D"all">Thank you= .<br><br>-- <br>Javier Martin<br>Vista Silicon S.L.<br>CDTUC - FASE C - Ofi= cina S-345<br>
Avda de los Castros s/n<br>39005- Santander. Cantabria. Spain<br>+34 942 25=
32 60<br><a href=3D"http://www.vista-silicon.com">www.vista-silicon.com</a=
Quoted 1 line
<br>
--0016e6d9a0e82a18a0047998f48a--
Sascha Hauer
maintainerPATCH v2 8/9 MXC: Add a digital audio multiplexer driver
Quoted 87 lines · javier Martin
2009/11/30 Sascha Hauer <[email protected]>
Quoted 77 lines · javier Martin
Quoted 25 lines
From
fa87b65915e78ad29a8e4f3f22b26ed0fa6dc7f5Mon Sep 17 00:00:00 2001Quoted 23 lines
From: Sascha Hauer <[email protected]>
Date: Mon, 30 Nov 2009 13:31:29 +0100
Subject: [PATCH] i.MX27 audmux: Fix register offsetsThe PPCR registers start at
0x10, not0xc. Fix this.Signed-off-by Sascha Hauer <[email protected]>--- arch/arm/plat-mxc/include/mach/audmux.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)arch/arm/plat-mxc/include/mach/audmux.h +0
-3@@ -4,9 +4,9 @@#define MX27_AUDMUX_HPCR1_SSI0 0#define MX27_AUDMUX_HPCR2_SSI1 1#define MX27_AUDMUX_HPCR3_SSI_PINS_4 2 -#define MX27_AUDMUX_PPCR1_SSI_PINS_1 3 -#define MX27_AUDMUX_PPCR2_SSI_PINS_2 4 -#define MX27_AUDMUX_PPCR3_SSI_PINS_3 5Quoted 8 lines
arch/arm/plat-mxc/include/mach/audmux.h line 10
Quoted 4 lines
arch/arm/plat-mxc/include/mach/audmux.h +3
-0+#define MX27_AUDMUX_PPCR1_SSI_PINS_1 4 +#define MX27_AUDMUX_PPCR2_SSI_PINS_2 5 +#define MX27_AUDMUX_PPCR3_SSI_PINS_3 6Be careful,
I think this patch breaks some of the boards currently usingMXC_AUDMUX_V1_PCR_RXDSEL(x)and similar macros defined inmach/audmux.h(for
Quoted 4 lines
example pcm038).
For those macros the old AUDMUX register indexes are fine.I suggest fixing this inside
audmux_v1.cinstead of modifying
mach/audmux.h.Ok. The AUDMUX V1 is used on i.MX21 and i.MX27 and both have this hole in the register space, so fixing it in the driver should be safe.
How about this one then?
Sascha
From
297b5c4cea40c2e7023bbdb96a0c90c13b0e02a1Mon Sep 17 00:00:00 2001
From: Sascha Hauer <[email protected]>
Date: Mon, 30 Nov 2009 13:31:29 +0100
Subject: [PATCH] i.MX27 audmux: Fix register offsetsThe PPCR registers start at
0x10, not0xc. Fix this.Signed-off-by Sascha Hauer <[email protected]>--- arch/arm/plat-mxc/audmux-v1.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)arch/arm/plat-mxc/audmux-v1.c +4
-0@@ -37,6 +37,10 @@ int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr)return -ENOSYS ; } +/* handle hole in the register space */ +if (port >2 ) + port++; +writel (pcr, audmux_base +MXC_AUDMUX_V1_PCR (port));return 0;Quoted 3 lines
--
1.6.5.2Sascha,
there are actually two holes, with this current patch, PPCR3 still receives a wrong value:
Quoted 8 lines
0x1001_6000 (HPCR1)
0x1001_6004 (HPCR2)
0x1001_6008 (HPCR3)
0x1001_600C (hole)
0x1001_6010 (PPCR1)
0x1001_6014 (PPCR2)
0x1001_6018 (hole)
0x1001_601C (PPCR3)
Grumpf. I'm not creating a new patch before getting some sleep.
Sascha
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Sascha Hauer
maintainerPATCH v2 8/9 MXC: Add a digital audio multiplexer driver
In reply to javier MartinQuoted 5 lines · javier Martin
Sascha,
there are actually two holes, with this current patch, PPCR3 still receives a wrong value:
Quoted 8 lines
0x1001_6000 (HPCR1)
0x1001_6004 (HPCR2)
0x1001_6008 (HPCR3)
0x1001_600C (hole)
0x1001_6010 (PPCR1)
0x1001_6014 (PPCR2)
0x1001_6018 (hole)
0x1001_601C (PPCR3)
Lets hope I had enough sleep this night...
Sascha
PATCH v2 8/9 MXC: Add a digital audio multiplexer driver
Quoted 40 lines
From
4c8b581dd28588940a328632e406baab574e0ce5Mon Sep 17 00:00:00 2001
From: Sascha Hauer <[email protected]>
Date: Mon, 30 Nov 2009 13:31:29 +0100
Subject: [PATCH] i.MX27 audmux: Fix register offsetsWe have two holes in the register space. The driver did not handle this. Fix it.
Signed-off-by Sascha Hauer <[email protected]>--- arch/arm/plat-mxc/audmux-v1.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)arch/arm/plat-mxc/audmux-v1.c +7
-2@@ -28,7 +28,9 @@static void __iomem *audmux_base; -#define MXC_AUDMUX_V1_PCR (x) ((x) * 4) +static unsigned char port_mapping[] = { +0x0 ,0x4 ,0x8 ,0x10 ,0x14 ,0x1c , +};int mxc_audmux_v1_configure_port (unsigned int port,unsigned int pcr) {@@ -37,7 +39,10 @@ int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr)return -ENOSYS ; } -writel (pcr, audmux_base +MXC_AUDMUX_V1_PCR (port)); +if (port >=ARRAY_SIZE (port_mapping)) +return -EINVAL ; + +writel (pcr, audmux_base + port_mapping[port]);return 0 ;
Quoted 4 lines
}
--
1.6.5.2
Yes,
it works now. Thank you for your patience with this.
Signature · 10 lines
Javier Martin Vista Silicon S.L. CDTUC - FASE C - Oficina S-345 Avda de los Castros s/n 39005- Santander. Cantabria. Spain +34 942 25 32 60 www.vista-silicon.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091202/f10ccfe5/attachment-0001.htm>
PATCH 5/9 pcm043: Add NAND support
In reply to Sascha HauerSascha,
Quoted 49 lines · Sascha Hauer
From: Sascha Hauer <[email protected]>
Subject: [PATCH 5/9] pcm043: Add NAND support
To: linux-arm-kernel at lists.infradead.org
Cc: "Sascha Hauer" <[email protected]>
Date: Thursday, November 12, 2009, 8:42 AMSigned-off-by Sascha Hauer <[email protected]>---
arch/arm/mach-mx3/pcm043.c|? ? 7 +++++++1 files changed, 7 insertions(+), 0 deletions(-)arch/arm/mach-mx3/pcm043.c +6
-0@@ -43,6 +43,7 @@#include <mach/iomux-mx35.h> #include <mach/ipu.h> #include <mach/mx3fb.h> +#include <mach/mxc_nand.h> #include "devices.h" @@ -206,6 +207,11 @@ static struct pad_desc pcm043_pads[] = { ??? MX35_PAD_ATA_CS0__GPIO2_6, }; +static struct mxc_nand_platform_data pcm037_nand_board_info = { +??? .width = 1, +??? .hw_ecc = 1, +}; +/* ? * Board specific initialization.
? */arch/arm/mach-mx3/pcm043.c +0
-0@@ -216,6 +222,7 @@ static void __initmxc_board_init (void) ??? platform_add_devices(devices, ARRAY_SIZE(devices)); ??? mxc_register_device(&mxc_uart_device0,
&uart_pdata);
+???mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info);
Quoted 6 lines
???
mxc_register_device(&mxc_uart_device1, &uart_pdata);Signature · 1 line
1.6.5.2
Have you managed to load a root file system via JFFS2 on this board?
Thanks,
Fabio Estevam
Sascha Hauer
maintainerPATCH 5/9 pcm043: Add NAND support
Hi Fabio,
Quoted 2 lines · Fabio Estevam
Have you managed to load a root file system via JFFS2 on this board?
No, I'm using UBIFS. There still is a bug with oob handling preventing jffs2 to work properly on i.MX35 (see my mail on the mtd list). I have a fix for this and I assume I could boot from JFFS2 now, but I haven't tested.
Sascha
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
PATCH 2/9 MXC NFC: Fix NFCs address area on i.MX35
In reply to Sascha HauerHi
Sascha Hauer skrev:
Quoted 3 lines
From: Juergen Beisert <[email protected]>
The address area of the NFS in the i.MX35 silicon is much larger than 4k.
"NFS"? Did you mean "NFC" or am I missing something?
Regards, Magnus
Sascha Hauer
maintainerPATCH 2/9 MXC NFC: Fix NFCs address area on i.MX35
Quoted 8 lines · Magnus Lilja
Hi
Sascha Hauer skrev:
Quoted 3 lines
From: Juergen Beisert <[email protected]>
The address area of the NFS in the i.MX35 silicon is much larger than 4k.
"NFS"? Did you mean "NFC" or am I missing something?
I meant NFC of course.
Sascha
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Sascha Hauer
maintainerQuoted 7 lines · Sascha Hauer
Hi,
Here are some patches for the next merge window to review which aim at sound and add Nand support for the pcm043 board.
Sascha
Quoted 7 lines
The following changes since commit
52d797c8c0b53e3940427ff0c43ef4356f1d668e:
Uwe Kleine-K?nig (1):
imx/gpio: Usehandle_level_irqare available in the git repository at:
git://git.pengutronix.de/git/imx/linux-2.6.gitmxc-master-pu
Added this series to mxc-master (including the comments I received for these patches)
Sascha
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |