mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver
@ 2012-07-19 15:30 Alexander Shiyan
  2012-07-19 15:30 ` [PATCH 2/6] i.MX: Removed unused declaration for imx_iim_get_mac Alexander Shiyan
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Alexander Shiyan @ 2012-07-19 15:30 UTC (permalink / raw)
  To: barebox

This patch provide setup for SPI clk frequency global to driver.
For MC13783 maximum clock frequency is 20 MHz,
for MC13892 maximum clock frequency is 26 MHz,
so we define 20 MHz as a maximum SPI clk.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/boards/ccxmx51/ccxmx51.c          |    1 -
 arch/arm/boards/freescale-mx51-pdk/board.c |    1 -
 arch/arm/boards/pcm038/pcm038.c            |    1 -
 drivers/mfd/mc13xxx.c                      |    1 +
 4 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boards/ccxmx51/ccxmx51.c b/arch/arm/boards/ccxmx51/ccxmx51.c
index f494174..f309e0c 100644
--- a/arch/arm/boards/ccxmx51/ccxmx51.c
+++ b/arch/arm/boards/ccxmx51/ccxmx51.c
@@ -191,7 +191,6 @@ static struct spi_imx_master ecspi_0_data = {
 static const struct spi_board_info ccxmx51_spi_board_info[] = {
 	{
 		.name		= "mc13xxx-spi",
-		.max_speed_hz	= 6000000,
 		.bus_num	= 0,
 		.chip_select	= 0,
 	},
diff --git a/arch/arm/boards/freescale-mx51-pdk/board.c b/arch/arm/boards/freescale-mx51-pdk/board.c
index 3a568d0..7c2c8fe 100644
--- a/arch/arm/boards/freescale-mx51-pdk/board.c
+++ b/arch/arm/boards/freescale-mx51-pdk/board.c
@@ -117,7 +117,6 @@ static struct spi_imx_master spi_0_data = {
 static const struct spi_board_info mx51_babbage_spi_board_info[] = {
 	{
 		.name = "mc13xxx-spi",
-		.max_speed_hz = 300000,
 		.bus_num = 0,
 		.chip_select = 0,
 	},
diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index badc978..fa82b02 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -59,7 +59,6 @@ static struct spi_imx_master pcm038_spi_0_data = {
 static struct spi_board_info pcm038_spi_board_info[] = {
 	{
 		.name = "mc13xxx-spi",
-		.max_speed_hz = 3000000,
 		.bus_num = 0,
 		.chip_select = 0,
 	}
diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
index 2934e9d..8bb0d00 100644
--- a/drivers/mfd/mc13xxx.c
+++ b/drivers/mfd/mc13xxx.c
@@ -297,6 +297,7 @@ static int mc_probe(struct device_d *dev, enum mc13xxx_mode mode)
 		mc_dev->spi = dev->type_data;
 		mc_dev->spi->mode = SPI_MODE_0 | SPI_CS_HIGH;
 		mc_dev->spi->bits_per_word = 32;
+		mc_dev->spi->max_speed_hz = 20000000;
 	}
 	mc_dev->cdev.size = 256;
 	mc_dev->cdev.dev = dev;
-- 
1.7.3.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 2/6] i.MX: Removed unused declaration for imx_iim_get_mac
  2012-07-19 15:30 [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver Alexander Shiyan
@ 2012-07-19 15:30 ` Alexander Shiyan
  2012-07-19 15:30 ` [PATCH 3/6] mc13xxx: Added dummy definition for mc13xxx_get() if CONFIG_MFD_MC13XXX is not set Alexander Shiyan
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Alexander Shiyan @ 2012-07-19 15:30 UTC (permalink / raw)
  To: barebox

Procedure is missing, so remove its declaration.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/mach-imx/include/mach/iim.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-imx/include/mach/iim.h b/arch/arm/mach-imx/include/mach/iim.h
index b97c742..ef7b25d 100644
--- a/arch/arm/mach-imx/include/mach/iim.h
+++ b/arch/arm/mach-imx/include/mach/iim.h
@@ -48,7 +48,6 @@ struct imx_iim_platform_data {
 
 #ifdef CONFIG_IMX_IIM
 int imx_iim_read(unsigned int bank, int offset, void *buf, int count);
-int imx_iim_get_mac(unsigned char *mac);
 #else
 static inline int imx_iim_read(unsigned int bank, int offset, void *buf,
 		int count)
-- 
1.7.3.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 3/6] mc13xxx: Added dummy definition for mc13xxx_get() if CONFIG_MFD_MC13XXX is not set
  2012-07-19 15:30 [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver Alexander Shiyan
  2012-07-19 15:30 ` [PATCH 2/6] i.MX: Removed unused declaration for imx_iim_get_mac Alexander Shiyan
@ 2012-07-19 15:30 ` Alexander Shiyan
  2012-07-19 17:56   ` Sascha Hauer
  2012-07-19 15:30 ` [PATCH 4/6] tx51: Unused mc13xxx.h include removed Alexander Shiyan
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Alexander Shiyan @ 2012-07-19 15:30 UTC (permalink / raw)
  To: barebox


Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/boards/pcm038/pcm038.c |    2 --
 include/mfd/mc13xxx.h           |    4 ++++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index fa82b02..875081b 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -124,7 +124,6 @@ static inline uint32_t get_pll_spctl10(void)
  */
 static int pcm038_power_init(void)
 {
-#ifdef CONFIG_MFD_MC13XXX
 	uint32_t spctl0 = get_pll_spctl10();
 	struct mc13xxx *mc13xxx = mc13xxx_get();
 
@@ -158,7 +157,6 @@ static int pcm038_power_init(void)
 			printf("Failed to initialize PMIC. Will continue with low CPU speed\n");
 		}
 	}
-#endif
 
 	/* clock gating enable */
 	GPCR = 0x00050f08;
diff --git a/include/mfd/mc13xxx.h b/include/mfd/mc13xxx.h
index 2880307..51cfdd9 100644
--- a/include/mfd/mc13xxx.h
+++ b/include/mfd/mc13xxx.h
@@ -163,7 +163,11 @@ struct mc13xxx {
 	int			revision;
 };
 
+#ifdef CONFIG_MFD_MC13XXX
 extern struct mc13xxx *mc13xxx_get(void);
+#else
+#define mc13xxx_get()		(NULL)
+#endif
 
 extern int mc13xxx_reg_read(struct mc13xxx *mc13xxx, u8 reg, u32 *val);
 extern int mc13xxx_reg_write(struct mc13xxx *mc13xxx, u8 reg, u32 val);
-- 
1.7.3.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 4/6] tx51: Unused mc13xxx.h include removed
  2012-07-19 15:30 [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver Alexander Shiyan
  2012-07-19 15:30 ` [PATCH 2/6] i.MX: Removed unused declaration for imx_iim_get_mac Alexander Shiyan
  2012-07-19 15:30 ` [PATCH 3/6] mc13xxx: Added dummy definition for mc13xxx_get() if CONFIG_MFD_MC13XXX is not set Alexander Shiyan
@ 2012-07-19 15:30 ` Alexander Shiyan
  2012-07-19 15:30 ` [PATCH 5/6] PCM970: Add MMC support Alexander Shiyan
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Alexander Shiyan @ 2012-07-19 15:30 UTC (permalink / raw)
  To: barebox


Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/boards/karo-tx51/tx51.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boards/karo-tx51/tx51.c b/arch/arm/boards/karo-tx51/tx51.c
index 096683a..5adaaa6 100644
--- a/arch/arm/boards/karo-tx51/tx51.c
+++ b/arch/arm/boards/karo-tx51/tx51.c
@@ -32,7 +32,6 @@
 #include <fcntl.h>
 #include <nand.h>
 #include <spi/spi.h>
-#include <mfd/mc13xxx.h>
 #include <io.h>
 #include <asm/mmu.h>
 #include <mach/imx5.h>
-- 
1.7.3.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 5/6] PCM970: Add MMC support
  2012-07-19 15:30 [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver Alexander Shiyan
                   ` (2 preceding siblings ...)
  2012-07-19 15:30 ` [PATCH 4/6] tx51: Unused mc13xxx.h include removed Alexander Shiyan
@ 2012-07-19 15:30 ` Alexander Shiyan
  2012-07-19 15:30 ` [PATCH 6/6] PCM038: Read UID from fuses and pass this value to kernel as serial number Alexander Shiyan
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Alexander Shiyan @ 2012-07-19 15:30 UTC (permalink / raw)
  To: barebox

Here is a test output:

barebox 2012.07.0-00136-ge3ab4bc-dirty #23 Tue Jul 3 23:10:44 MSK 2012
Board: Phytec phyCORE-i.MX27
mc13xxx-spi@mc13xxx-spi0: Found MC13783 ID: 0x00009b [Rev: 3.1]
cfi_flash@cfi_flash0: found cfi flash at c0000000, size 33554432
NAND device: Manufacturer ID: 0x20, Chip ID: 0x36 (ST Micro NAND 64MiB 1,8V 8-bit)
Bad block table found at page 131040, version 0x01
Bad block table found at page 131008, version 0x01
imxfb@imxfb0: i.MX Framebuffer driver
cfi_protect: protect 0xc0080000 (size 1048576)
Using environment in NOR Flash
Found NXP ISP150x ULPI transceiver (0x04cc:0x1504).
ehci@ehci0: USB EHCI 1.00
imx-mmc@mci0: registered as mci0
Malloc space: 0xa6f00000 -> 0xa7efffff (size 16 MB)
Stack space : 0xa6ef8000 -> 0xa6f00000 (size 32 kB)
running /env/bin/init...

Hit m for menu or any other key to stop autoboot:  3

type exit to get to the menu
barebox@Phytec phyCORE-i.MX27:/ mci0.probe=1
mci@mci0: registered disk0
barebox@Phytec phyCORE-i.MX27:/ devinfo mci0
resources:
driver: mci

 Card:
 Attached is an SD Card (Version: 1.10)
 Capacity: 1962 MiB
  CID: 1C535653-44432020-1000013C-7E007200
  CSD: 005E0032-5F5A83D5-2DB7FFBF-96800000
 Max. transfer speed: 25000000 Hz
 Manufacturer ID: 1C
 OEM/Application ID: 5356
 Product name: 'SDC  '
 Product revision: 1.0
 Serial no: 81022
 Manufacturing date: 2.2007
 Parameters:
            probe = 1
barebox@Phytec phyCORE-i.MX27:/ mkdir /d
barebox@Phytec phyCORE-i.MX27:/ mount /dev/disk0.0 fat /d
barebox@Phytec phyCORE-i.MX27:/ ls /d
barebox.bin
barebox@Phytec phyCORE-i.MX27:/

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/boards/pcm038/pcm038.c |   16 ++++++++++++++++
 arch/arm/boards/pcm038/pcm970.c |   24 ++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index 875081b..5b0afc3 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -145,6 +145,22 @@ static int pcm038_power_init(void)
 				MC13783_SW1B_SOFTSTART |
 				MC13783_SW_PLL_FACTOR(32));
 
+			/* Setup VMMC voltage */
+			if (IS_ENABLED(CONFIG_MCI_IMX)) {
+				u32 val;
+
+				mc13xxx_reg_read(mc13xxx, MC13783_REG_REG_SETTING(1), &val);
+				/* VMMC1 = 3.00 V */
+				val &= ~(7 << 6);
+				val |= 6 << 6;
+				mc13xxx_reg_write(mc13xxx, MC13783_REG_REG_SETTING(1), val);
+
+				mc13xxx_reg_read(mc13xxx, MC13783_REG_REG_MODE(1), &val);
+				/* Enable VMMC1 */
+				val |= 1 << 18;
+				mc13xxx_reg_write(mc13xxx, MC13783_REG_REG_MODE(1), val);
+			}
+
 			/* wait for required power level to run the CPU at 400 MHz */
 			udelay(100000);
 			CSCR = CSCR_VAL_FINAL;
diff --git a/arch/arm/boards/pcm038/pcm970.c b/arch/arm/boards/pcm038/pcm970.c
index df9b852..b956482 100644
--- a/arch/arm/boards/pcm038/pcm970.c
+++ b/arch/arm/boards/pcm038/pcm970.c
@@ -23,6 +23,7 @@
 #include <mach/imx-regs.h>
 #include <mach/iomux-mx27.h>
 #include <mach/gpio.h>
+#include <mach/devices-imx27.h>
 #include <usb/ulpi.h>
 
 #define GPIO_IDE_POWER	(GPIO_PORTE + 18)
@@ -148,6 +149,26 @@ static void pcm970_ide_init(void)
 }
 #endif
 
+static void pcm970_mmc_init(void)
+{
+	uint32_t i;
+	unsigned int mode[] = {
+		/* SD2 */
+		PB4_PF_SD2_D0,
+		PB5_PF_SD2_D1,
+		PB6_PF_SD2_D2,
+		PB7_PF_SD2_D3,
+		PB8_PF_SD2_CMD,
+		PB9_PF_SD2_CLK,
+	};
+
+	for (i = 0; i < ARRAY_SIZE(mode); i++)
+		imx_gpio_mode(mode[i]);
+
+	PCCR0 |= PCCR0_SDHC2_EN;
+	imx27_add_mmc1(NULL);
+}
+
 static int pcm970_init(void)
 {
 	int i;
@@ -181,6 +202,9 @@ static int pcm970_init(void)
 	pcm970_ide_init();
 #endif
 
+	if (IS_ENABLED(CONFIG_MCI_IMX))
+		pcm970_mmc_init();
+
 	return 0;
 }
 
-- 
1.7.3.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 6/6] PCM038: Read UID from fuses and pass this value to kernel as serial number
  2012-07-19 15:30 [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver Alexander Shiyan
                   ` (3 preceding siblings ...)
  2012-07-19 15:30 ` [PATCH 5/6] PCM970: Add MMC support Alexander Shiyan
@ 2012-07-19 15:30 ` Alexander Shiyan
  2012-07-19 18:12   ` Sascha Hauer
  2012-07-19 17:55 ` [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver Sascha Hauer
  2012-07-20  7:46 ` Sascha Hauer
  6 siblings, 1 reply; 16+ messages in thread
From: Alexander Shiyan @ 2012-07-19 15:30 UTC (permalink / raw)
  To: barebox


Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/boards/pcm038/pcm038.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index 5b0afc3..1bdb93c 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -40,6 +40,7 @@
 #include <mach/spi.h>
 #include <mach/iomux-mx27.h>
 #include <mach/devices-imx27.h>
+#include <mach/iim.h>
 #include <mfd/mc13xxx.h>
 
 #include "pll.h"
@@ -193,6 +194,7 @@ mem_initcall(pcm038_mem_init);
 static int pcm038_devices_init(void)
 {
 	int i;
+	u64 uid;
 	char *envdev;
 
 	unsigned int mode[] = {
@@ -316,6 +318,8 @@ static int pcm038_devices_init(void)
 
 	printf("Using environment in %s Flash\n", envdev);
 
+	if (imx_iim_read(1, 1, &uid, 6) == 6)
+		armlinux_set_serial(uid);
 	armlinux_set_bootparams((void *)0xa0000100);
 	armlinux_set_architecture(MACH_TYPE_PCM038);
 
-- 
1.7.3.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver
  2012-07-19 15:30 [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver Alexander Shiyan
                   ` (4 preceding siblings ...)
  2012-07-19 15:30 ` [PATCH 6/6] PCM038: Read UID from fuses and pass this value to kernel as serial number Alexander Shiyan
@ 2012-07-19 17:55 ` Sascha Hauer
  2012-07-20  8:05   ` Re[2]: " Alexander Shiyan
  2012-07-20  7:46 ` Sascha Hauer
  6 siblings, 1 reply; 16+ messages in thread
From: Sascha Hauer @ 2012-07-19 17:55 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Thu, Jul 19, 2012 at 07:30:12PM +0400, Alexander Shiyan wrote:
> This patch provide setup for SPI clk frequency global to driver.
> For MC13783 maximum clock frequency is 20 MHz,
> for MC13892 maximum clock frequency is 26 MHz,
> so we define 20 MHz as a maximum SPI clk.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  arch/arm/boards/ccxmx51/ccxmx51.c          |    1 -
>  arch/arm/boards/freescale-mx51-pdk/board.c |    1 -
>  arch/arm/boards/pcm038/pcm038.c            |    1 -
>  drivers/mfd/mc13xxx.c                      |    1 +
>  4 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boards/ccxmx51/ccxmx51.c b/arch/arm/boards/ccxmx51/ccxmx51.c
> index f494174..f309e0c 100644
> --- a/arch/arm/boards/ccxmx51/ccxmx51.c
> +++ b/arch/arm/boards/ccxmx51/ccxmx51.c
> @@ -191,7 +191,6 @@ static struct spi_imx_master ecspi_0_data = {
>  static const struct spi_board_info ccxmx51_spi_board_info[] = {
>  	{
>  		.name		= "mc13xxx-spi",
> -		.max_speed_hz	= 6000000,
>  		.bus_num	= 0,
>  		.chip_select	= 0,
>  	},
> diff --git a/arch/arm/boards/freescale-mx51-pdk/board.c b/arch/arm/boards/freescale-mx51-pdk/board.c
> index 3a568d0..7c2c8fe 100644
> --- a/arch/arm/boards/freescale-mx51-pdk/board.c
> +++ b/arch/arm/boards/freescale-mx51-pdk/board.c
> @@ -117,7 +117,6 @@ static struct spi_imx_master spi_0_data = {
>  static const struct spi_board_info mx51_babbage_spi_board_info[] = {
>  	{
>  		.name = "mc13xxx-spi",
> -		.max_speed_hz = 300000,
>  		.bus_num = 0,
>  		.chip_select = 0,
>  	},
> diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
> index badc978..fa82b02 100644
> --- a/arch/arm/boards/pcm038/pcm038.c
> +++ b/arch/arm/boards/pcm038/pcm038.c
> @@ -59,7 +59,6 @@ static struct spi_imx_master pcm038_spi_0_data = {
>  static struct spi_board_info pcm038_spi_board_info[] = {
>  	{
>  		.name = "mc13xxx-spi",
> -		.max_speed_hz = 3000000,
>  		.bus_num = 0,
>  		.chip_select = 0,
>  	}
> diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
> index 2934e9d..8bb0d00 100644
> --- a/drivers/mfd/mc13xxx.c
> +++ b/drivers/mfd/mc13xxx.c
> @@ -297,6 +297,7 @@ static int mc_probe(struct device_d *dev, enum mc13xxx_mode mode)
>  		mc_dev->spi = dev->type_data;
>  		mc_dev->spi->mode = SPI_MODE_0 | SPI_CS_HIGH;
>  		mc_dev->spi->bits_per_word = 32;
> +		mc_dev->spi->max_speed_hz = 20000000;

The values indeed look quite arbitrary, but it may be that a hardware
design does not support such high frequencies. Maybe better

		if (!mc_dev->spi->max_speed_hz)
			mc_dev->spi->max_speed_hz = 20000000

?

Sascha

-- 
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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/6] mc13xxx: Added dummy definition for mc13xxx_get() if CONFIG_MFD_MC13XXX is not set
  2012-07-19 15:30 ` [PATCH 3/6] mc13xxx: Added dummy definition for mc13xxx_get() if CONFIG_MFD_MC13XXX is not set Alexander Shiyan
@ 2012-07-19 17:56   ` Sascha Hauer
  2012-07-20  8:08     ` Re[2]: " Alexander Shiyan
  0 siblings, 1 reply; 16+ messages in thread
From: Sascha Hauer @ 2012-07-19 17:56 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Thu, Jul 19, 2012 at 07:30:14PM +0400, Alexander Shiyan wrote:
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  arch/arm/boards/pcm038/pcm038.c |    2 --
>  include/mfd/mc13xxx.h           |    4 ++++
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
> index fa82b02..875081b 100644
> --- a/arch/arm/boards/pcm038/pcm038.c
> +++ b/arch/arm/boards/pcm038/pcm038.c
> @@ -124,7 +124,6 @@ static inline uint32_t get_pll_spctl10(void)
>   */
>  static int pcm038_power_init(void)
>  {
> -#ifdef CONFIG_MFD_MC13XXX
>  	uint32_t spctl0 = get_pll_spctl10();
>  	struct mc13xxx *mc13xxx = mc13xxx_get();
>  
> @@ -158,7 +157,6 @@ static int pcm038_power_init(void)
>  			printf("Failed to initialize PMIC. Will continue with low CPU speed\n");
>  		}
>  	}
> -#endif
>  
>  	/* clock gating enable */
>  	GPCR = 0x00050f08;
> diff --git a/include/mfd/mc13xxx.h b/include/mfd/mc13xxx.h
> index 2880307..51cfdd9 100644
> --- a/include/mfd/mc13xxx.h
> +++ b/include/mfd/mc13xxx.h
> @@ -163,7 +163,11 @@ struct mc13xxx {
>  	int			revision;
>  };
>  
> +#ifdef CONFIG_MFD_MC13XXX
>  extern struct mc13xxx *mc13xxx_get(void);
> +#else
> +#define mc13xxx_get()		(NULL)

Better a static inline function.

Sascha


-- 
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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 6/6] PCM038: Read UID from fuses and pass this value to kernel as serial number
  2012-07-19 15:30 ` [PATCH 6/6] PCM038: Read UID from fuses and pass this value to kernel as serial number Alexander Shiyan
@ 2012-07-19 18:12   ` Sascha Hauer
  2012-07-19 18:48     ` Re[2]: " Alexander Shiyan
  2012-07-19 18:49     ` Alexander Shiyan
  0 siblings, 2 replies; 16+ messages in thread
From: Sascha Hauer @ 2012-07-19 18:12 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Thu, Jul 19, 2012 at 07:30:17PM +0400, Alexander Shiyan wrote:
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  arch/arm/boards/pcm038/pcm038.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
> index 5b0afc3..1bdb93c 100644
> --- a/arch/arm/boards/pcm038/pcm038.c
> +++ b/arch/arm/boards/pcm038/pcm038.c
> @@ -40,6 +40,7 @@
>  #include <mach/spi.h>
>  #include <mach/iomux-mx27.h>
>  #include <mach/devices-imx27.h>
> +#include <mach/iim.h>
>  #include <mfd/mc13xxx.h>
>  
>  #include "pll.h"
> @@ -193,6 +194,7 @@ mem_initcall(pcm038_mem_init);
>  static int pcm038_devices_init(void)
>  {
>  	int i;
> +	u64 uid;

The upper two bytes of uid are used unitialized.

>  	char *envdev;
>  
>  	unsigned int mode[] = {
> @@ -316,6 +318,8 @@ static int pcm038_devices_init(void)
>  
>  	printf("Using environment in %s Flash\n", envdev);
>  
> +	if (imx_iim_read(1, 1, &uid, 6) == 6)
> +		armlinux_set_serial(uid);

With this patch I just realized that my serial becomes:

-6345008925011607552

Having negative numbers here is a bit odd. Looking at it export_env_ull
does:

        char *valstr = asprintf("%lld", val);

Which clearly is a signed number. Maybe this should be changed to "0x%016llx"
(which of course is not your fault)

Sascha


-- 
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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re[2]: [PATCH 6/6] PCM038: Read UID from fuses and pass this value to kernel as serial number
  2012-07-19 18:12   ` Sascha Hauer
@ 2012-07-19 18:48     ` Alexander Shiyan
  2012-07-19 18:49     ` Alexander Shiyan
  1 sibling, 0 replies; 16+ messages in thread
From: Alexander Shiyan @ 2012-07-19 18:48 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hello.

Thu, 19 Jul 2012 20:12:52 +0200 от Sascha Hauer <s.hauer@pengutronix.de>:
> On Thu, Jul 19, 2012 at 07:30:17PM +0400, Alexander Shiyan wrote:
> > 
> > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> > ---
> >  arch/arm/boards/pcm038/pcm038.c |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
> > index 5b0afc3..1bdb93c 100644
> > --- a/arch/arm/boards/pcm038/pcm038.c
> > +++ b/arch/arm/boards/pcm038/pcm038.c
> > @@ -40,6 +40,7 @@
> >  #include <mach/spi.h>
> >  #include <mach/iomux-mx27.h>
> >  #include <mach/devices-imx27.h>
> > +#include <mach/iim.h>
> >  #include <mfd/mc13xxx.h>
> >  
> >  #include "pll.h"
> > @@ -193,6 +194,7 @@ mem_initcall(pcm038_mem_init);
> >  static int pcm038_devices_init(void)
> >  {
> >  	int i;
> > +	u64 uid;
> 
> The upper two bytes of uid are used unitialized.
You are right. I'll send updated version for this one patch.

> >  	char *envdev;
> >  
> >  	unsigned int mode[] = {
> > @@ -316,6 +318,8 @@ static int pcm038_devices_init(void)
> >  
> >  	printf("Using environment in %s Flash\n", envdev);
> >  
> > +	if (imx_iim_read(1, 1, &uid, 6) == 6)
> > +		armlinux_set_serial(uid);
> 
> With this patch I just realized that my serial becomes:
> 
> -6345008925011607552
> 
> Having negative numbers here is a bit odd. Looking at it export_env_ull
> does:
> 
>         char *valstr = asprintf("%lld", val);
> 
> Which clearly is a signed number. Maybe this should be changed to "0x%016llx"
> (which of course is not your fault)
I think this will solve the problem. But it's certainly a job for another patch.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 6/6] PCM038: Read UID from fuses and pass this value to kernel as serial number
  2012-07-19 18:12   ` Sascha Hauer
  2012-07-19 18:48     ` Re[2]: " Alexander Shiyan
@ 2012-07-19 18:49     ` Alexander Shiyan
  1 sibling, 0 replies; 16+ messages in thread
From: Alexander Shiyan @ 2012-07-19 18:49 UTC (permalink / raw)
  To: barebox


Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/boards/pcm038/pcm038.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index 5b0afc3..1bdb93c 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -40,6 +40,7 @@
 #include <mach/spi.h>
 #include <mach/iomux-mx27.h>
 #include <mach/devices-imx27.h>
+#include <mach/iim.h>
 #include <mfd/mc13xxx.h>
 
 #include "pll.h"
@@ -193,6 +194,7 @@ mem_initcall(pcm038_mem_init);
 static int pcm038_devices_init(void)
 {
 	int i;
+	u64 uid = 0;
 	char *envdev;
 
 	unsigned int mode[] = {
@@ -316,6 +318,8 @@ static int pcm038_devices_init(void)
 
 	printf("Using environment in %s Flash\n", envdev);
 
+	if (imx_iim_read(1, 1, &uid, 6) == 6)
+		armlinux_set_serial(uid);
 	armlinux_set_bootparams((void *)0xa0000100);
 	armlinux_set_architecture(MACH_TYPE_PCM038);
 
-- 
1.7.3.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver
  2012-07-19 15:30 [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver Alexander Shiyan
                   ` (5 preceding siblings ...)
  2012-07-19 17:55 ` [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver Sascha Hauer
@ 2012-07-20  7:46 ` Sascha Hauer
  6 siblings, 0 replies; 16+ messages in thread
From: Sascha Hauer @ 2012-07-20  7:46 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

Hi Alexander,

Applied these except 1/6 and 3/6 which have open comments.

Sascha

On Thu, Jul 19, 2012 at 07:30:12PM +0400, Alexander Shiyan wrote:
> This patch provide setup for SPI clk frequency global to driver.
> For MC13783 maximum clock frequency is 20 MHz,
> for MC13892 maximum clock frequency is 26 MHz,
> so we define 20 MHz as a maximum SPI clk.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  arch/arm/boards/ccxmx51/ccxmx51.c          |    1 -
>  arch/arm/boards/freescale-mx51-pdk/board.c |    1 -
>  arch/arm/boards/pcm038/pcm038.c            |    1 -
>  drivers/mfd/mc13xxx.c                      |    1 +
>  4 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boards/ccxmx51/ccxmx51.c b/arch/arm/boards/ccxmx51/ccxmx51.c
> index f494174..f309e0c 100644
> --- a/arch/arm/boards/ccxmx51/ccxmx51.c
> +++ b/arch/arm/boards/ccxmx51/ccxmx51.c
> @@ -191,7 +191,6 @@ static struct spi_imx_master ecspi_0_data = {
>  static const struct spi_board_info ccxmx51_spi_board_info[] = {
>  	{
>  		.name		= "mc13xxx-spi",
> -		.max_speed_hz	= 6000000,
>  		.bus_num	= 0,
>  		.chip_select	= 0,
>  	},
> diff --git a/arch/arm/boards/freescale-mx51-pdk/board.c b/arch/arm/boards/freescale-mx51-pdk/board.c
> index 3a568d0..7c2c8fe 100644
> --- a/arch/arm/boards/freescale-mx51-pdk/board.c
> +++ b/arch/arm/boards/freescale-mx51-pdk/board.c
> @@ -117,7 +117,6 @@ static struct spi_imx_master spi_0_data = {
>  static const struct spi_board_info mx51_babbage_spi_board_info[] = {
>  	{
>  		.name = "mc13xxx-spi",
> -		.max_speed_hz = 300000,
>  		.bus_num = 0,
>  		.chip_select = 0,
>  	},
> diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
> index badc978..fa82b02 100644
> --- a/arch/arm/boards/pcm038/pcm038.c
> +++ b/arch/arm/boards/pcm038/pcm038.c
> @@ -59,7 +59,6 @@ static struct spi_imx_master pcm038_spi_0_data = {
>  static struct spi_board_info pcm038_spi_board_info[] = {
>  	{
>  		.name = "mc13xxx-spi",
> -		.max_speed_hz = 3000000,
>  		.bus_num = 0,
>  		.chip_select = 0,
>  	}
> diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
> index 2934e9d..8bb0d00 100644
> --- a/drivers/mfd/mc13xxx.c
> +++ b/drivers/mfd/mc13xxx.c
> @@ -297,6 +297,7 @@ static int mc_probe(struct device_d *dev, enum mc13xxx_mode mode)
>  		mc_dev->spi = dev->type_data;
>  		mc_dev->spi->mode = SPI_MODE_0 | SPI_CS_HIGH;
>  		mc_dev->spi->bits_per_word = 32;
> +		mc_dev->spi->max_speed_hz = 20000000;
>  	}
>  	mc_dev->cdev.size = 256;
>  	mc_dev->cdev.dev = dev;
> -- 
> 1.7.3.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re[2]: [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver
  2012-07-19 17:55 ` [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver Sascha Hauer
@ 2012-07-20  8:05   ` Alexander Shiyan
  2012-07-20  8:11     ` Sascha Hauer
  0 siblings, 1 reply; 16+ messages in thread
From: Alexander Shiyan @ 2012-07-20  8:05 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hello.

Thu, 19 Jul 2012 19:55:12 +0200 от Sascha Hauer <s.hauer@pengutronix.de>:
> On Thu, Jul 19, 2012 at 07:30:12PM +0400, Alexander Shiyan wrote:
>  > This patch provide setup for SPI clk frequency global to driver.
>  > For MC13783 maximum clock frequency is 20 MHz,
>  > for MC13892 maximum clock frequency is 26 MHz,
>  > so we define 20 MHz as a maximum SPI clk.
>  > 
>  > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
>  > ---
>  > arch/arm/boards/ccxmx51/ccxmx51.c | 1 -
>  > arch/arm/boards/freescale-mx51-pdk/board.c | 1 -
>  > arch/arm/boards/pcm038/pcm038.c | 1 -
>  > drivers/mfd/mc13xxx.c | 1 +
>  > 4 files changed, 1 insertions(+), 3 deletions(-)
>  > 
>  > diff --git a/arch/arm/boards/ccxmx51/ccxmx51.c b/arch/arm/boards/ccxmx51/ccxmx51.c
>  > index f494174..f309e0c 100644
>  > --- a/arch/arm/boards/ccxmx51/ccxmx51.c
>  > +++ b/arch/arm/boards/ccxmx51/ccxmx51.c
>  > @@ -191,7 +191,6 @@ static struct spi_imx_master ecspi_0_data = {
>  > static const struct spi_board_info ccxmx51_spi_board_info[] = {
>  > {
>  > .name = "mc13xxx-spi",
>  > - .max_speed_hz = 6000000,
>  > .bus_num = 0,
>  > .chip_select = 0,
>  > },
>  > diff --git a/arch/arm/boards/freescale-mx51-pdk/board.c b/arch/arm/boards/freescale-mx51-pdk/board.c
>  > index 3a568d0..7c2c8fe 100644
>  > --- a/arch/arm/boards/freescale-mx51-pdk/board.c
>  > +++ b/arch/arm/boards/freescale-mx51-pdk/board.c
>  > @@ -117,7 +117,6 @@ static struct spi_imx_master spi_0_data = {
>  > static const struct spi_board_info mx51_babbage_spi_board_info[] = {
>  > {
>  > .name = "mc13xxx-spi",
>  > - .max_speed_hz = 300000,
>  > .bus_num = 0,
>  > .chip_select = 0,
>  > },
>  > diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
>  > index badc978..fa82b02 100644
>  > --- a/arch/arm/boards/pcm038/pcm038.c
>  > +++ b/arch/arm/boards/pcm038/pcm038.c
>  > @@ -59,7 +59,6 @@ static struct spi_imx_master pcm038_spi_0_data = {
>  > static struct spi_board_info pcm038_spi_board_info[] = {
>  > {
>  > .name = "mc13xxx-spi",
>  > - .max_speed_hz = 3000000,
>  > .bus_num = 0,
>  > .chip_select = 0,
>  > }
>  > diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
>  > index 2934e9d..8bb0d00 100644
>  > --- a/drivers/mfd/mc13xxx.c
>  > +++ b/drivers/mfd/mc13xxx.c
>  > @@ -297,6 +297,7 @@ static int mc_probe(struct device_d *dev, enum mc13xxx_mode mode)
>  > mc_dev->spi = dev->type_data;
>  > mc_dev->spi->mode = SPI_MODE_0 | SPI_CS_HIGH;
>  > mc_dev->spi->bits_per_word = 32;
>  > + mc_dev->spi->max_speed_hz = 20000000;
> 
>  The values indeed look quite arbitrary, but it may be that a hardware
>  design does not support such high frequencies. Maybe better
> 
>  if (!mc_dev->spi->max_speed_hz)
>  mc_dev->spi->max_speed_hz = 20000000
> 
>  ?
On my opinion, tests for supported speed, is work for SPI-driver, not for device driver.
Is not it?
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re[2]: [PATCH 3/6] mc13xxx: Added dummy definition for mc13xxx_get() if CONFIG_MFD_MC13XXX is not set
  2012-07-19 17:56   ` Sascha Hauer
@ 2012-07-20  8:08     ` Alexander Shiyan
  0 siblings, 0 replies; 16+ messages in thread
From: Alexander Shiyan @ 2012-07-20  8:08 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hello.

Thu, 19 Jul 2012 19:56:06 +0200 от Sascha Hauer <s.hauer@pengutronix.de>:
> On Thu, Jul 19, 2012 at 07:30:14PM +0400, Alexander Shiyan wrote:
>  > 
>  > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
>  > ---
>  > arch/arm/boards/pcm038/pcm038.c | 2 --
>  > include/mfd/mc13xxx.h | 4 ++++
>  > 2 files changed, 4 insertions(+), 2 deletions(-)
>  > 
>  > diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
>  > index fa82b02..875081b 100644
>  > --- a/arch/arm/boards/pcm038/pcm038.c
>  > +++ b/arch/arm/boards/pcm038/pcm038.c
>  > @@ -124,7 +124,6 @@ static inline uint32_t get_pll_spctl10(void)
>  > */ 
>  > static int pcm038_power_init(void)
>  > {
>  > -#ifdef CONFIG_MFD_MC13XXX
>  > uint32_t spctl0 = get_pll_spctl10();
>  > struct mc13xxx *mc13xxx = mc13xxx_get();
>  > 
>  > @@ -158,7 +157,6 @@ static int pcm038_power_init(void)
>  > printf("Failed to initialize PMIC. Will continue with low CPU speed\n");
>  > }
>  > }
>  > -#endif
>  > 
>  > /* clock gating enable */ 
>  > GPCR = 0x00050f08;
>  > diff --git a/include/mfd/mc13xxx.h b/include/mfd/mc13xxx.h
>  > index 2880307..51cfdd9 100644
>  > --- a/include/mfd/mc13xxx.h
>  > +++ b/include/mfd/mc13xxx.h
>  > @@ -163,7 +163,11 @@ struct mc13xxx {
>  > int revision;
>  > };
>  > 
>  > +#ifdef CONFIG_MFD_MC13XXX
>  > extern struct mc13xxx *mc13xxx_get(void);
>  > +#else
>  > +#define mc13xxx_get() (NULL)
> 
>  Better a static inline function.

OK, modified version of patch will be sent in new thread.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver
  2012-07-20  8:05   ` Re[2]: " Alexander Shiyan
@ 2012-07-20  8:11     ` Sascha Hauer
  2012-07-20  8:17       ` Re[2]: " Alexander Shiyan
  0 siblings, 1 reply; 16+ messages in thread
From: Sascha Hauer @ 2012-07-20  8:11 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Fri, Jul 20, 2012 at 12:05:21PM +0400, Alexander Shiyan wrote:
> > 
> >  The values indeed look quite arbitrary, but it may be that a hardware
> >  design does not support such high frequencies. Maybe better
> > 
> >  if (!mc_dev->spi->max_speed_hz)
> >  mc_dev->spi->max_speed_hz = 20000000
> > 
> >  ?
> On my opinion, tests for supported speed, is work for SPI-driver, not for device driver.
> Is not it?

So you mean that the i.MX spi drivers platform data should have a
maximum speed field instead of the client drivers? Sounds good.
In this case we can apply the patch.

Sascha

-- 
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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re[2]: [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver
  2012-07-20  8:11     ` Sascha Hauer
@ 2012-07-20  8:17       ` Alexander Shiyan
  0 siblings, 0 replies; 16+ messages in thread
From: Alexander Shiyan @ 2012-07-20  8:17 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hello.

Fri, 20 Jul 2012 10:11:36 +0200 от Sascha Hauer <s.hauer@pengutronix.de>:
> On Fri, Jul 20, 2012 at 12:05:21PM +0400, Alexander Shiyan wrote:
>  > > 
>  > > The values indeed look quite arbitrary, but it may be that a hardware
>  > > design does not support such high frequencies. Maybe better
>  > > 
>  > > if (!mc_dev->spi->max_speed_hz)
>  > > mc_dev->spi->max_speed_hz = 20000000
>  > > 
>  > > ?
>  > On my opinion, tests for supported speed, is work for SPI-driver, not for device driver.
>  > Is not it?
> 
>  So you mean that the i.MX spi drivers platform data should have a
>  maximum speed field instead of the client drivers? Sounds good.
>  In this case we can apply the patch.

No additional fields required. We are pass max_speed_hz option in the SPI-driver
to clock divider, so frequency cannot be higher than possible. Fixme.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-07-20  8:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-19 15:30 [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver Alexander Shiyan
2012-07-19 15:30 ` [PATCH 2/6] i.MX: Removed unused declaration for imx_iim_get_mac Alexander Shiyan
2012-07-19 15:30 ` [PATCH 3/6] mc13xxx: Added dummy definition for mc13xxx_get() if CONFIG_MFD_MC13XXX is not set Alexander Shiyan
2012-07-19 17:56   ` Sascha Hauer
2012-07-20  8:08     ` Re[2]: " Alexander Shiyan
2012-07-19 15:30 ` [PATCH 4/6] tx51: Unused mc13xxx.h include removed Alexander Shiyan
2012-07-19 15:30 ` [PATCH 5/6] PCM970: Add MMC support Alexander Shiyan
2012-07-19 15:30 ` [PATCH 6/6] PCM038: Read UID from fuses and pass this value to kernel as serial number Alexander Shiyan
2012-07-19 18:12   ` Sascha Hauer
2012-07-19 18:48     ` Re[2]: " Alexander Shiyan
2012-07-19 18:49     ` Alexander Shiyan
2012-07-19 17:55 ` [PATCH 1/6] mc13xxx: Define maximum SPI clock frequency global to driver Sascha Hauer
2012-07-20  8:05   ` Re[2]: " Alexander Shiyan
2012-07-20  8:11     ` Sascha Hauer
2012-07-20  8:17       ` Re[2]: " Alexander Shiyan
2012-07-20  7:46 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox