Re: [uClinux-dev] PATCH: Problems with SPI/GPIO on 520x
Hi Peter, On 09/08/11 00:47, Peter Turczak wrote: Hi Greg, thank you for the hint with scripts/checkpatch.pl, it helped a lot. On Aug 8, 2011, at 7:03 AM, Greg Ungerer wrote: > Overall it looks right. Just a couple of minor nits to clean up: > Lets simplify the logic here a little and do: Done. > > There is no spi-mcf520x.c in this patch... > Is there supposed to be? This is a platform definition file for my hardware. This will be be released along with the hardware. Just forget about it.. > > Can you regenerate your patch, and add a Signed-off-by? Please find attached the regenerated patch. Great, that looks good thanks. Applied to the m68knommu git tree. Regards Greg Greg Ungerer -- Principal EngineerEMAIL: g...@snapgear.com SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] PATCH: Problems with SPI/GPIO on 520x
Hi Greg, thank you for the hint with scripts/checkpatch.pl, it helped a lot. On Aug 8, 2011, at 7:03 AM, Greg Ungerer wrote: > Overall it looks right. Just a couple of minor nits to clean up: > Lets simplify the logic here a little and do: Done. > > There is no spi-mcf520x.c in this patch... > Is there supposed to be? This is a platform definition file for my hardware. This will be be released along with the hardware. Just forget about it.. > > Can you regenerate your patch, and add a Signed-off-by? Please find attached the regenerated patch. > > Regards > Greg Regards, Peter linux-3.0.0+-5208_spi.patch Description: Binary data ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] PATCH: Problems with SPI/GPIO on 520x
Hi Peter, On 06/08/11 00:44, Peter Turczak wrote: following the path I found yesterday I discovered the reason for the strange behavior of the chip select pins when toggled from the spi driver via the kernel gpio api. The problem has its root in the calculation of the set-port offsets (macro MCFGPIO_SETR() in arch/m68k/include/gpio.h), this assumes that all ports have the same offset from the base port address (MCFGPIO_SETR) which is defined in mcf520xsim.h as an alias of MCFGIO_PSETR_BUSCTL. Because the BUSCTL and BE port do not have a set-register (see MCF5208 Reference Manual Page 13-10, Table 13-3) the offset calculations went wrong. Because the BE and BUSCTL port do not seem useful in these parts, as they lack a set register, I removed them and adapted the gpio chip bases which are also used for the offset-calculations. Now both setting and resetting the chip selects works as expected from userland and from the kernelspace. Your changes in the patch below sure do look right given the documentation. Furthermore the base address of the spi controller was wrong in mcfqspi.h. Because I don't know the M532x series and it had a different base-adress in the same ifdef-branch I added an ifdef choice there. If sombody has access to an 532x device, please test it! Greg: Would you please check if this could be merged into mainline? Overall it looks right. Just a couple of minor nits to clean up: diff --git a/arch/m68k/include/asm/mcfqspi.h b/arch/m68k/include/asm/mcfqspi.h index 39d90d5..d983ea0 100644 --- a/arch/m68k/include/asm/mcfqspi.h +++ b/arch/m68k/include/asm/mcfqspi.h @@ -26,8 +26,12 @@ #elif defined(CONFIG_M5249) #define MCFQSPI_IOBASE (MCF_MBAR + 0x300) #elif defined(CONFIG_M520x) || defined(CONFIG_M532x) +#if defined(CONFIG_M520x) +#define MCFQSPI_IOBASE 0xFC05C000 +#elif defined(CONFIG_M532x) #define MCFQSPI_IOBASE 0xFC058000 #endif +#endif Lets simplify the logic here a little and do: #elif defined(CONFIG_M5249) #define MCFQSPI_IOBASE (MCF_MBAR + 0x300) #elif defined(CONFIG_M520x) #define MCFQSPI_IOBASE 0xFC05C000 #elif defined(CONFIG_M532x) #define MCFQSPI_IOBASE 0xFC058000 #endif diff --git a/arch/m68k/platform/520x/Makefile b/arch/m68k/platform/520x/Makefile index ad3f4e5..3b8c275 100644 --- a/arch/m68k/platform/520x/Makefile +++ b/arch/m68k/platform/520x/Makefile @@ -14,4 +14,4 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 -obj-y := config.o gpio.o +obj-y := config.o gpio.o spi-mcf520x.o There is no spi-mcf520x.c in this patch... Is there supposed to be? Can you regenerate your patch, and add a Signed-off-by? Regards Greg Greg Ungerer -- Principal EngineerEMAIL: g...@snapgear.com SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] PATCH: Problems with SPI/GPIO on 520x
Hi list, following the path I found yesterday I discovered the reason for the strange behavior of the chip select pins when toggled from the spi driver via the kernel gpio api. The problem has its root in the calculation of the set-port offsets (macro MCFGPIO_SETR() in arch/m68k/include/gpio.h), this assumes that all ports have the same offset from the base port address (MCFGPIO_SETR) which is defined in mcf520xsim.h as an alias of MCFGIO_PSETR_BUSCTL. Because the BUSCTL and BE port do not have a set-register (see MCF5208 Reference Manual Page 13-10, Table 13-3) the offset calculations went wrong. Because the BE and BUSCTL port do not seem useful in these parts, as they lack a set register, I removed them and adapted the gpio chip bases which are also used for the offset-calculations. Now both setting and resetting the chip selects works as expected from userland and from the kernelspace. Furthermore the base address of the spi controller was wrong in mcfqspi.h. Because I don't know the M532x series and it had a different base-adress in the same ifdef-branch I added an ifdef choice there. If sombody has access to an 532x device, please test it! Greg: Would you please check if this could be merged into mainline? Best regards, Peter linux-3.0.0+-5208_spi.patch Description: Binary data ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev