Re: phy-addr via dt

2014-11-03 Thread Wjatscheslaw Stoljarski (Slawa)
Hi Sascha,

It works! Thanks!

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


phy-addr via dt

2014-11-03 Thread Wjatscheslaw Stoljarski (Slawa)
Hi,

Is it possible to set default phy-addr for fec_imx driver via device tree or in 
barebox environment?

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


[PATCH] commands: usb: drop help for force rescan option

2014-09-29 Thread Wjatscheslaw Stoljarski (Slawa)
From: "Wjatscheslaw Stoljarski" 

Signed-off-by: Wjatscheslaw Stoljarski 
---
 commands/usb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/commands/usb.c b/commands/usb.c
index a37d503..48c6619 100644
--- a/commands/usb.c
+++ b/commands/usb.c
@@ -138,7 +138,6 @@ BAREBOX_CMD_HELP_START(usb)
 BAREBOX_CMD_HELP_TEXT("Scan for USB devices.")
 BAREBOX_CMD_HELP_TEXT("")
 BAREBOX_CMD_HELP_TEXT("Options:")
-BAREBOX_CMD_HELP_OPT("-f", "force rescan")
 BAREBOX_CMD_HELP_OPT("-s", "show devices")
 BAREBOX_CMD_HELP_OPT("-t", "show USB tree")
 BAREBOX_CMD_HELP_END
@@ -146,7 +145,7 @@ BAREBOX_CMD_HELP_END
 BAREBOX_CMD_START(usb)
.cmd= do_usb,
BAREBOX_CMD_DESC("(re-)detect USB devices")
-   BAREBOX_CMD_OPTS("[-fts]")
+   BAREBOX_CMD_OPTS("[-ts]")
BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
BAREBOX_CMD_HELP(cmd_usb_help)
BAREBOX_CMD_COMPLETE(empty_complete)
-- 
1.9.1


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


boot command is broken?

2014-05-05 Thread Wjatscheslaw Stoljarski (Slawa)
Hi,

after update to v2014.05.0 'boot -l' displays only one entry, although
in /env/boot/ exists more files. Can anyone confirm this?

Best regards,
Wjatscheslaw Stoljarski

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


[PATCH 3/3] imx53: add imx53_add_cspi

2014-04-04 Thread Wjatscheslaw Stoljarski (Slawa)
From: "Wjatscheslaw Stoljarski" 


Signed-off-by: Wjatscheslaw Stoljarski 
---
 arch/arm/mach-imx/include/mach/devices-imx53.h |5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-imx/include/mach/devices-imx53.h 
b/arch/arm/mach-imx/include/mach/devices-imx53.h
index d4e9a4a..88be4fd 100644
--- a/arch/arm/mach-imx/include/mach/devices-imx53.h
+++ b/arch/arm/mach-imx/include/mach/devices-imx53.h
@@ -2,6 +2,11 @@
 #include 
 #include 
 
+static inline struct device_d *imx53_add_cspi(struct spi_imx_master *pdata)
+{
+   return imx_add_spi_imx35((void *)MX53_CSPI_BASE_ADDR, 0, pdata);
+}
+
 static inline struct device_d *imx53_add_spi0(struct spi_imx_master *pdata)
 {
return imx_add_spi_imx51((void *)MX53_ECSPI1_BASE_ADDR, 0, pdata);
-- 
1.7.9.5


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


[PATCH 1/3] imx-spi: enable v0.7 spi driver for imx53-cspi

2014-04-04 Thread Wjatscheslaw Stoljarski (Slawa)
From: "Wjatscheslaw Stoljarski" 


Signed-off-by: Wjatscheslaw Stoljarski 
---
 drivers/spi/Kconfig |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 422693c..e429ea1 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -25,7 +25,7 @@ config DRIVER_SPI_IMX_0_0
 
 config DRIVER_SPI_IMX_0_7
bool
-   depends on ARCH_IMX25 || ARCH_IMX35
+   depends on ARCH_IMX25 || ARCH_IMX35 || ARCH_IMX53
default y
 
 config DRIVER_SPI_IMX_2_3
-- 
1.7.9.5


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


Re: barebox on i.MX53 in serial downloader boot mode

2013-11-05 Thread Wjatscheslaw Stoljarski (Slawa)

Hi Sascha,

On 11/05/2013 08:44 AM, Sascha Hauer wrote:

Hi Wjatscheslaw,

On Mon, Nov 04, 2013 at 12:56:57PM +0100, Wjatscheslaw Stoljarski (Slawa) wrote:

Hi,

has anyone tried to start barebox on i.MX53 in 11 boot mode (serial
downloader)? I've tried on Freescale Loco board with pmic da9053,
but without success. In 00 boot mode (internal boot) works
perfectly. U-Boot works in both modes. DCD in u-boot and in barebox
is the same. Even I can turn on LEDs with DCD in 11 boot mode on
Loco.

The imx-usb-loader tool generally works here.

Yes, I can with the imx-usb-loader boot a u-boot image, but not barebox.

I don't have a DA9053
based Loco here. It may be that there is some bug in the code preventing
this board to run.
May be. But I have the exact same result with a custom board that uses 
the MC34709VK PMIC.

I just did a quick:

git checkout master
make imx_v7_defconfig
cat images/barebox-freescale-imx53-loco.img > /dev/sde

The resulting SD card works here.

Could you try booting from SD card? Does that work?
In 00 boot mode it boots fine from SD and from USB. I just checked 
again. I have trouble with the 11 boot mode.


Wjatscheslaw

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


Re: barebox on i.MX53 in serial downloader boot mode

2013-11-04 Thread Wjatscheslaw Stoljarski (Slawa)

On 11/04/2013 05:06 PM, Eric Bénard wrote:

Le Mon, 04 Nov 2013 17:04:46 +0100,
"Wjatscheslaw Stoljarski (Slawa)"
 a écrit :


On 11/04/2013 04:07 PM, Eric Bénard wrote:

Hi Wjatscheslaw,

Le Mon, 04 Nov 2013 16:00:49 +0100,
"Wjatscheslaw Stoljarski (Slawa)"
 a écrit :


On 11/04/2013 01:48 PM, Eric Bénard wrote:

Hi,

has anyone tried to start barebox on i.MX53 in 11 boot mode (serial
downloader)? I've tried on Freescale Loco board with pmic da9053, but
without success. In 00 boot mode (internal boot) works perfectly. U-Boot
works in both modes. DCD in u-boot and in barebox is the same. Even I
can turn on LEDs with DCD in 11 boot mode on Loco.


works fine here, what are you using to download barebox ?

I'm using imx-usb-loader. But I've tried MfgTool from Freescale too with
the same result.


ok sorry it's working here (on a custom board) in 11 boot mode but using
serial port to load it. IIRC USB was only tested in 00 as a fallback
when NAND flash is blank.

Eric

Sorry, I forget to mention that I'm using serial downloader via USB.

Hm... I've just tried to boot u-boot image in 11 mode, and from u-boot
start barebox. And it's works. Why then can I not boot barebox directly?


maybe a clock which is left unitialized (or an IOMUX).

Eric

I've already tried to turn on all clocks

mww 32 0x53FD4068 0x
mww 32 0x53FD406c 0x
mww 32 0x53FD4070 0x
mww 32 0x53FD4074 0x
mww 32 0x53FD4078 0x
mww 32 0x53FD407c 0x
mww 32 0x53FD4080 0x
mww 32 0x53FD4084 0x

but without success.

Wjatscheslaw

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


Re: barebox on i.MX53 in serial downloader boot mode

2013-11-04 Thread Wjatscheslaw Stoljarski (Slawa)

On 11/04/2013 04:07 PM, Eric Bénard wrote:

Hi Wjatscheslaw,

Le Mon, 04 Nov 2013 16:00:49 +0100,
"Wjatscheslaw Stoljarski (Slawa)"
 a écrit :


On 11/04/2013 01:48 PM, Eric Bénard wrote:

Hi,

has anyone tried to start barebox on i.MX53 in 11 boot mode (serial
downloader)? I've tried on Freescale Loco board with pmic da9053, but
without success. In 00 boot mode (internal boot) works perfectly. U-Boot
works in both modes. DCD in u-boot and in barebox is the same. Even I
can turn on LEDs with DCD in 11 boot mode on Loco.


works fine here, what are you using to download barebox ?

I'm using imx-usb-loader. But I've tried MfgTool from Freescale too with
the same result.


ok sorry it's working here (on a custom board) in 11 boot mode but using
serial port to load it. IIRC USB was only tested in 00 as a fallback
when NAND flash is blank.

Eric

Sorry, I forget to mention that I'm using serial downloader via USB.

Hm... I've just tried to boot u-boot image in 11 mode, and from u-boot 
start barebox. And it's works. Why then can I not boot barebox directly?


Wjatscheslaw

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


Re: barebox on i.MX53 in serial downloader boot mode

2013-11-04 Thread Wjatscheslaw Stoljarski (Slawa)

On 11/04/2013 01:48 PM, Eric Bénard wrote:

Hi,

has anyone tried to start barebox on i.MX53 in 11 boot mode (serial
downloader)? I've tried on Freescale Loco board with pmic da9053, but
without success. In 00 boot mode (internal boot) works perfectly. U-Boot
works in both modes. DCD in u-boot and in barebox is the same. Even I
can turn on LEDs with DCD in 11 boot mode on Loco.


works fine here, what are you using to download barebox ?
I'm using imx-usb-loader. But I've tried MfgTool from Freescale too with 
the same result.


Wjatscheslaw

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


barebox on i.MX53 in serial downloader boot mode

2013-11-04 Thread Wjatscheslaw Stoljarski (Slawa)

Hi,

has anyone tried to start barebox on i.MX53 in 11 boot mode (serial 
downloader)? I've tried on Freescale Loco board with pmic da9053, but 
without success. In 00 boot mode (internal boot) works perfectly. U-Boot 
works in both modes. DCD in u-boot and in barebox is the same. Even I 
can turn on LEDs with DCD in 11 boot mode on Loco.


Regards,
Wjatscheslaw Stoljarski

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


[PATCH] MFD MC34708: Add dependence on SPI

2012-12-20 Thread Wjatscheslaw Stoljarski (Slawa)
From: "Wjatscheslaw Stoljarski (Slawa)" 

MC34708 depend on I2C or SPI, so let driver depend on SPI too
and rename config option name to MFD_MC34708.

Signed-off-by: Wjatscheslaw Stoljarski 
---
 arch/arm/configs/freescale_mx53_loco_defconfig |2 +-
 drivers/mfd/Kconfig|4 ++--
 drivers/mfd/Makefile   |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/configs/freescale_mx53_loco_defconfig 
b/arch/arm/configs/freescale_mx53_loco_defconfig
index b61f0cf..fb6fcf8 100644
--- a/arch/arm/configs/freescale_mx53_loco_defconfig
+++ b/arch/arm/configs/freescale_mx53_loco_defconfig
@@ -79,7 +79,7 @@ CONFIG_USB_STORAGE=y
 CONFIG_MCI=y
 CONFIG_MCI_STARTUP=y
 CONFIG_MCI_IMX_ESDHC=y
-CONFIG_I2C_MC34708=y
+CONFIG_MFD_MC34708=y
 CONFIG_WATCHDOG=y
 CONFIG_WATCHDOG_IMX=y
 CONFIG_FS_TFTP=y
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 20eef86..a253de3 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -8,8 +8,8 @@ config I2C_MC34704
depends on I2C
bool "MC34704 PMIC driver"
 
-config I2C_MC34708
-   depends on I2C
+config MFD_MC34708
+   depends on I2C || SPI
bool "MC34708 PMIC driver"
 
 config I2C_MC9SDZ60
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 792ae2d..a242eaf 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -1,6 +1,6 @@
 obj-$(CONFIG_MFD_MC13XXX) += mc13xxx.o
 obj-$(CONFIG_I2C_MC34704) += mc34704.o
-obj-$(CONFIG_I2C_MC34708) += mc34708.o
+obj-$(CONFIG_MFD_MC34708) += mc34708.o
 obj-$(CONFIG_I2C_MC9SDZ60) += mc9sdz60.o
 obj-$(CONFIG_I2C_LP3972) += lp3972.o
 obj-$(CONFIG_I2C_TWLCORE) += twl-core.o
-- 
1.7.9.5


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


ethernet doesn't work after update to v2012.12.0

2012-12-10 Thread Wjatscheslaw Stoljarski (Slawa)

Hi All,

after updating to the version 2012.12.0 ethernet doesn't work anymore. 
My system is iMX53, ethernet Interface: MII100. What could be the cause?


devinfo output:
...
` imx_iim0
 ` 0x-0x001f: /dev/imx_iim_bank0
 ` 0x-0x001f: /dev/imx_iim_bank1
 ` 0x-0x001f: /dev/imx_iim_bank2
 ` 0x-0x001f: /dev/imx_iim_bank3
 ` 0x-0x001f: /dev/imx_iim_bank4
 ` 0x-0x001f: /dev/imx_iim_bank5
 ` 0x-0x001f: /dev/imx_iim_bank6
 ` 0x-0x001f: /dev/imx_iim_bank7
...
` imx27-fec
 ` miibus0
 ` eth0
...
imx_iim
fec_imx
Generic PHY
...

Best Regards,
Slawa

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


Re: [PATCH] Add JTAG bitbang driver

2012-08-09 Thread Wjatscheslaw Stoljarski (Slawa)

Hi, Sascha!

On 07/25/2012 09:19 AM, Sascha Hauer wrote:

How do you use this driver? From C code, or is there some command
planned?


I implement PSoC3 update, but with JTAG I have some trouble, what I 
haven't with SWD. Therefore much possible, that I will not use JTAG 
driver. But maybe somebody find it useful.


Thank you for tips!

Wjatscheslaw

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


[PATCH] ARM i.MX53: notify clocksource about changing clock

2012-07-24 Thread Wjatscheslaw Stoljarski (Slawa)

This fix a clock inaccuracy in get_time_ns (used by sleep, time, etc).

At i.MX53 power-on GPT clock is typically 5550 Hz, and it will be used
to calc the clock multiplier. After call imx53_init_lowlevel() GPT clock 
will

changed (e.g. to  Hz), but multiplier not. To fix this behavior call
clock_notifier_call_chain() after changing clock in imx53_init_lowlevel().

Signed-off-by: Wjatscheslaw Stoljarski 


---
 arch/arm/mach-imx/imx53.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-imx/imx53.c b/arch/arm/mach-imx/imx53.c
index e20b60a..3359819 100644
--- a/arch/arm/mach-imx/imx53.c
+++ b/arch/arm/mach-imx/imx53.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -211,4 +212,6 @@ void imx53_init_lowlevel(unsigned int cpufreq_mhz)
writel(0x, ccm + MX53_CCM_CCGR7);
writel(0, ccm + MX5_CCM_CCDR);
+
+   clock_notifier_call_chain();
 }
--
1.7.9.5


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


[PATCH] Add JTAG bitbang driver

2012-07-24 Thread Wjatscheslaw Stoljarski (Slawa)
Signed-off-by: Wjatscheslaw Stoljarski 


---
 drivers/Kconfig   |1 +
 drivers/Makefile  |1 +
 drivers/misc/Kconfig  |   27 
 drivers/misc/Makefile |5 +
 drivers/misc/jtag.c   |  395 
+

 include/jtag.h|  113 ++
 6 files changed, 542 insertions(+)
 create mode 100644 drivers/misc/Kconfig
 create mode 100644 drivers/misc/Makefile
 create mode 100644 drivers/misc/jtag.c
 create mode 100644 include/jtag.h

diff --git a/drivers/Kconfig b/drivers/Kconfig
index c52c56a..c4d7962 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -12,6 +12,7 @@ source "drivers/video/Kconfig"
 source "drivers/mci/Kconfig"
 source "drivers/clk/Kconfig"
 source "drivers/mfd/Kconfig"
+source "drivers/misc/Kconfig"
 source "drivers/led/Kconfig"
 source "drivers/eeprom/Kconfig"
 source "drivers/input/Kconfig"
diff --git a/drivers/Makefile b/drivers/Makefile
index 3aefc12..8e692cb 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -15,3 +15,4 @@ obj-$(CONFIG_LED) += led/
 obj-y  += eeprom/
 obj-$(CONFIG_PWM) += pwm/
 obj-y  += input/
+obj-y  += misc/
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
new file mode 100644
index 000..122e065
--- /dev/null
+++ b/drivers/misc/Kconfig
@@ -0,0 +1,27 @@
+#
+# Misc strange devices
+#
+
+menuconfig MISC_DEVICES
+   bool "Misc devices  "
+   default y
+   ---help---
+ Say Y here to get to see options for device drivers from various
+ different categories. This option alone does not add any kernel code.
+
+ If you say N, all options in this submenu will be skipped and 
disabled.
+
+if MISC_DEVICES
+
+config JTAG
+   tristate "Jtag Bitbang driver"
+   default n
+   ---help---
+   Controls jtag chains connected to I/O pins
+
+   This driver can also be built as a module. If so, the module
+   will be called jtag.
+
+   If unsure, say N.
+
+endif # MISC_DEVICES
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
new file mode 100644
index 000..b085577
--- /dev/null
+++ b/drivers/misc/Makefile
@@ -0,0 +1,5 @@
+#
+# Makefile for misc devices that really don't fit anywhere else.
+#
+
+obj-$(CONFIG_JTAG) += jtag.o
diff --git a/drivers/misc/jtag.c b/drivers/misc/jtag.c
new file mode 100644
index 000..1bd927b
--- /dev/null
+++ b/drivers/misc/jtag.c
@@ -0,0 +1,395 @@
+/*
+ * drivers/misc/jtag.c - More infos in include/jtag.h
+ *
+ * Written Aug 2009 by Davide Rizzo 
+ *
+ * Ported to barebox Jul 2012 by
+ *   Wjatscheslaw Stoljarski 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define VERSION_MAJ 1
+#define VERSION_MIN 0
+
+/* Max devices in the jtag chain */
+#define MAX_DEVICES 16
+
+static LIST_HEAD(jtag_device_list);
+
+struct jtag_info {
+   struct jtag_platdata *pdata;
+   struct cdev cdev;
+   unsigned int devices; /* Number of devices found in the jtag chain */
+   struct list_head device_entry;
+   /* Instruction register length of every device in the chain */
+   unsigned int ir_len[];  /* [devices] */
+};
+
+static const unsigned long bypass = 0x;
+
+static void pulseTMS0(const struct jtag_platdata *pdata)
+{
+   gpio_set_value(pdata->pin_tms, 0);
+   gpio_set_value(pdata->pin_tclk, 0);
+   gpio_set_value(pdata->pin_tclk, 1);
+}
+
+static void pulseTMS1(const struct jtag_platdata *pdata)
+{
+   gpio_set_value(pdata->pin_tms, 1);
+   gpio_set_value(pdata->pin_tclk, 0);
+   gpio_set_value(pdata->pin_tclk, 1);
+}
+
+static void jtag_reset(const struct jtag_platdata *pdata)
+{
+   gpio_set_value(pdata->pin_tms, 1);
+   gpio_set_value(pdata->pin_tclk, 0);
+   gpio_set_value(pdata->pin_tclk, 1);
+   gpio_set_value(pdata->pin_tclk, 0);
+   gpio_set_value(pdata->pin_tclk, 1);
+   gpio_set_value(pdata->pin_tclk, 0);
+   gpio_set_value(pdata->pin_tclk, 1);
+   gpio_set_value(pdata->pin_tclk, 0);
+   gpio_set_value(pdata->pin_tclk, 1);
+   gpio_set_value(pdata->pin_tclk, 0);
+   gpio_set_value(pdata->pin_tclk, 1);
+}
+
+static void jtag_output(const struct jtag_platdata *pdata,
+   const unsigned long *d

[PATCH] Add JTAG bitbang driver

2012-07-24 Thread Wjatscheslaw Stoljarski (Slawa)


>From 01b528ff11f3d0fe63db96b77e40ae9e695afaa7 Mon Sep 17 00:00:00 2001
From: "Wjatscheslaw Stoljarski" 
Date: Tue, 24 Jul 2012 10:54:55 +0200
Subject: [PATCH] Add JTAG bitbang driver

Signed-off-by: Wjatscheslaw Stoljarski 
---
 drivers/Kconfig   |1 +
 drivers/Makefile  |1 +
 drivers/misc/Kconfig  |   27 
 drivers/misc/Makefile |5 +
 drivers/misc/jtag.c   |  395 +
 include/jtag.h|  113 ++
 6 files changed, 542 insertions(+)
 create mode 100644 drivers/misc/Kconfig
 create mode 100644 drivers/misc/Makefile
 create mode 100644 drivers/misc/jtag.c
 create mode 100644 include/jtag.h

diff --git a/drivers/Kconfig b/drivers/Kconfig
index c52c56a..c4d7962 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -12,6 +12,7 @@ source "drivers/video/Kconfig"
 source "drivers/mci/Kconfig"
 source "drivers/clk/Kconfig"
 source "drivers/mfd/Kconfig"
+source "drivers/misc/Kconfig"
 source "drivers/led/Kconfig"
 source "drivers/eeprom/Kconfig"
 source "drivers/input/Kconfig"
diff --git a/drivers/Makefile b/drivers/Makefile
index 3aefc12..8e692cb 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -15,3 +15,4 @@ obj-$(CONFIG_LED) += led/
 obj-y	+= eeprom/
 obj-$(CONFIG_PWM) += pwm/
 obj-y	+= input/
+obj-y	+= misc/
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
new file mode 100644
index 000..122e065
--- /dev/null
+++ b/drivers/misc/Kconfig
@@ -0,0 +1,27 @@
+#
+# Misc strange devices
+#
+
+menuconfig MISC_DEVICES
+	bool "Misc devices  "
+	default y
+	---help---
+	  Say Y here to get to see options for device drivers from various
+	  different categories. This option alone does not add any kernel code.
+
+	  If you say N, all options in this submenu will be skipped and disabled.
+
+if MISC_DEVICES
+
+config JTAG
+	tristate "Jtag Bitbang driver"
+	default n
+	---help---
+	Controls jtag chains connected to I/O pins
+
+	This driver can also be built as a module. If so, the module
+	will be called jtag.
+
+	If unsure, say N.
+
+endif # MISC_DEVICES
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
new file mode 100644
index 000..b085577
--- /dev/null
+++ b/drivers/misc/Makefile
@@ -0,0 +1,5 @@
+#
+# Makefile for misc devices that really don't fit anywhere else.
+#
+
+obj-$(CONFIG_JTAG)		+= jtag.o
diff --git a/drivers/misc/jtag.c b/drivers/misc/jtag.c
new file mode 100644
index 000..1bd927b
--- /dev/null
+++ b/drivers/misc/jtag.c
@@ -0,0 +1,395 @@
+/*
+ * drivers/misc/jtag.c - More infos in include/jtag.h
+ *
+ * Written Aug 2009 by Davide Rizzo 
+ *
+ * Ported to barebox Jul 2012 by
+ *   Wjatscheslaw Stoljarski 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define VERSION_MAJ 1
+#define VERSION_MIN 0
+
+/* Max devices in the jtag chain */
+#define MAX_DEVICES 16
+
+static LIST_HEAD(jtag_device_list);
+
+struct jtag_info {
+	struct jtag_platdata *pdata;
+	struct cdev cdev;
+	unsigned int devices; /* Number of devices found in the jtag chain */
+	struct list_head device_entry;
+	/* Instruction register length of every device in the chain */
+	unsigned int ir_len[];	/* [devices] */
+};
+
+static const unsigned long bypass = 0x;
+
+static void pulseTMS0(const struct jtag_platdata *pdata)
+{
+	gpio_set_value(pdata->pin_tms, 0);
+	gpio_set_value(pdata->pin_tclk, 0);
+	gpio_set_value(pdata->pin_tclk, 1);
+}
+
+static void pulseTMS1(const struct jtag_platdata *pdata)
+{
+	gpio_set_value(pdata->pin_tms, 1);
+	gpio_set_value(pdata->pin_tclk, 0);
+	gpio_set_value(pdata->pin_tclk, 1);
+}
+
+static void jtag_reset(const struct jtag_platdata *pdata)
+{
+	gpio_set_value(pdata->pin_tms, 1);
+	gpio_set_value(pdata->pin_tclk, 0);
+	gpio_set_value(pdata->pin_tclk, 1);
+	gpio_set_value(pdata->pin_tclk, 0);
+	gpio_set_value(pdata->pin_tclk, 1);
+	gpio_set_value(pdata->pin_tclk, 0);
+	gpio_set_value(pdata->pin_tclk, 1);
+	gpio_set_value(pdata->pin_tclk, 0);
+	gpio_set_value(pdata->pin_tclk, 1);
+	gpio_set_value(pdata->pin_tclk, 0);
+	gpio_set_value(pdata->pin_tclk, 1);
+}
+
+static void jtag_output(const struct jtag_platdata *pdata,
+	const unsigned long *data, unsigned int bitlen, int notlast)
+{
+	unsigned in

[PATCH] i.MX53 boards: notify clocksource after init_lowlevel

2012-07-23 Thread Wjatscheslaw Stoljarski (Slawa)


>From 4d9a8e960654c02205cf4a8e47b4e86cac4b2a95 Mon Sep 17 00:00:00 2001
From: "Wjatscheslaw Stoljarski" 
Date: Mon, 23 Jul 2012 13:48:07 +0200
Subject: [PATCH] i.MX53 boards: notify clocksource after init_lowlevel

This fix a clock inaccuracy in get_time_ns (used by sleep, time, etc).

Signed-off-by: Wjatscheslaw Stoljarski 
---
 arch/arm/boards/freescale-mx53-loco/board.c |2 ++
 arch/arm/boards/freescale-mx53-smd/board.c  |2 ++
 arch/arm/boards/tqma53/board.c  |2 ++
 3 files changed, 6 insertions(+)

diff --git a/arch/arm/boards/freescale-mx53-loco/board.c b/arch/arm/boards/freescale-mx53-loco/board.c
index 0d71555..b8e8d24 100644
--- a/arch/arm/boards/freescale-mx53-loco/board.c
+++ b/arch/arm/boards/freescale-mx53-loco/board.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -215,6 +216,7 @@ static int loco_console_init(void)
 	mxc_iomux_v3_setup_multiple_pads(loco_pads, ARRAY_SIZE(loco_pads));
 
 	imx53_init_lowlevel(1000);
+	clock_notifier_call_chain();
 
 	imx53_add_uart0();
 	return 0;
diff --git a/arch/arm/boards/freescale-mx53-smd/board.c b/arch/arm/boards/freescale-mx53-smd/board.c
index 0483103..74b38bd 100644
--- a/arch/arm/boards/freescale-mx53-smd/board.c
+++ b/arch/arm/boards/freescale-mx53-smd/board.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -161,6 +162,7 @@ static int smd_console_init(void)
 	mxc_iomux_v3_setup_multiple_pads(smd_pads, ARRAY_SIZE(smd_pads));
 
 	imx53_init_lowlevel(1000);
+	clock_notifier_call_chain();
 
 	imx53_add_uart0();
 	imx53_add_uart1();
diff --git a/arch/arm/boards/tqma53/board.c b/arch/arm/boards/tqma53/board.c
index 8c3d855..c4837cb 100644
--- a/arch/arm/boards/tqma53/board.c
+++ b/arch/arm/boards/tqma53/board.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -265,6 +266,7 @@ static int tqma53_console_init(void)
 {
 	mxc_iomux_v3_setup_multiple_pads(tqma53_pads, ARRAY_SIZE(tqma53_pads));
 	imx53_init_lowlevel(800);
+	clock_notifier_call_chain();
 	imx53_add_uart0();
 
 	return 0;
-- 
1.7.9.5

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