Shkëmbime Linqesh – Trafik i Vërtetë Falas

2013-03-14 Thread Sonila Cela
Ç’kemi,

Emri im është Sonila Cela,

Do të doja t’ju sugjeroja një shkëmbim linqesh falas 
me  lists.infradead.org ose çfarëdo faqeje tjetër që 
zotëroni.
Mendoj se do t’ju pëlqejë të dini se kam në dorë 
një sërë projektesh cilësore, për të 
shkëmbyer linqe falas dhe jam i sigurt se mund të jetë 
frytdhënëse dhe produktive për të dy ne. 
 
Ju lutem më thoni nëse do të dini më shumë detaje, ose 
nëse keni sugjerime të mëtejshme për këtë 
çështje.
 
Në pritje për të dëgjuar sërish nga ju!

Sonila Cela
http://www.falaseo.com

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


[RFC 1/3] clk: Remove unneded private "parent" fields

2013-03-14 Thread Alexander Shiyan

Signed-off-by: Alexander Shiyan 
---
 drivers/clk/clk-divider-table.c |4 +---
 drivers/clk/clk-divider.c   |4 +---
 drivers/clk/clk-fixed-factor.c  |4 +---
 drivers/clk/clk-gate.c  |4 +---
 4 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/clk-divider-table.c b/drivers/clk/clk-divider-table.c
index 204e24d..e75fb78 100644
--- a/drivers/clk/clk-divider-table.c
+++ b/drivers/clk/clk-divider-table.c
@@ -25,7 +25,6 @@ struct clk_divider_table {
u8 shift;
u8 width;
void __iomem *reg;
-   const char *parent;
const struct clk_div_table *table;
int table_size;
int max_div_index;
@@ -94,10 +93,9 @@ struct clk *clk_divider_table(const char *name,
div->shift = shift;
div->reg = reg;
div->width = width;
-   div->parent = parent;
div->clk.ops = &clk_divider_table_ops;
div->clk.name = name;
-   div->clk.parent_names = &div->parent;
+   div->clk.parent_names = &parent;
div->clk.num_parents = 1;
div->table = table;
 
diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
index 58a7ea5..012b960 100644
--- a/drivers/clk/clk-divider.c
+++ b/drivers/clk/clk-divider.c
@@ -25,7 +25,6 @@ struct clk_divider {
u8 shift;
u8 width;
void __iomem *reg;
-   const char *parent;
 };
 
 static int clk_divider_set_rate(struct clk *clk, unsigned long rate,
@@ -82,10 +81,9 @@ struct clk *clk_divider(const char *name, const char *parent,
div->shift = shift;
div->reg = reg;
div->width = width;
-   div->parent = parent;
div->clk.ops = &clk_divider_ops;
div->clk.name = name;
-   div->clk.parent_names = &div->parent;
+   div->clk.parent_names = &parent;
div->clk.num_parents = 1;
 
ret = clk_register(&div->clk);
diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
index 52e7c16..a57984d 100644
--- a/drivers/clk/clk-fixed-factor.c
+++ b/drivers/clk/clk-fixed-factor.c
@@ -24,7 +24,6 @@ struct clk_fixed_factor {
struct clk clk;
int mult;
int div;
-   const char *parent;
 };
 
 static unsigned long clk_fixed_factor_recalc_rate(struct clk *clk,
@@ -47,10 +46,9 @@ struct clk *clk_fixed_factor(const char *name,
 
f->mult = mult;
f->div = div;
-   f->parent = parent;
f->clk.ops = &clk_fixed_factor_ops;
f->clk.name = name;
-   f->clk.parent_names = &f->parent;
+   f->clk.parent_names = &parent;
f->clk.num_parents = 1;
 
ret = clk_register(&f->clk);
diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c
index cf1bb1a..2dca11c 100644
--- a/drivers/clk/clk-gate.c
+++ b/drivers/clk/clk-gate.c
@@ -24,7 +24,6 @@ struct clk_gate {
struct clk clk;
void __iomem *reg;
int shift;
-   const char *parent;
 };
 
 static int clk_gate_enable(struct clk *clk)
@@ -60,12 +59,11 @@ struct clk *clk_gate(const char *name, const char *parent, 
void __iomem *reg,
struct clk_gate *g = xzalloc(sizeof(*g));
int ret;
 
-   g->parent = parent;
g->reg = reg;
g->shift = shift;
g->clk.ops = &clk_gate_ops;
g->clk.name = name;
-   g->clk.parent_names = &g->parent;
+   g->clk.parent_names = &parent;
g->clk.num_parents = 1;
 
ret = clk_register(&g->clk);
-- 
1.7.3.4


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


[RFC 2/3] clk: Using the "is_enabled" to determine the clock state

2013-03-14 Thread Alexander Shiyan

Signed-off-by: Alexander Shiyan 
---
 drivers/clk/clk.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index cb94755..d5dbbd9 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -213,6 +213,8 @@ int clk_register(struct clk *clk)
 
if (clk->flags & CLK_ALWAYS_ENABLED) {
clk->enable_count = 1;
+   } else if (clk->ops->is_enabled) {
+   clk->enable_count = clk->ops->is_enabled(clk);
}
 
return 0;
-- 
1.7.3.4


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


[RFC 3/3] clk: Add "is_enabled" callback for gated clocks

2013-03-14 Thread Alexander Shiyan

Signed-off-by: Alexander Shiyan 
---
 drivers/clk/clk-gate.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c
index 2dca11c..580720b 100644
--- a/drivers/clk/clk-gate.c
+++ b/drivers/clk/clk-gate.c
@@ -48,9 +48,17 @@ static void clk_gate_disable(struct clk *clk)
writel(val, g->reg);
 }
 
+static int clk_gate_is_enabled(struct clk *clk)
+{
+   struct clk_gate *g = container_of(clk, struct clk_gate, clk);
+
+   return !!(readl(g->reg) & (1 << g->shift));
+}
+
 struct clk_ops clk_gate_ops = {
.enable = clk_gate_enable,
.disable = clk_gate_disable,
+   .is_enabled = clk_gate_is_enabled,
 };
 
 struct clk *clk_gate(const char *name, const char *parent, void __iomem *reg,
-- 
1.7.3.4


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


[PATCH 06/10] bootsource: create arch independent bootsource framework

2013-03-14 Thread Marc Kleine-Budde
This patch seperates the imx independent from the arch independent code. The
following functions and enums are renamed:

- imx_bootsource() -> bootsource_get()
- imx_set_bootsource() -> bootsource_set()
- enum imx_bootsource -> enum bootsource

Signed-off-by: Marc Kleine-Budde 
---
 arch/arm/boards/efika-mx-smartbook/board.c |  3 +-
 arch/arm/boards/karo-tx53/board.c  |  3 +-
 arch/arm/boards/pcm038/pcm038.c|  3 +-
 arch/arm/mach-imx/boot.c   | 57 +++---
 arch/arm/mach-imx/include/mach/generic.h   | 15 
 common/Makefile|  1 +
 common/bootsource.c| 53 +++
 include/bootsource.h   | 19 ++
 8 files changed, 92 insertions(+), 62 deletions(-)
 create mode 100644 common/bootsource.c
 create mode 100644 include/bootsource.h

diff --git a/arch/arm/boards/efika-mx-smartbook/board.c 
b/arch/arm/boards/efika-mx-smartbook/board.c
index 03399a3..e9b6062 100644
--- a/arch/arm/boards/efika-mx-smartbook/board.c
+++ b/arch/arm/boards/efika-mx-smartbook/board.c
@@ -14,6 +14,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -479,7 +480,7 @@ device_initcall(efikamx_devices_init);
 
 static int efikamx_part_init(void)
 {
-   if (imx_bootsource() == BOOTSOURCE_MMC) {
+   if (bootsource_get() == BOOTSOURCE_MMC) {
devfs_add_partition("mmc_left", 0x0, 0x8,
DEVFS_PARTITION_FIXED, "self0");
devfs_add_partition("mmc_left", 0x8, 0x8,
diff --git a/arch/arm/boards/karo-tx53/board.c 
b/arch/arm/boards/karo-tx53/board.c
index 3112552..7e1ef37 100644
--- a/arch/arm/boards/karo-tx53/board.c
+++ b/arch/arm/boards/karo-tx53/board.c
@@ -13,6 +13,7 @@
  *
  */
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -234,7 +235,7 @@ static int tx53_part_init(void)
 {
const char *envdev;
 
-   switch (imx_bootsource()) {
+   switch (bootsource_get()) {
case BOOTSOURCE_MMC:
devfs_add_partition("disk0", 0x0, SZ_512K, 
DEVFS_PARTITION_FIXED, "self0");
devfs_add_partition("disk0", SZ_512K, SZ_1M, 
DEVFS_PARTITION_FIXED, "env0");
diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index af31414..1bd5ffe 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -16,6 +16,7 @@
 #define pr_fmt(fmt) "pcm038: " fmt
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -295,7 +296,7 @@ static int pcm038_devices_init(void)
 */
imx27_add_fec(&fec_info);
 
-   switch (imx_bootsource()) {
+   switch (bootsource_get()) {
case BOOTSOURCE_NAND:
devfs_add_partition("nand0", 0x0, 0x8,
DEVFS_PARTITION_FIXED, "self_raw");
diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c
index 95a7673..05730e4 100644
--- a/arch/arm/mach-imx/boot.c
+++ b/arch/arm/mach-imx/boot.c
@@ -12,6 +12,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -21,40 +22,8 @@
 #include 
 #include 
 
-static const char *bootsource_str[] = {
-   [BOOTSOURCE_UNKNOWN] = "unknown",
-   [BOOTSOURCE_NAND] = "nand",
-   [BOOTSOURCE_NOR] = "nor",
-   [BOOTSOURCE_MMC] = "mmc",
-   [BOOTSOURCE_I2C] = "i2c",
-   [BOOTSOURCE_SPI] = "spi",
-   [BOOTSOURCE_SERIAL] = "serial",
-   [BOOTSOURCE_ONENAND] = "onenand",
-   [BOOTSOURCE_HD] = "harddisk",
-};
-
-static enum imx_bootsource bootsource;
-
-void imx_set_bootsource(enum imx_bootsource src)
-{
-   if (src >= ARRAY_SIZE(bootsource_str))
-   src = BOOTSOURCE_UNKNOWN;
-
-   bootsource = src;
-
-   setenv("barebox_loc", bootsource_str[src]);
-   export("barebox_loc");
-}
-
-enum imx_bootsource imx_bootsource(void)
-{
-   return bootsource;
-}
-
-BAREBOX_MAGICVAR(barebox_loc, "The source barebox has been booted from");
-
 /* [CTRL][TYPE] */
-static const enum imx_bootsource locations[4][4] = {
+static const enum bootsource locations[4][4] = {
{ /* CTRL = WEIM */
BOOTSOURCE_NOR,
BOOTSOURCE_UNKNOWN,
@@ -98,11 +67,11 @@ static const enum imx_bootsource locations[4][4] = {
  */
 static void imx25_35_boot_save_loc(unsigned int ctrl, unsigned int type)
 {
-   enum imx_bootsource src;
+   enum bootsource src;
 
src = locations[ctrl][type];
 
-   imx_set_bootsource(src);
+   bootsource_set(src);
 }
 
 void imx25_boot_save_loc(void __iomem *ccm_base)
@@ -136,7 +105,7 @@ void imx35_boot_save_loc(void __iomem *ccm_base)
 
 void imx27_boot_save_loc(void __iomem *sysctrl_base)
 {
-   enum imx_bootsource src;
+   enum bootsource src;
uint32_t val;
 
val = readl(sysctrl_base + IMX27_SYSCTRL_GPCR);
@@ -158,7 +127,7 @@ void imx27_boot_save_loc(void __iomem *sysctrl_base)
break;
}
 
-   

[PATCH 10/10] ARM: mxs: add bootsource detection

2013-03-14 Thread Marc Kleine-Budde
For now only the v1.2 i.MX28 silicon is supported. The actual information is
read from a magic address within the internal SRAM.

Signed-off-by: Marc Kleine-Budde 
---
 arch/arm/mach-mxs/imx.c   | 99 +++
 arch/arm/mach-mxs/include/mach/revision.h | 24 
 2 files changed, 123 insertions(+)
 create mode 100644 arch/arm/mach-mxs/include/mach/revision.h

diff --git a/arch/arm/mach-mxs/imx.c b/arch/arm/mach-mxs/imx.c
index ab32f10..2ddec23 100644
--- a/arch/arm/mach-mxs/imx.c
+++ b/arch/arm/mach-mxs/imx.c
@@ -14,11 +14,15 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+
+#include 
 #include 
+#include 
 
 #define HW_RTC_PERSISTENT1 0x070
 
@@ -55,3 +59,98 @@ BAREBOX_CMD_START(dump_clocks)
.usage  = "show clock frequencies",
BAREBOX_CMD_COMPLETE(empty_complete)
 BAREBOX_CMD_END
+
+
+static int __silicon_revision = SILICON_REVISION_UNKNOWN;
+
+int silicon_revision_get(void)
+{
+   return __silicon_revision;
+}
+
+void silicon_revision_set(const char *soc, int revision)
+{
+   __silicon_revision = revision;
+
+   printf("detected %s revision %d.%d\n", soc,
+  (revision >> 4) & 0xf, revision & 0xf);
+}
+
+#define HW_DIGCTL_CHIPID   (0x8001c310)
+#define HW_DIGCTL_CHIPID_MASK  (0x << 16)
+#define HW_DIGCTL_CHIPID_MX23  (0x3780 << 16)
+#define HW_DIGCTL_CHIPID_MX28  (0x2800 << 16)
+
+static void mxs_silicon_revision(void)
+{
+   enum silicon_revision revision = SILICON_REVISION_UNKNOWN;
+   const char *product = "unknown";
+   uint32_t reg;
+   uint8_t rev;
+
+   reg = readl((void __iomem *)HW_DIGCTL_CHIPID);
+   rev = reg & 0xff;
+
+   switch (reg & HW_DIGCTL_CHIPID_MASK) {
+   case HW_DIGCTL_CHIPID_MX23:
+   product = "i.MX23";
+   switch (rev) {
+   case 0x0: revision = SILICON_REVISION_1_0; break;
+   case 0x1: revision = SILICON_REVISION_1_1; break;
+   case 0x2: revision = SILICON_REVISION_1_2; break;
+   case 0x3: revision = SILICON_REVISION_1_3; break;
+   case 0x4: revision = SILICON_REVISION_1_4; break;
+   }
+   case HW_DIGCTL_CHIPID_MX28:
+   product = "i.MX28";
+   switch (rev) {
+   case 0x1: revision = SILICON_REVISION_1_2; break;
+   }
+   }
+
+   silicon_revision_set(product, revision);
+}
+
+#define MX28_REV_1_0_MODE  (0x0001a7f0)
+#define MX28_REV_1_2_MODE  (0x00019bf0)
+
+static void mxs_boot_save_loc(void)
+{
+   enum bootsource src = BOOTSOURCE_UNKNOWN;
+   int instance = 0;
+   uint32_t mode = 0xff;
+
+   if (cpu_is_mx23()) {
+   /* not implemented yet */
+   } else if (cpu_is_mx28()) {
+   enum silicon_revision rev = silicon_revision_get();
+
+   if (rev == SILICON_REVISION_1_2)
+   mode = *(uint32_t *)MX28_REV_1_2_MODE;
+   else
+   mode = *(uint32_t *)MX28_REV_1_0_MODE;
+   }
+
+   switch (mode & 0xf) {
+   case 0x0: src = BOOTSOURCE_USB; break;  /* "USB" */
+   case 0x1: src = BOOTSOURCE_I2C; break;  /* "I2C, master" */
+   case 0x3: instance = 1; /* fallthrough */   /* "SSP SPI #2, master, 
NOR" */
+   case 0x2: src = BOOTSOURCE_NOR; break;  /* "SSP SPI #1, master, 
NOR" */
+   case 0x4: src = BOOTSOURCE_NAND; break; /* "NAND" */
+   case 0x8: src = BOOTSOURCE_EEPROM; break;   /* "SSP SPI #3, master, 
EEPROM" */
+   case 0xa: instance = 1; /* fallthrough */   /* "SSP SD/MMC #1" */
+   case 0x9: src = BOOTSOURCE_MMC; break;  /* "SSP SD/MMC #0" */
+   }
+
+   bootsource_set(src);
+   bootsource_set_instance(instance);
+}
+
+static int mxs_init(void)
+{
+   mxs_silicon_revision();
+   mxs_boot_save_loc();
+
+   return 0;
+}
+postcore_initcall(mxs_init);
diff --git a/arch/arm/mach-mxs/include/mach/revision.h 
b/arch/arm/mach-mxs/include/mach/revision.h
new file mode 100644
index 000..91f174d
--- /dev/null
+++ b/arch/arm/mach-mxs/include/mach/revision.h
@@ -0,0 +1,24 @@
+#ifndef __MACH_REVISION_H__
+#define __MACH_REVISION_H__
+
+/* silicon revisions  */
+enum silicon_revision {
+   SILICON_REVISION_1_0 = 0x10,
+   SILICON_REVISION_1_1 = 0x11,
+   SILICON_REVISION_1_2 = 0x12,
+   SILICON_REVISION_1_3 = 0x13,
+   SILICON_REVISION_1_4 = 0x14,
+   SILICON_REVISION_2_0 = 0x20,
+   SILICON_REVISION_2_1 = 0x21,
+   SILICON_REVISION_2_2 = 0x22,
+   SILICON_REVISION_2_3 = 0x23,
+   SILICON_REVISION_3_0 = 0x30,
+   SILICON_REVISION_3_1 = 0x31,
+   SILICON_REVISION_3_2 = 0x32,
+   SILICON_REVISION_UNKNOWN =0xff
+};
+
+int silicon_revision_get(void);
+void silicon_revision_set(const char *soc, int revision);
+
+#endif /* __MACH_REVISION_H__ */
-- 
1.8.2.rc2


__

[PATCH 09/10] bootsource: add definition for usb and eeprom

2013-03-14 Thread Marc Kleine-Budde
Signed-off-by: Marc Kleine-Budde 
---
 common/bootsource.c  | 2 ++
 include/bootsource.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/common/bootsource.c b/common/bootsource.c
index fae554d..599bcd2 100644
--- a/common/bootsource.c
+++ b/common/bootsource.c
@@ -31,6 +31,8 @@ static const char *bootsource_str[] = {
[BOOTSOURCE_SERIAL] = "serial",
[BOOTSOURCE_ONENAND] = "onenand",
[BOOTSOURCE_HD] = "harddisk",
+   [BOOTSOURCE_USB] = "usb",
+   [BOOTSOURCE_EEPROM] = "eeprom",
 };
 
 static enum bootsource bootsource = BOOTSOURCE_UNKNOWN;
diff --git a/include/bootsource.h b/include/bootsource.h
index dfcad49..84a6696 100644
--- a/include/bootsource.h
+++ b/include/bootsource.h
@@ -11,6 +11,8 @@ enum bootsource {
BOOTSOURCE_SERIAL,
BOOTSOURCE_ONENAND,
BOOTSOURCE_HD,
+   BOOTSOURCE_USB,
+   BOOTSOURCE_EEPROM,
 };
 
 enum bootsource bootsource_get(void);
-- 
1.8.2.rc2


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


[PATCH 05/10] ARM i.MX bootsource: add separate function for mx25 and mx35

2013-03-14 Thread Marc Kleine-Budde
This patch creates a seperate function for mx25 and mx35 to save it's
bootsource.

Signed-off-by: Marc Kleine-Budde 
---
 arch/arm/mach-imx/boot.c | 22 +-
 arch/arm/mach-imx/imx25.c|  6 +-
 arch/arm/mach-imx/imx35.c|  6 +-
 arch/arm/mach-imx/include/mach/generic.h |  3 ++-
 4 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c
index 473b9d1..95a7673 100644
--- a/arch/arm/mach-imx/boot.c
+++ b/arch/arm/mach-imx/boot.c
@@ -18,6 +18,8 @@
 
 #include 
 #include 
+#include 
+#include 
 
 static const char *bootsource_str[] = {
[BOOTSOURCE_UNKNOWN] = "unknown",
@@ -94,7 +96,7 @@ static const enum imx_bootsource locations[4][4] = {
  * Note also that I suspect that the boot source pins are only sampled at
  * power up.
  */
-void imx_25_35_boot_save_loc(unsigned int ctrl, unsigned int type)
+static void imx25_35_boot_save_loc(unsigned int ctrl, unsigned int type)
 {
enum imx_bootsource src;
 
@@ -103,6 +105,24 @@ void imx_25_35_boot_save_loc(unsigned int ctrl, unsigned 
int type)
imx_set_bootsource(src);
 }
 
+void imx25_boot_save_loc(void __iomem *ccm_base)
+{
+   uint32_t val;
+
+   val = readl(ccm_base + MX25_CCM_RCSR);
+   imx25_35_boot_save_loc((val >> MX25_CCM_RCSR_MEM_CTRL_SHIFT) & 0x3,
+  (val >> MX25_CCM_RCSR_MEM_TYPE_SHIFT) & 0x3);
+}
+
+void imx35_boot_save_loc(void __iomem *ccm_base)
+{
+   uint32_t val;
+
+   val = readl(ccm_base + MX35_CCM_RCSR);
+   imx25_35_boot_save_loc((val >> MX35_CCM_RCSR_MEM_CTRL_SHIFT) & 0x3,
+  (val >> MX35_CCM_RCSR_MEM_TYPE_SHIFT) & 0x3);
+}
+
 #define IMX27_SYSCTRL_GPCR 0x18
 #define IMX27_GPCR_BOOT_SHIFT  16
 #define IMX27_GPCR_BOOT_MASK   (0xf << IMX27_GPCR_BOOT_SHIFT)
diff --git a/arch/arm/mach-imx/imx25.c b/arch/arm/mach-imx/imx25.c
index adcd9d2..5011918 100644
--- a/arch/arm/mach-imx/imx25.c
+++ b/arch/arm/mach-imx/imx25.c
@@ -59,11 +59,7 @@ static struct imx_iim_platform_data imx25_iim_pdata = {
 
 static int imx25_init(void)
 {
-   uint32_t val;
-
-   val = readl(MX25_CCM_BASE_ADDR + MX25_CCM_RCSR);
-   imx_25_35_boot_save_loc((val >> MX25_CCM_RCSR_MEM_CTRL_SHIFT) & 0x3,
-   (val >> MX25_CCM_RCSR_MEM_TYPE_SHIFT) & 0x3);
+   imx25_boot_save_loc((void *)MX25_CCM_BASE_ADDR);
 
add_generic_device("imx_iim", 0, NULL, MX25_IIM_BASE_ADDR, SZ_4K,
IORESOURCE_MEM, &imx25_iim_pdata);
diff --git a/arch/arm/mach-imx/imx35.c b/arch/arm/mach-imx/imx35.c
index 7b68783..92f6964 100644
--- a/arch/arm/mach-imx/imx35.c
+++ b/arch/arm/mach-imx/imx35.c
@@ -59,13 +59,9 @@ core_initcall(imx35_l2_fix);
 
 static int imx35_init(void)
 {
-   uint32_t val;
-
imx35_silicon_revision();
 
-   val = readl(MX35_CCM_BASE_ADDR + MX35_CCM_RCSR);
-   imx_25_35_boot_save_loc((val >> MX35_CCM_RCSR_MEM_CTRL_SHIFT) & 0x3,
-   (val >> MX35_CCM_RCSR_MEM_TYPE_SHIFT) & 0x3);
+   imx35_boot_save_loc((void *)MX35_CCM_BASE_ADDR);
 
add_generic_device("imx_iim", 0, NULL, MX35_IIM_BASE_ADDR, SZ_4K,
IORESOURCE_MEM, NULL);
diff --git a/arch/arm/mach-imx/include/mach/generic.h 
b/arch/arm/mach-imx/include/mach/generic.h
index d39369b..f6e9ecf 100644
--- a/arch/arm/mach-imx/include/mach/generic.h
+++ b/arch/arm/mach-imx/include/mach/generic.h
@@ -16,7 +16,8 @@ enum imx_bootsource {
 enum imx_bootsource imx_bootsource(void);
 void imx_set_bootsource(enum imx_bootsource src);
 
-void imx_25_35_boot_save_loc(unsigned int ctrl, unsigned int type);
+void imx25_boot_save_loc(void __iomem *ccm_base);
+void imx35_boot_save_loc(void __iomem *ccm_base);
 void imx27_boot_save_loc(void __iomem *sysctrl_base);
 void imx51_boot_save_loc(void __iomem *src_base);
 void imx53_boot_save_loc(void __iomem *src_base);
-- 
1.8.2.rc2


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


[PATCH 07/10] bootsource: use initcall to export bootsource location to environment

2013-03-14 Thread Marc Kleine-Budde
This way the bootsource is exported to the environment, even if unknown.

Signed-off-by: Marc Kleine-Budde 
---
 common/bootsource.c | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/common/bootsource.c b/common/bootsource.c
index 2aa0ffa..ebe4407 100644
--- a/common/bootsource.c
+++ b/common/bootsource.c
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static const char *bootsource_str[] = {
[BOOTSOURCE_UNKNOWN] = "unknown",
@@ -42,7 +43,6 @@ void bootsource_set(enum bootsource src)
bootsource = src;
 
setenv("barebox_loc", bootsource_str[src]);
-   export("barebox_loc");
 }
 
 enum bootsource bootsource_get(void)
@@ -51,3 +51,12 @@ enum bootsource bootsource_get(void)
 }
 
 BAREBOX_MAGICVAR(barebox_loc, "The source barebox has been booted from");
+
+static int bootsource_init(void)
+{
+   bootsource_set(bootsource);
+   export("barebox_loc");
+
+   return 0;
+}
+coredevice_initcall(bootsource_init);
-- 
1.8.2.rc2


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


[PATCH 04/10] ARM i.MX bootsource: rename imx_27_boot_save_loc -> imx27_boot_save_loc

2013-03-14 Thread Marc Kleine-Budde
This patch renames imx_27_boot_save_loc() to imx27_boot_save_loc(), so that all
imx*_boot_save_loc() functions follow the same nameing sheme.

Signed-off-by: Marc Kleine-Budde 
---
 arch/arm/mach-imx/boot.c | 2 +-
 arch/arm/mach-imx/imx27.c| 2 +-
 arch/arm/mach-imx/include/mach/generic.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c
index 37f1180..473b9d1 100644
--- a/arch/arm/mach-imx/boot.c
+++ b/arch/arm/mach-imx/boot.c
@@ -114,7 +114,7 @@ void imx_25_35_boot_save_loc(unsigned int ctrl, unsigned 
int type)
 #define IMX27_GPCR_BOOT_32BIT_CS0  6
 #define IMX27_GPCR_BOOT_8BIT_NAND_512  7
 
-void imx_27_boot_save_loc(void __iomem *sysctrl_base)
+void imx27_boot_save_loc(void __iomem *sysctrl_base)
 {
enum imx_bootsource src;
uint32_t val;
diff --git a/arch/arm/mach-imx/imx27.c b/arch/arm/mach-imx/imx27.c
index 6d30276..7615b98 100644
--- a/arch/arm/mach-imx/imx27.c
+++ b/arch/arm/mach-imx/imx27.c
@@ -99,7 +99,7 @@ static void imx27_init_max(void)
 static int imx27_init(void)
 {
imx27_silicon_revision();
-   imx_27_boot_save_loc((void *)MX27_SYSCTRL_BASE_ADDR);
+   imx27_boot_save_loc((void *)MX27_SYSCTRL_BASE_ADDR);
 
imx_iomuxv1_init((void *)MX27_GPIO1_BASE_ADDR);
 
diff --git a/arch/arm/mach-imx/include/mach/generic.h 
b/arch/arm/mach-imx/include/mach/generic.h
index e6edb94..d39369b 100644
--- a/arch/arm/mach-imx/include/mach/generic.h
+++ b/arch/arm/mach-imx/include/mach/generic.h
@@ -17,7 +17,7 @@ enum imx_bootsource imx_bootsource(void);
 void imx_set_bootsource(enum imx_bootsource src);
 
 void imx_25_35_boot_save_loc(unsigned int ctrl, unsigned int type);
-void imx_27_boot_save_loc(void __iomem *sysctrl_base);
+void imx27_boot_save_loc(void __iomem *sysctrl_base);
 void imx51_boot_save_loc(void __iomem *src_base);
 void imx53_boot_save_loc(void __iomem *src_base);
 void imx6_boot_save_loc(void __iomem *src_base);
-- 
1.8.2.rc2


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


[PATCH 08/10] bootsource: add support for bootsource instance information

2013-03-14 Thread Marc Kleine-Budde
Add a C interface to set and get the bootsource instance:

int bootsource_get_instance(void);
void bootsource_set_instance(int instance);

Also export the shell variable "barebox_loc_instance".

Signed-off-by: Marc Kleine-Budde 
---
 common/bootsource.c  | 20 
 include/bootsource.h |  2 ++
 2 files changed, 22 insertions(+)

diff --git a/common/bootsource.c b/common/bootsource.c
index ebe4407..fae554d 100644
--- a/common/bootsource.c
+++ b/common/bootsource.c
@@ -34,6 +34,7 @@ static const char *bootsource_str[] = {
 };
 
 static enum bootsource bootsource = BOOTSOURCE_UNKNOWN;
+static int bootsource_instance = 0;
 
 void bootsource_set(enum bootsource src)
 {
@@ -45,6 +46,16 @@ void bootsource_set(enum bootsource src)
setenv("barebox_loc", bootsource_str[src]);
 }
 
+void bootsource_set_instance(int instance)
+{
+   char buf[32];
+
+   bootsource_instance = instance;
+   snprintf(buf, sizeof(buf), "%d", instance);
+
+   setenv("barebox_loc_instance", buf);
+}
+
 enum bootsource bootsource_get(void)
 {
return bootsource;
@@ -52,10 +63,19 @@ enum bootsource bootsource_get(void)
 
 BAREBOX_MAGICVAR(barebox_loc, "The source barebox has been booted from");
 
+int bootsource_get_instance(void)
+{
+   return bootsource_instance;
+}
+
+BAREBOX_MAGICVAR(barebox_loc_instance, "The instance of the source barebox has 
been booted from");
+
 static int bootsource_init(void)
 {
bootsource_set(bootsource);
+   bootsource_set_instance(bootsource_instance);
export("barebox_loc");
+   export("barebox_loc_instance");
 
return 0;
 }
diff --git a/include/bootsource.h b/include/bootsource.h
index ecd5938..dfcad49 100644
--- a/include/bootsource.h
+++ b/include/bootsource.h
@@ -14,6 +14,8 @@ enum bootsource {
 };
 
 enum bootsource bootsource_get(void);
+int bootsource_get_instance(void);
 void bootsource_set(enum bootsource src);
+void bootsource_set_instance(int instance);
 
 #endif /* __BOOTSOURCE_H__ */
-- 
1.8.2.rc2


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


[PATCH 01/10] ARM i.MX bootsource: convert enums from enum imx_bootsource to uppercase

2013-03-14 Thread Marc Kleine-Budde
Enums are in the same way as defines, so write them in uppercase.

Signed-off-by: Marc Kleine-Budde 
---
 arch/arm/boards/efika-mx-smartbook/board.c |  2 +-
 arch/arm/boards/karo-tx53/board.c  |  4 +-
 arch/arm/boards/pcm038/pcm038.c|  2 +-
 arch/arm/mach-imx/boot.c   | 90 +++---
 arch/arm/mach-imx/include/mach/generic.h   | 18 +++---
 5 files changed, 58 insertions(+), 58 deletions(-)

diff --git a/arch/arm/boards/efika-mx-smartbook/board.c 
b/arch/arm/boards/efika-mx-smartbook/board.c
index 5c02689..03399a3 100644
--- a/arch/arm/boards/efika-mx-smartbook/board.c
+++ b/arch/arm/boards/efika-mx-smartbook/board.c
@@ -479,7 +479,7 @@ device_initcall(efikamx_devices_init);
 
 static int efikamx_part_init(void)
 {
-   if (imx_bootsource() == bootsource_mmc) {
+   if (imx_bootsource() == BOOTSOURCE_MMC) {
devfs_add_partition("mmc_left", 0x0, 0x8,
DEVFS_PARTITION_FIXED, "self0");
devfs_add_partition("mmc_left", 0x8, 0x8,
diff --git a/arch/arm/boards/karo-tx53/board.c 
b/arch/arm/boards/karo-tx53/board.c
index 8a69e99..3112552 100644
--- a/arch/arm/boards/karo-tx53/board.c
+++ b/arch/arm/boards/karo-tx53/board.c
@@ -235,12 +235,12 @@ static int tx53_part_init(void)
const char *envdev;
 
switch (imx_bootsource()) {
-   case bootsource_mmc:
+   case BOOTSOURCE_MMC:
devfs_add_partition("disk0", 0x0, SZ_512K, 
DEVFS_PARTITION_FIXED, "self0");
devfs_add_partition("disk0", SZ_512K, SZ_1M, 
DEVFS_PARTITION_FIXED, "env0");
envdev = "MMC";
break;
-   case bootsource_nand:
+   case BOOTSOURCE_NAND:
default:
devfs_add_partition("nand0", 0x0, 0x8, 
DEVFS_PARTITION_FIXED, "self_raw");
dev_add_bb_dev("self_raw", "self0");
diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index 5e9c0fd..af31414 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -296,7 +296,7 @@ static int pcm038_devices_init(void)
imx27_add_fec(&fec_info);
 
switch (imx_bootsource()) {
-   case bootsource_nand:
+   case BOOTSOURCE_NAND:
devfs_add_partition("nand0", 0x0, 0x8,
DEVFS_PARTITION_FIXED, "self_raw");
dev_add_bb_dev("self_raw", "self0");
diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c
index 8c7f8ee..4c43487 100644
--- a/arch/arm/mach-imx/boot.c
+++ b/arch/arm/mach-imx/boot.c
@@ -20,15 +20,15 @@
 #include 
 
 static const char *bootsource_str[] = {
-   [bootsource_unknown] = "unknown",
-   [bootsource_nand] = "nand",
-   [bootsource_nor] = "nor",
-   [bootsource_mmc] = "mmc",
-   [bootsource_i2c] = "i2c",
-   [bootsource_spi] = "spi",
-   [bootsource_serial] = "serial",
-   [bootsource_onenand] = "onenand",
-   [bootsource_hd] = "harddisk",
+   [BOOTSOURCE_UNKNOWN] = "unknown",
+   [BOOTSOURCE_NAND] = "nand",
+   [BOOTSOURCE_NOR] = "nor",
+   [BOOTSOURCE_MMC] = "mmc",
+   [BOOTSOURCE_I2C] = "i2c",
+   [BOOTSOURCE_SPI] = "spi",
+   [BOOTSOURCE_SERIAL] = "serial",
+   [BOOTSOURCE_ONENAND] = "onenand",
+   [BOOTSOURCE_HD] = "harddisk",
 };
 
 static enum imx_bootsource bootsource;
@@ -36,7 +36,7 @@ static enum imx_bootsource bootsource;
 void imx_set_bootsource(enum imx_bootsource src)
 {
if (src >= ARRAY_SIZE(bootsource_str))
-   src = bootsource_unknown;
+   src = BOOTSOURCE_UNKNOWN;
 
bootsource = src;
 
@@ -54,25 +54,25 @@ BAREBOX_MAGICVAR(barebox_loc, "The source barebox has been 
booted from");
 /* [CTRL][TYPE] */
 static const enum imx_bootsource locations[4][4] = {
{ /* CTRL = WEIM */
-   bootsource_nor,
-   bootsource_unknown,
-   bootsource_onenand,
-   bootsource_unknown,
+   BOOTSOURCE_NOR,
+   BOOTSOURCE_UNKNOWN,
+   BOOTSOURCE_ONENAND,
+   BOOTSOURCE_UNKNOWN,
}, { /* CTRL == NAND */
-   bootsource_nand,
-   bootsource_nand,
-   bootsource_nand,
-   bootsource_nand,
+   BOOTSOURCE_NAND,
+   BOOTSOURCE_NAND,
+   BOOTSOURCE_NAND,
+   BOOTSOURCE_NAND,
}, { /* CTRL == ATA, (imx35 only) */
-   bootsource_unknown,
-   bootsource_unknown, /* might be p-ata */
-   bootsource_unknown,
-   bootsource_unknown,
+   BOOTSOURCE_UNKNOWN,
+   BOOTSOURCE_UNKNOWN, /* might be p-ata */
+   BOOTSOURCE_UNKNOWN,
+   BOOTSOURCE_UNKNOWN,
}, { /* CTRL == expansion */
-   bootsource_mmc, /* note imx25 could also be: movinand, ce-ata */
-   bootsource

[PATCH 03/10] ARM i.MX bootsource: imx_25_35_boot_save_loc: remove leftover do-nothing code

2013-03-14 Thread Marc Kleine-Budde
This patch removes some code leftover from:
a029e32 ARM i.MX: rework bootsource setting
which is now a no-op.

Signed-off-by: Marc Kleine-Budde 
---
 arch/arm/mach-imx/boot.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c
index 068fa22..37f1180 100644
--- a/arch/arm/mach-imx/boot.c
+++ b/arch/arm/mach-imx/boot.c
@@ -96,16 +96,11 @@ static const enum imx_bootsource locations[4][4] = {
  */
 void imx_25_35_boot_save_loc(unsigned int ctrl, unsigned int type)
 {
-   const char *bareboxloc = NULL;
enum imx_bootsource src;
 
src = locations[ctrl][type];
 
imx_set_bootsource(src);
-   if (bareboxloc) {
-   setenv("barebox_loc", bareboxloc);
-   export("barebox_loc");
-   }
 }
 
 #define IMX27_SYSCTRL_GPCR 0x18
-- 
1.8.2.rc2


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


[PATCH 02/10] ARM i.MX bootsource: convert all imx*_boot_save_loc functions to void

2013-03-14 Thread Marc Kleine-Budde
This function gives all functions a common, i.e. void, return value.

Signed-off-by: Marc Kleine-Budde 
---
 arch/arm/mach-imx/boot.c | 18 ++
 arch/arm/mach-imx/include/mach/generic.h |  8 
 2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c
index 4c43487..068fa22 100644
--- a/arch/arm/mach-imx/boot.c
+++ b/arch/arm/mach-imx/boot.c
@@ -94,7 +94,7 @@ static const enum imx_bootsource locations[4][4] = {
  * Note also that I suspect that the boot source pins are only sampled at
  * power up.
  */
-int imx_25_35_boot_save_loc(unsigned int ctrl, unsigned int type)
+void imx_25_35_boot_save_loc(unsigned int ctrl, unsigned int type)
 {
const char *bareboxloc = NULL;
enum imx_bootsource src;
@@ -106,8 +106,6 @@ int imx_25_35_boot_save_loc(unsigned int ctrl, unsigned int 
type)
setenv("barebox_loc", bareboxloc);
export("barebox_loc");
}
-
-   return 0;
 }
 
 #define IMX27_SYSCTRL_GPCR 0x18
@@ -153,7 +151,7 @@ void imx_27_boot_save_loc(void __iomem *sysctrl_base)
 #define IMX51_SBMR_BT_MEM_CTL_SHIFT0
 #define IMX51_SBMR_BMOD_SHIFT  14
 
-int imx51_boot_save_loc(void __iomem *src_base)
+void imx51_boot_save_loc(void __iomem *src_base)
 {
enum imx_bootsource src = BOOTSOURCE_UNKNOWN;
uint32_t reg;
@@ -181,12 +179,10 @@ int imx51_boot_save_loc(void __iomem *src_base)
}
 
imx_set_bootsource(src);
-
-   return 0;
 }
 
 #define IMX53_SRC_SBMR 0x4
-int imx53_boot_save_loc(void __iomem *src_base)
+void imx53_boot_save_loc(void __iomem *src_base)
 {
enum imx_bootsource src = BOOTSOURCE_UNKNOWN;
uint32_t cfg1 = readl(src_base + IMX53_SRC_SBMR) & 0xff;
@@ -215,14 +211,12 @@ int imx53_boot_save_loc(void __iomem *src_base)
src = BOOTSOURCE_NAND;
 
imx_set_bootsource(src);
-
-   return 0;
 }
 
 #define IMX6_SRC_SBMR1 0x04
 #define IMX6_SRC_SBMR2 0x1c
 
-int imx6_boot_save_loc(void __iomem *src_base)
+void imx6_boot_save_loc(void __iomem *src_base)
 {
enum imx_bootsource src = BOOTSOURCE_UNKNOWN;
uint32_t sbmr2 = readl(src_base + IMX6_SRC_SBMR2) >> 24;
@@ -245,7 +239,7 @@ int imx6_boot_save_loc(void __iomem *src_base)
 
imx_set_bootsource(src);
 
-   return 0;
+   return;
 
 internal_boot:
 
@@ -276,5 +270,5 @@ internal_boot:
 
imx_set_bootsource(src);
 
-   return 0;
+   return;
 }
diff --git a/arch/arm/mach-imx/include/mach/generic.h 
b/arch/arm/mach-imx/include/mach/generic.h
index a271b5b..e6edb94 100644
--- a/arch/arm/mach-imx/include/mach/generic.h
+++ b/arch/arm/mach-imx/include/mach/generic.h
@@ -16,11 +16,11 @@ enum imx_bootsource {
 enum imx_bootsource imx_bootsource(void);
 void imx_set_bootsource(enum imx_bootsource src);
 
-int imx_25_35_boot_save_loc(unsigned int ctrl, unsigned int type);
+void imx_25_35_boot_save_loc(unsigned int ctrl, unsigned int type);
 void imx_27_boot_save_loc(void __iomem *sysctrl_base);
-int imx51_boot_save_loc(void __iomem *src_base);
-int imx53_boot_save_loc(void __iomem *src_base);
-int imx6_boot_save_loc(void __iomem *src_base);
+void imx51_boot_save_loc(void __iomem *src_base);
+void imx53_boot_save_loc(void __iomem *src_base);
+void imx6_boot_save_loc(void __iomem *src_base);
 
 /* There's a off-by-one betweem the gpio bank number and the gpiochip */
 /* range e.g. GPIO_1_5 is gpio 5 under linux */
-- 
1.8.2.rc2


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


[PATCH 00/10] make bootsource an arch independent framework

2013-03-14 Thread Marc Kleine-Budde
Hello,

this series first cleans up the i.mx specific bootsource code. Then the arch
independent code is moved into a seperate file, creating an arch independent
framework. The last patch adds bootsource detection for the i.mx28.

regards,

Marc


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


[PATCH 1/2] serial: fix flush in auart and stm driver

2013-03-14 Thread Marc Kleine-Budde
Hello,

this series fixes problems in the auart and stm serial driver.

regards,
Marc


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


[PATCH 2/2] driver/serial: stm-serial: fix flush

2013-03-14 Thread Marc Kleine-Budde
Wait until fifo is empty, not until fifo is not full.

Signed-off-by: Marc Kleine-Budde 
---
 drivers/serial/stm-serial.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/serial/stm-serial.c b/drivers/serial/stm-serial.c
index 3968892..e1276bd 100644
--- a/drivers/serial/stm-serial.c
+++ b/drivers/serial/stm-serial.c
@@ -34,6 +34,7 @@
 
 #define UARTDBGDR 0x00
 #define UARTDBGFR 0x18
+# define TXFE (1 << 7)
 # define TXFF (1 << 5)
 # define RXFE (1 << 4)
 #define UARTDBGIBRD 0x24
@@ -92,7 +93,7 @@ static void stm_serial_flush(struct console_device *cdev)
struct stm_priv *priv = container_of(cdev, struct stm_priv, cdev);
 
/* Wait for TX FIFO empty */
-   while (readl(priv->base + UARTDBGFR) & TXFF)
+   while (!(readl(priv->base + UARTDBGFR) & TXFE))
;
 }
 
-- 
1.8.2.rc2


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


[PATCH 1/2] driver/serial: auart: fix flush

2013-03-14 Thread Marc Kleine-Budde
Actually wait until fifo is empty.

Signed-off-by: Marc Kleine-Budde 
---
 drivers/serial/serial_auart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/serial/serial_auart.c b/drivers/serial/serial_auart.c
index fa2e04f..1aebb07 100644
--- a/drivers/serial/serial_auart.c
+++ b/drivers/serial/serial_auart.c
@@ -129,7 +129,7 @@ static void auart_serial_flush(struct console_device *cdev)
struct auart_priv *priv = container_of(cdev, struct auart_priv, cdev);
 
/* Wait for TX FIFO empty */
-   while (readl(priv->base + HW_UARTAPP_STAT) & BM_UARTAPP_STAT_TXFE)
+   while (!(readl(priv->base + HW_UARTAPP_STAT) & BM_UARTAPP_STAT_TXFE))
;
 }
 
-- 
1.8.2.rc2


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


Re[5]: Omap4 DSS clocks

2013-03-14 Thread Alexander Shiyan
> On Thu, 2013-03-14 at 14:46 +0100, Christoph Fritz wrote:
> > On Thu, 2013-03-14 at 14:33 +0100, Sascha Hauer wrote:
> 
> > > I wouldn't expect a bug in the code. This would have been discovered
> > > already.
> > 
> > Register CM_DSS_DSS_CLKCTRL (0x4a009120) reads 0x00070F02 and so the
> > field [17:16] IDLEST reads 0x3 which means "Module is disabled and
> > cannot be accessed". On linux, its 0x2 which means "functional".
> 
> I already asked about this on the TI E2E Community forum
> http://e2e.ti.com/support/omap/f/849/t/251717.aspx but without gaining
> success.
> 
> Overall, isn't it weird that DSS is offline (as indicated by IDLEST)?
> 
> I suppose in ./arch/arm/mach-omap/omap4_clock.c this check:
> 
> /* Check for DSS Clocks */
> while ((__raw_readl(0x4A009100) & 0xF00) != 0xE00)
>   ;
> 
> should get extended to also check for correct IDLEST ...which would
> currently end in an endless loop :)

I revised commands/mem. All correct in the code, so problem is not here.

About DSS: I cannot help you with this CPU, but here is one point from
OMAP4430TRM:
"The main access to all DSS registers is through the L3 interconnect.
The access through the L4_PER interconnect is provided for back software
compatibility."

Maybe it help you.

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


Re: [PATCH 1/1] macb: fix gem_recv circular buffer handling

2013-03-14 Thread Jean-Christophe PLAGNIOL-VILLARD
On 20:13 Wed 13 Mar , Steffen Trumtrar wrote:
> On Wed, Mar 13, 2013 at 04:39:40PM +0100, Jean-Christophe PLAGNIOL-VILLARD 
> wrote:
> > as we use a full buffer no need to check the SOF
> > and reset the rx_tail
> > 
> > fix at the same time the gem detection so we can have the rx_buffer
> > allocated correctly according to the IP
> > 
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
Sascah
> > ---
> >  drivers/net/macb.c |   32 
> >  1 file changed, 16 insertions(+), 16 deletions(-)
> > 
> > diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> > index 0cfad05..2d4e373 100644
> > --- a/drivers/net/macb.c
> > +++ b/drivers/net/macb.c
> > @@ -172,7 +172,6 @@ static void reclaim_rx_buffers(struct macb_device *macb,
> >  static int gem_recv(struct eth_device *edev)
> >  {
> > struct macb_device *macb = edev->priv;
> > -   unsigned int rx_tail = macb->rx_tail;
> > void *buffer;
> > int length;
> > u32 status;
> > @@ -181,20 +180,20 @@ static int gem_recv(struct eth_device *edev)
> >  
> > for (;;) {
> > barrier();
> > -   if (!(macb->rx_ring[rx_tail].addr & MACB_BIT(RX_USED)))
> > +   if (!(macb->rx_ring[macb->rx_tail].addr & MACB_BIT(RX_USED)))
> > return -1;
> >  
> > barrier();
> > -   status = macb->rx_ring[rx_tail].ctrl;
> > +   status = macb->rx_ring[macb->rx_tail].ctrl;
> > length = MACB_BFEXT(RX_FRMLEN, status);
> > -   if (status & MACB_BIT(RX_SOF)) {
> > -   buffer = macb->rx_buffer + macb->rx_buffer_size * 
> > macb->rx_tail;
> > -   net_receive(buffer, length);
> > -   macb->rx_ring[rx_tail].ctrl &= ~MACB_BIT(RX_USED);
> > -   barrier();
> > -   }
> > -   rx_tail++;
> > +   buffer = macb->rx_buffer + macb->rx_buffer_size * macb->rx_tail;
> > +   net_receive(buffer, length);
> > +   macb->rx_ring[macb->rx_tail].addr &= ~MACB_BIT(RX_USED);
> > +   barrier();
> > +
> > macb->rx_tail++;
> > +   if (macb->rx_tail >= macb->rx_ring_size)
> > +   macb->rx_tail = 0;
> > }
> >  
> > return 0;
> > @@ -619,11 +618,6 @@ static int macb_probe(struct device_d *dev)
> >  
> > macb->phy_flags = pdata->phy_flags;
> >  
> > -   macb_init_rx_buffer_size(macb, PKTSIZE);
> > -   macb->rx_buffer = dma_alloc_coherent(macb->rx_buffer_size * 
> > macb->rx_ring_size);
> > -   macb->rx_ring = dma_alloc_coherent(RX_RING_BYTES(macb));
> > -   macb->tx_ring = dma_alloc_coherent(TX_RING_BYTES);
> > -
> > macb->regs = dev_request_mem_region(dev, 0);
> >  
> > /*
> > @@ -638,11 +632,17 @@ static int macb_probe(struct device_d *dev)
> >  
> > clk_enable(macb->pclk);
> >  
> > +   macb->is_gem = read_is_gem(macb);
> > +
> > if (macb_is_gem(macb))
> > edev->recv = gem_recv;
> > else
> > edev->recv = macb_recv;
> > -   macb->is_gem = read_is_gem(macb);
> > +
> > +   macb_init_rx_buffer_size(macb, PKTSIZE);
> > +   macb->rx_buffer = dma_alloc_coherent(macb->rx_buffer_size * 
> > macb->rx_ring_size);
> > +   macb->rx_ring = dma_alloc_coherent(RX_RING_BYTES(macb));
> > +   macb->tx_ring = dma_alloc_coherent(TX_RING_BYTES);
> >  
> > macb_reset_hw(macb);
> > ncfgr = macb_mdc_clk_div(macb);
> 
> I know that the last part is not a very sophisticated patch, but you could at 
> least
> mention that I found the error and/or made part of this patch. Don't just
> pretend that you came up with this all alone.
sorry just did the diff between both tree and forget to add the Report-by
Sasha can you add it while applying?

Best Regards,
J.
> 
> Regards,
> Steffen
> 
> -- 
> 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- |

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


Re: Re[3]: Omap4 DSS clocks

2013-03-14 Thread Christoph Fritz
On Thu, 2013-03-14 at 14:46 +0100, Christoph Fritz wrote:
> On Thu, 2013-03-14 at 14:33 +0100, Sascha Hauer wrote:

> > I wouldn't expect a bug in the code. This would have been discovered
> > already.
> 
> Register CM_DSS_DSS_CLKCTRL (0x4a009120) reads 0x00070F02 and so the
> field [17:16] IDLEST reads 0x3 which means "Module is disabled and
> cannot be accessed". On linux, its 0x2 which means "functional".

I already asked about this on the TI E2E Community forum
http://e2e.ti.com/support/omap/f/849/t/251717.aspx but without gaining
success.

Overall, isn't it weird that DSS is offline (as indicated by IDLEST)?

I suppose in ./arch/arm/mach-omap/omap4_clock.c this check:

/* Check for DSS Clocks */
while ((__raw_readl(0x4A009100) & 0xF00) != 0xE00)
;

should get extended to also check for correct IDLEST ...which would
currently end in an endless loop :)

Thanks
 -- Christoph


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


Re: [PATCH 1/1] splash: fix background color support

2013-03-14 Thread Sascha Hauer
On Tue, Mar 12, 2013 at 08:59:09PM +0100, Jean-Christophe PLAGNIOL-VILLARD 
wrote:
> the fb info is stored in struct screen by fb_open
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 

Applied, thanks

Sascha

> ---
>  commands/splash.c |6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/commands/splash.c b/commands/splash.c
> index 4cc463e..0955c01 100644
> --- a/commands/splash.c
> +++ b/commands/splash.c
> @@ -13,7 +13,6 @@ static int do_splash(int argc, char *argv[])
>   struct screen sc;
>   int ret, opt, fd;
>   char *fbdev = "/dev/fb0";
> - struct fb_info info;
>   char *image_file;
>   int offscreen = 0;
>   u32 bg_color = 0x;
> @@ -21,7 +20,6 @@ static int do_splash(int argc, char *argv[])
>  
>   memset(&s, 0, sizeof(s));
>   memset(&sc, 0, sizeof(sc));
> - memset(&info, 0, sizeof(info));
>  
>   s.x = -1;
>   s.y = -1;
> @@ -61,12 +59,12 @@ static int do_splash(int argc, char *argv[])
>  
>   if (sc.offscreenbuf) {
>   if (do_bg)
> - memset_pixel(&info, sc.offscreenbuf, bg_color,
> + memset_pixel(&sc.info, sc.offscreenbuf, bg_color,
>   sc.s.width * sc.s.height);
>   else
>   memcpy(sc.offscreenbuf, sc.fb, sc.fbsize);
>   } else if (do_bg) {
> - memset_pixel(&info, sc.fb, bg_color, sc.s.width * sc.s.height);
> + memset_pixel(&sc.info, sc.fb, bg_color, sc.s.width * 
> sc.s.height);
>   }
>  
>   if (image_renderer_file(&sc, &s, image_file) < 0)
> -- 
> 1.7.10.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- |

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


Re: Re[3]: Omap4 DSS clocks

2013-03-14 Thread Christoph Fritz
On Thu, 2013-03-14 at 14:33 +0100, Sascha Hauer wrote:
> On Thu, Mar 14, 2013 at 02:23:56PM +0100, Christoph Fritz wrote:
> > On Thu, 2013-03-14 at 17:11 +0400, Alexander Shiyan wrote:
> > > > > On Thu, 2013-03-14 at 16:48 +0400, Alexander Shiyan wrote:
> > > > > > >  Barebox crashes while reading a DSS register:
> > > > > > > 
> > > > > > >   $ md 0x4804
> > > > > > >   unable to handle paging request at address 0x4804
> > > > > > > 
> > > > > > > I suppose this is due to a turned off clock.
> > > > > > > 
> > > > > > > Any hints?
> > > > > > 
> > > > > > Probably this is a bug. I reproduced it.
> > > > > > 
> > > > > > Try to specify start & end address, like:
> > > > > > md -l 0x4804-0x48040010
> > > > > 
> > > > > I get the same effect: it crashes.
> > > > 
> > > > OK. It seems rw_buf not initialized.
> > > > 
> > > > So change line:
> > > > static char *rw_buf; 
> > > > to
> > > > static char *rw_buf[RW_BUF_SIZE]; 
> > > Without asterisk, like:
> > >  static char rw_buf[RW_BUF_SIZE]; 
> > 
> > malloc expects a pointer:
> > commands/mem.c:634: error: incompatible types when assigning to type
> > ‘char[4096]’ from type ‘void *’
> > 
> > As you can see below, for a quick test I commented the lines, but
> > barebox still crashes.
> > 
> > Why don't you suppose that this is due to the non functional DSS?
> 
> I wouldn't expect a bug in the code. This would have been discovered
> already.

Register CM_DSS_DSS_CLKCTRL (0x4a009120) reads 0x00070F02 and so the
field [17:16] IDLEST reads 0x3 which means "Module is disabled and
cannot be accessed". On linux, its 0x2 which means "functional".

Any hints?

Thanks
 -- Christoph



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


Re: Re[3]: Omap4 DSS clocks

2013-03-14 Thread Sascha Hauer
On Thu, Mar 14, 2013 at 02:23:56PM +0100, Christoph Fritz wrote:
> On Thu, 2013-03-14 at 17:11 +0400, Alexander Shiyan wrote:
> > > > On Thu, 2013-03-14 at 16:48 +0400, Alexander Shiyan wrote:
> > > > > >  Barebox crashes while reading a DSS register:
> > > > > > 
> > > > > >   $ md 0x4804
> > > > > >   unable to handle paging request at address 0x4804
> > > > > > 
> > > > > > I suppose this is due to a turned off clock.
> > > > > > 
> > > > > > Any hints?
> > > > > 
> > > > > Probably this is a bug. I reproduced it.
> > > > > 
> > > > > Try to specify start & end address, like:
> > > > > md -l 0x4804-0x48040010
> > > > 
> > > > I get the same effect: it crashes.
> > > 
> > > OK. It seems rw_buf not initialized.
> > > 
> > > So change line:
> > > static char *rw_buf; 
> > > to
> > > static char *rw_buf[RW_BUF_SIZE]; 
> > Without asterisk, like:
> >  static char rw_buf[RW_BUF_SIZE]; 
> 
> malloc expects a pointer:
> commands/mem.c:634: error: incompatible types when assigning to type
> ‘char[4096]’ from type ‘void *’
> 
> As you can see below, for a quick test I commented the lines, but
> barebox still crashes.
> 
> Why don't you suppose that this is due to the non functional DSS?

I wouldn't expect a bug in the code. This would have been discovered
already.

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

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


Re: Re[3]: Omap4 DSS clocks

2013-03-14 Thread Christoph Fritz
On Thu, 2013-03-14 at 17:11 +0400, Alexander Shiyan wrote:
> > > On Thu, 2013-03-14 at 16:48 +0400, Alexander Shiyan wrote:
> > > > >  Barebox crashes while reading a DSS register:
> > > > > 
> > > > >   $ md 0x4804
> > > > >   unable to handle paging request at address 0x4804
> > > > > 
> > > > > I suppose this is due to a turned off clock.
> > > > > 
> > > > > Any hints?
> > > > 
> > > > Probably this is a bug. I reproduced it.
> > > > 
> > > > Try to specify start & end address, like:
> > > > md -l 0x4804-0x48040010
> > > 
> > > I get the same effect: it crashes.
> > 
> > OK. It seems rw_buf not initialized.
> > 
> > So change line:
> > static char *rw_buf; 
> > to
> > static char *rw_buf[RW_BUF_SIZE]; 
> Without asterisk, like:
>  static char rw_buf[RW_BUF_SIZE]; 

malloc expects a pointer:
commands/mem.c:634: error: incompatible types when assigning to type
‘char[4096]’ from type ‘void *’

As you can see below, for a quick test I commented the lines, but
barebox still crashes.

Why don't you suppose that this is due to the non functional DSS?

diff --git a/commands/mem.c b/commands/mem.c
index 51aa04d..af5cc46 100644
--- a/commands/mem.c
+++ b/commands/mem.c
@@ -40,7 +40,7 @@
 #endif
 
 #define RW_BUF_SIZE4096
-static char *rw_buf;
+static char rw_buf[RW_BUF_SIZE];
 
 static char *DEVMEM = "/dev/mem";
 
@@ -631,11 +631,11 @@ static struct driver_d mem_drv = {
 
 static int mem_init(void)
 {
-   rw_buf = malloc(RW_BUF_SIZE);
-   if(!rw_buf) {
-   printf("%s: Out of memory\n", __FUNCTION__);
-   return -1;
-   }
+// rw_buf = malloc(RW_BUF_SIZE);
+// if(!rw_buf) {
+// printf("%s: Out of memory\n", __FUNCTION__);
+// return -1;
+// }
 
add_mem_device("mem", 0, ~0, IORESOURCE_MEM_WRITEABLE);
platform_driver_register(&mem_drv);




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


Re[3]: Omap4 DSS clocks

2013-03-14 Thread Alexander Shiyan
> > On Thu, 2013-03-14 at 16:48 +0400, Alexander Shiyan wrote:
> > > >  Barebox crashes while reading a DSS register:
> > > > 
> > > >   $ md 0x4804
> > > >   unable to handle paging request at address 0x4804
> > > > 
> > > > I suppose this is due to a turned off clock.
> > > > 
> > > > Any hints?
> > > 
> > > Probably this is a bug. I reproduced it.
> > > 
> > > Try to specify start & end address, like:
> > > md -l 0x4804-0x48040010
> > 
> > I get the same effect: it crashes.
> 
> OK. It seems rw_buf not initialized.
> 
> So change line:
> static char *rw_buf; 
> to
> static char *rw_buf[RW_BUF_SIZE]; 
Without asterisk, like:
 static char rw_buf[RW_BUF_SIZE]; 
Sorry.

> in commands/mem.c

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


Re[2]: Omap4 DSS clocks

2013-03-14 Thread Alexander Shiyan
> On Thu, 2013-03-14 at 16:48 +0400, Alexander Shiyan wrote:
> > >  Barebox crashes while reading a DSS register:
> > > 
> > >   $ md 0x4804
> > >   unable to handle paging request at address 0x4804
> > > 
> > > I suppose this is due to a turned off clock.
> > > 
> > > Any hints?
> > 
> > Probably this is a bug. I reproduced it.
> > 
> > Try to specify start & end address, like:
> > md -l 0x4804-0x48040010
> 
> I get the same effect: it crashes.

OK. It seems rw_buf not initialized.

So change line:
static char *rw_buf; 
to
static char *rw_buf[RW_BUF_SIZE]; 
in commands/mem.c

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


Re: Omap4 DSS clocks

2013-03-14 Thread Christoph Fritz
On Thu, 2013-03-14 at 16:48 +0400, Alexander Shiyan wrote:
> >  Barebox crashes while reading a DSS register:
> > 
> >   $ md 0x4804
> >   unable to handle paging request at address 0x4804
> > 
> > I suppose this is due to a turned off clock.
> > 
> > Any hints?
> 
> Probably this is a bug. I reproduced it.
> 
> Try to specify start & end address, like:
> md -l 0x4804-0x48040010

I get the same effect: it crashes.



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


Re: Omap4 DSS clocks

2013-03-14 Thread Alexander Shiyan
> Hi,
> 
>  Barebox crashes while reading a DSS register:
> 
>   $ md 0x4804
>   unable to handle paging request at address 0x4804
> 
> I suppose this is due to a turned off clock.
> 
> Any hints?

Probably this is a bug. I reproduced it.

Try to specify start & end address, like:
md -l 0x4804-0x48040010

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


Omap4 DSS clocks

2013-03-14 Thread Christoph Fritz
Hi,

 Barebox crashes while reading a DSS register:

  $ md 0x4804
  unable to handle paging request at address 0x4804

I suppose this is due to a turned off clock.

Any hints?


Thanks
 -- Christoph


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


[PATCH] ARM: Add CPU detection macros for ARM720

2013-03-14 Thread Alexander Shiyan

Signed-off-by: Alexander Shiyan 
---
 arch/arm/include/asm/system_info.h |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/system_info.h 
b/arch/arm/include/asm/system_info.h
index 56ebb11..13171cc 100644
--- a/arch/arm/include/asm/system_info.h
+++ b/arch/arm/include/asm/system_info.h
@@ -14,6 +14,9 @@
 #define CPU_ARCH_ARMv6 8
 #define CPU_ARCH_ARMv7 9
 
+#define CPU_IS_ARM720  0x41007200
+#define CPU_IS_ARM720_MASK 0xff00fff0
+
 #define CPU_IS_ARM920  0x41009200
 #define CPU_IS_ARM920_MASK 0xff00fff0
 
@@ -55,11 +58,13 @@
 #else
 #define ARM_ARCH CPU_ARCH_ARMv4T
 #endif
+#define cpu_is_arm720()cpu_is_arm(ARM720)
 #define cpu_is_arm920()cpu_is_arm(ARM920)
 #define cpu_is_pxa250() cpu_is_arm(PXA250)
 #define cpu_is_pxa255() cpu_is_arm(PXA255)
 #define cpu_is_pxa270() cpu_is_arm(PXA270)
 #else
+#define cpu_is_arm720() (0)
 #define cpu_is_arm920() (0)
 #define cpu_is_pxa250() (0)
 #define cpu_is_pxa255() (0)
-- 
1.7.3.4


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


[PATCH 2/2] arm: ccmx51: Using imx51_add_usbotg() function for register USB

2013-03-14 Thread Alexander Shiyan

Signed-off-by: Alexander Shiyan 
---
 arch/arm/boards/ccxmx51/ccxmx51.c |   51 +++-
 1 files changed, 5 insertions(+), 46 deletions(-)

diff --git a/arch/arm/boards/ccxmx51/ccxmx51.c 
b/arch/arm/boards/ccxmx51/ccxmx51.c
index b1c579b..8230f55 100644
--- a/arch/arm/boards/ccxmx51/ccxmx51.c
+++ b/arch/arm/boards/ccxmx51/ccxmx51.c
@@ -195,51 +195,10 @@ static const struct spi_board_info 
ccxmx51_spi_board_info[] = {
},
 };
 
-static void ccxmx51_otghost_init(void)
-{
-#define MX51_USBOTHER_REGS_OFFSET  0x800
-#define MX51_USBCTRL_OFFSET0x0
-#define MX51_USB_PHY_CTR_FUNC_OFFSET   0x8
-#define MX51_USB_PHY_CTR_FUNC2_OFFSET  0xc
-#define MX51_USB_UTMI_PHYCTRL1_PLLDIV_MASK 0x3
-#define MX51_USB_PLL_DIV_19_2_MHZ  0x00
-#define MX51_USB_PLL_DIV_24_MHZ0x01
-#define MX51_USB_PLL_DIV_26_MHZ0x02
-#define MX51_USB_PLL_DIV_27_MHZ0x03
-#define MX51_OTG_PHYCTRL_OC_DIS_BIT(1 << 8)
-#define MX51_OTG_UCTRL_OWIE_BIT(1 << 27)
-#define MX51_OTG_UCTRL_OPM_BIT (1 << 24)
-
-#define USBOTHER_BASE  (MX51_OTG_BASE_ADDR + 
MX51_USBOTHER_REGS_OFFSET)
-
-   u32 reg;
-
-   /* Set sysclock to 24 MHz */
-   reg = readl(USBOTHER_BASE + MX51_USB_PHY_CTR_FUNC2_OFFSET);
-   reg &= ~MX51_USB_UTMI_PHYCTRL1_PLLDIV_MASK;
-   reg |= MX51_USB_PLL_DIV_24_MHZ;
-   writel(reg, USBOTHER_BASE + MX51_USB_PHY_CTR_FUNC2_OFFSET);
-
-   /* OC is not used */
-   reg = readl(USBOTHER_BASE + MX51_USB_PHY_CTR_FUNC_OFFSET);
-   reg |= MX51_OTG_PHYCTRL_OC_DIS_BIT;
-   writel(reg, USBOTHER_BASE + MX51_USB_PHY_CTR_FUNC_OFFSET);
-
-   /* Power pins enable */
-   reg = readl(USBOTHER_BASE + MX51_USBCTRL_OFFSET);
-   reg |= MX51_OTG_UCTRL_OWIE_BIT | MX51_OTG_UCTRL_OPM_BIT;
-   writel(reg, USBOTHER_BASE + MX51_USBCTRL_OFFSET);
-
-   /* Setup PORTSC */
-   reg = readl(MX51_OTG_BASE_ADDR + 0x184);
-   reg &= ~(3 << 30);
-   reg |= 1 << 28;
-   writel(reg, MX51_OTG_BASE_ADDR + 0x184);
-
-   mdelay(10);
-
-   add_generic_usb_ehci_device(0, MX51_OTG_BASE_ADDR, NULL);
-}
+static struct imxusb_platformdata ccxmx51_otg_pdata = {
+   .flags  = MXC_EHCI_MODE_UTMI_16_BIT | MXC_EHCI_POWER_PINS_ENABLED,
+   .mode   = IMX_USB_MODE_HOST,
+};
 
 static int ccxmx51_power_init(void)
 {
@@ -453,7 +412,7 @@ static int ccxmx51_devices_init(void)
add_generic_device("smc911x", 1, NULL, MX51_CS5_BASE_ADDR, 
SZ_4K, IORESOURCE_MEM, NULL);
}
 
-   ccxmx51_otghost_init();
+   imx51_add_usbotg(&ccxmx51_otg_pdata);
 
armlinux_set_bootparams((void *)(MX51_CSD0_BASE_ADDR + 0x100));
 
-- 
1.7.3.4


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


[PATCH 1/2] ARM: ccmx51: Migrate to defaultenv-2

2013-03-14 Thread Alexander Shiyan

Signed-off-by: Alexander Shiyan 
---
 arch/arm/boards/ccxmx51/env/boot/nand  |9 ++
 arch/arm/boards/ccxmx51/env/config |   37 
 arch/arm/boards/ccxmx51/env/config-board   |   12 
 arch/arm/boards/ccxmx51/env/init/mtdparts-nand |   11 +++
 arch/arm/configs/ccmx51_defconfig  |9 --
 5 files changed, 38 insertions(+), 40 deletions(-)
 create mode 100644 arch/arm/boards/ccxmx51/env/boot/nand
 delete mode 100644 arch/arm/boards/ccxmx51/env/config
 create mode 100644 arch/arm/boards/ccxmx51/env/config-board
 create mode 100644 arch/arm/boards/ccxmx51/env/init/mtdparts-nand

diff --git a/arch/arm/boards/ccxmx51/env/boot/nand 
b/arch/arm/boards/ccxmx51/env/boot/nand
new file mode 100644
index 000..bb11465
--- /dev/null
+++ b/arch/arm/boards/ccxmx51/env/boot/nand
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+   boot-menu-add-entry "$0" "NAND Flash"
+   exit
+fi
+
+global.bootm.image="/dev/kernel"
+global.linux.bootargs.dyn.root="root=/dev/mtdblock3 ro"
diff --git a/arch/arm/boards/ccxmx51/env/config 
b/arch/arm/boards/ccxmx51/env/config
deleted file mode 100644
index bbd43e7..000
--- a/arch/arm/boards/ccxmx51/env/config
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-machine=ccmx51
-
-# use 'dhcp' to do dhcp in barebox and in kernel
-# use 'none' if you want to skip kernel ip autoconfiguration
-ip=none
-
-# or set your networking parameters here
-#eth0.ipaddr=a.b.c.d
-#eth0.netmask=a.b.c.d
-#eth0.gateway=a.b.c.d
-#eth0.serverip=a.b.c.d
-
-# can be either 'nfs', 'tftp' or 'nand'
-kernel_loc=nand
-# can be either 'net', 'nand' or 'initrd'
-rootfs_loc=nand
-
-# rootfs
-rootfs_type=cramfs
-
-# kernel
-kernelimage_type=zimage
-kernel_img=/dev/nand0.kernel
-
-autoboot_timeout=3
-
-bootargs="console=ttymxc0,115200"
-
-device_type="nand"
-nand_device="mxc_nand"
-nand_parts="512k(barebox)ro,256k(bareboxenv),3328k(kernel),-(root)"
-rootfs_mtdblock_nand=3
-
-# set a fancy prompt (if support is compiled in)
-PS1="\e[1;32mbarebox@\e[1;31m\h:\w\e[0m "
diff --git a/arch/arm/boards/ccxmx51/env/config-board 
b/arch/arm/boards/ccxmx51/env/config-board
new file mode 100644
index 000..26acb4b
--- /dev/null
+++ b/arch/arm/boards/ccxmx51/env/config-board
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+global.hostname=ccmx51
+
+# Timeout in seconds before the default boot entry is started
+global.autoboot_timeout=2
+
+# Default boot entry (one of /env/boot/*)
+global.boot.default=nand
+
+# Board bootargs
+global.linux.bootargs.base="earlyprintk console=ttymxc0,115200n8"
diff --git a/arch/arm/boards/ccxmx51/env/init/mtdparts-nand 
b/arch/arm/boards/ccxmx51/env/init/mtdparts-nand
new file mode 100644
index 000..a4315cd
--- /dev/null
+++ b/arch/arm/boards/ccxmx51/env/init/mtdparts-nand
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+   init-menu-add-entry "$0" "NAND partitions"
+   exit
+fi
+
+mtdparts="512k(barebox)ro,256k(bareboxenv),3328k(kernel),-(root)"
+kernelname="mxc_nand"
+
+mtdparts-add -b -d nand0 -k ${kernelname} -p ${mtdparts}
diff --git a/arch/arm/configs/ccmx51_defconfig 
b/arch/arm/configs/ccmx51_defconfig
index 67d1dd2..b406686 100644
--- a/arch/arm/configs/ccmx51_defconfig
+++ b/arch/arm/configs/ccmx51_defconfig
@@ -7,13 +7,12 @@ CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
 CONFIG_MMU=y
 CONFIG_MALLOC_SIZE=0x200
 CONFIG_LONGHELP=y
-CONFIG_GLOB=y
 CONFIG_HUSH_FANCY_PROMPT=y
 CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_DEFAULT_ENVIRONMENT_COMPRESSED_LZO=y
-CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="defaultenv arch/arm/boards/ccxmx51/env"
+CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
+CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/ccxmx51/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
@@ -22,11 +21,15 @@ CONFIG_CMD_PRINTENV=y
 CONFIG_CMD_READLINE=y
 CONFIG_CMD_ECHO_E=y
 CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_CRC=y
+CONFIG_CMD_CRC_CMP=y
 CONFIG_CMD_FLASH=y
 CONFIG_CMD_BOOTM_SHOW_TYPE=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_RESET=y
 CONFIG_CMD_GO=y
+CONFIG_CMD_OFTREE=y
+CONFIG_CMD_OFTREE_PROBE=y
 CONFIG_CMD_NANDTEST=y
 CONFIG_CMD_MTEST=y
 CONFIG_CMD_TIMEOUT=y
-- 
1.7.3.4


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


Re: [PATCH 4/5] gadget: possible null pointer dereference fix

2013-03-14 Thread Sascha Hauer
On Thu, Mar 14, 2013 at 11:01:31AM +0100, Cerrato Renaud wrote:
> For some reasons relative to my company , I'm not able to send emails 
> using git-send-email. I gave up.

What a pitty.

I know getting the tools right for sending patches can be quite a high
barrier sometimes. Most other Open Source projects will require the same
if you want to participate, so I think it's really worth it to set this
up, if it's not for barebox then it might be for the Kernel or whatever
project you might be interested in.

Most other people in your situation setup a Gmail account and end up
sending mails from home if necessary until they can put enough pressure
on their administrators.

Sorry, I don't like loosing useful contributions, but on the other hand
our workflow depends on being able to review and apply patches quickly.

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

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


Re: [PATCH 4/5] gadget: possible null pointer dereference fix

2013-03-14 Thread Cerrato Renaud
For some reasons relative to my company , I'm not able to send emails 
using git-send-email. I gave up.
Thanks.

On jeudi 14 mars 2013 08:35:41, Sascha Hauer wrote:
> On Wed, Mar 13, 2013 at 02:44:39PM +0100, Cerrato Renaud wrote:
>> This patch fix a possible null pointer dereference exception because of a 
>> missing null check on cdev->config
>>
>> Signed-off-by: Cerrato Renaud 
>> ---
>>  drivers/usb/gadget/composite.c |   23 +--
>>  1 files changed, 13 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
>> index 9af115e..1f6c5b2 100644
>> --- a/drivers/usb/gadget/composite.c
>> +++ b/drivers/usb/gadget/composite.c
>> @@ -777,18 +777,21 @@ unknown:
>>   * recipients (endpoint, other, WUSB, ...) to the current
>>   * configuration code.
>>   */
>> -f = cdev->config->interface[intf];
>> -if (f && f->setup)
>> -value = f->setup(f, ctrl);
>> -else
>> -f = NULL;
>> +if(cdev->config) {
>
> please do a:
>
>   if (!cdev->config)
>   goto out;
>
> instead.
>
> Your patch is whitespace damaged, I won't be able to apply it.
> As Jean-Christophe mentioned, you should use git-send-mail for sending
> your patches. It does things just right.
>
> Sascha
>




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


Re: [RFC PATCH 1/2] AM33XX: Move muxing defines to header file

2013-03-14 Thread Jan Lübbe
On Thu, 2013-03-14 at 08:30 +0100, Sascha Hauer wrote:
> Hi Teresa,
> 
> On Tue, Mar 12, 2013 at 03:04:12PM +0100, Teresa Gámez wrote:
> > The muxing in the am33xx_mux.c file is not generic as the muxing
> > setup does not fit for every board. Move the structs and functions
> > to the mach/am33xx-mux.h so board dependend mux setups can be
> > created.
> > 
> > Signed-off-by: Teresa Gámez 
> 
> Looks good to me. Jan is more familiar with the am33xx. Jan,
> could you have a look on it?

I haven't tested it, but the approach seems good. When adding a new
board, I would probably have done the same.

The current PinMux is still a bit BeagleBone-specific, but that should
be fixed in a separate patch. (Or instead write a pinctrl-single driver
and configure PinMux via DT).

Regards,
Jan
-- 
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- |


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


[PATCH] ARM i.MX ESDCTL: Fix default enabled esdctl v2 controller

2013-03-14 Thread Sascha Hauer
On some i.MX SoCs the SDRAM controller has chipselect 2 enabled
by reset default. This confuses our SDRAM size detection. We
already have a fix for this in place. This patch adds the fix
for i.MX35 which needs it aswell. Also since we now detect the
SDRAM size in the SoC specific entry functions we have to apply
the fixup there, too.

Signed-off-by: Sascha Hauer 
---
 arch/arm/mach-imx/esdctl.c | 43 ---
 1 file changed, 28 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c
index cc2bdc1..cb57d45 100644
--- a/arch/arm/mach-imx/esdctl.c
+++ b/arch/arm/mach-imx/esdctl.c
@@ -173,6 +173,26 @@ static void add_mem(unsigned long base0, unsigned long 
size0,
arm_add_mem_device(size0 ? "ram1" : "ram0", base1, size1);
 }
 
+/*
+ * On i.MX27, i.MX31 and i.MX35 the second chipselect is enabled by reset 
default.
+ * This setting makes it impossible to detect the correct SDRAM size on
+ * these SoCs. We disable the chipselect if this reset default setting is
+ * found. This of course leads to incorrect SDRAM detection on boards which
+ * really have this reset default as a valid setting. If you have such a
+ * board drop a mail to search for a solution.
+ */
+#define ESDCTL1_RESET_DEFAULT 0x81120080
+
+static inline void imx_esdctl_v2_disable_default(void *esdctlbase)
+{
+   u32 ctlval = readl(esdctlbase + IMX_ESDCTL1);
+
+   if (ctlval == ESDCTL1_RESET_DEFAULT) {
+   ctlval &= ~(1 << 31);
+   writel(ctlval, esdctlbase + IMX_ESDCTL1);
+   }
+}
+
 static void imx_esdctl_v1_add_mem(void *esdctlbase, struct imx_esdctl_data 
*data)
 {
add_mem(data->base0, imx_v1_sdram_size(esdctlbase, 0),
@@ -185,22 +205,9 @@ static void imx_esdctl_v2_add_mem(void *esdctlbase, struct 
imx_esdctl_data *data
data->base1, imx_v2_sdram_size(esdctlbase, 1));
 }
 
-/*
- * On i.MX27 and i.MX31 the second chipselect is enabled by reset default.
- * This setting makes it impossible to detect the correct SDRAM size on
- * these SoCs. We disable the chipselect if this reset default setting is
- * found. This of course leads to incorrect SDRAM detection on boards which
- * really have this reset default as a valid setting. If you have such a
- * board drop a mail to search for a solution.
- */
-#define ESDCTL1_RESET_DEFAULT 0x81120080
-
 static void imx_esdctl_v2_bug_add_mem(void *esdctlbase, struct imx_esdctl_data 
*data)
 {
-   u32 ctlval = readl(esdctlbase + IMX_ESDCTL1);
-
-   if (ctlval == ESDCTL1_RESET_DEFAULT)
-   writel(0x0, esdctlbase + IMX_ESDCTL1);
+   imx_esdctl_v2_disable_default(esdctlbase);
 
add_mem(data->base0, imx_v2_sdram_size(esdctlbase, 0),
data->base1, imx_v2_sdram_size(esdctlbase, 1));
@@ -264,7 +271,7 @@ static __maybe_unused struct imx_esdctl_data imx31_data = {
 static __maybe_unused struct imx_esdctl_data imx35_data = {
.base0 = MX35_CSD0_BASE_ADDR,
.base1 = MX35_CSD1_BASE_ADDR,
-   .add_mem = imx_esdctl_v2_add_mem,
+   .add_mem = imx_esdctl_v2_bug_add_mem,
 };
 
 static __maybe_unused struct imx_esdctl_data imx51_data = {
@@ -383,6 +390,8 @@ void __naked __noreturn imx27_barebox_entry(uint32_t 
boarddata)
unsigned long base;
unsigned long size;
 
+   imx_esdctl_v2_disable_default((void *)MX27_ESDCTL_BASE_ADDR);
+
base = MX27_CSD0_BASE_ADDR;
 
size = imx_v2_sdram_size((void *)MX27_ESDCTL_BASE_ADDR, 0);
@@ -397,6 +406,8 @@ void __naked __noreturn imx31_barebox_entry(uint32_t 
boarddata)
unsigned long base;
unsigned long size;
 
+   imx_esdctl_v2_disable_default((void *)MX31_ESDCTL_BASE_ADDR);
+
base = MX31_CSD0_BASE_ADDR;
 
size = imx_v2_sdram_size((void *)MX31_ESDCTL_BASE_ADDR, 0);
@@ -411,6 +422,8 @@ void __naked __noreturn imx35_barebox_entry(uint32_t 
boarddata)
unsigned long base;
unsigned long size;
 
+   imx_esdctl_v2_disable_default((void *)MX35_ESDCTL_BASE_ADDR);
+
base = MX35_CSD0_BASE_ADDR;
 
size = imx_v2_sdram_size((void *)MX35_ESDCTL_BASE_ADDR, 0);
-- 
1.8.2.rc2


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


Re: [PATCH 6/9] omap4_romusb: allow adding usb-serial when not booting from usb

2013-03-14 Thread Sascha Hauer
Hi Vicente,

On Sun, Mar 10, 2013 at 12:19:39AM +0100, Vicente Bergas wrote:
> 
> Signed-off-by: Vicente Bergas 
> ---
>  arch/arm/mach-omap/include/mach/omap4_rom_usb.h |  3 +++
>  arch/arm/mach-omap/omap4_rom_usb.c  | 23 +++
>  drivers/serial/serial_omap4_usbboot.c   |  2 ++
>  3 files changed, 16 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/serial/serial_omap4_usbboot.c 
> b/drivers/serial/serial_omap4_usbboot.c
> index f0a2fd1..ee5b19a 100644
> --- a/drivers/serial/serial_omap4_usbboot.c
> +++ b/drivers/serial/serial_omap4_usbboot.c
> @@ -78,6 +78,8 @@ static struct driver_d serial_omap4_usbboot_driver = {
>  
>  static int serial_omap4_usbboot_init(void)
>  {
> + if (!omap4_usbboot_ready())
> + return 0;
>   return platform_driver_register(&serial_omap4_usbboot_driver);
>  }
>  console_initcall(serial_omap4_usbboot_init);

Here you register the driver only when usb boot is ready. It would be
better your register the device only when usb boot is ready. Are you
fine with this? Could you send a follow up 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- |

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


Re: [PATCH 1/5] at91: debug unit typo fix

2013-03-14 Thread Sascha Hauer
On Wed, Mar 13, 2013 at 02:39:35PM +0100, Cerrato Renaud wrote:
> This patch fix the debug unit output by correcting a typo into an #ifdef 
> statement.
> 
> Signed-off-by: Cerrato Renaud 
> ---
>  arch/arm/mach-at91/include/mach/debug_ll.h |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

This one is ok, but unfortunately also whitespace damaged.

Sascha

> 
> diff --git a/arch/arm/mach-at91/include/mach/debug_ll.h 
> b/arch/arm/mach-at91/include/mach/debug_ll.h
> index 1a85ae4..42728a4 100644
> --- a/arch/arm/mach-at91/include/mach/debug_ll.h
> +++ b/arch/arm/mach-at91/include/mach/debug_ll.h
> @@ -11,7 +11,7 @@
>  #include 
>  #include 
>  
> -#ifdef COFNIG_HAVE_AT91_DBGU0
> +#ifdef CONFIG_HAVE_AT91_DBGU0
>  #define UART_BASEAT91_BASE_DBGU0
>  #else
>  #define UART_BASEAT91_BASE_DBGU1
> -- 
> 1.7.2.5
> 
> 
> ___
> 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- |

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


Re: [PATCH 4/5] gadget: possible null pointer dereference fix

2013-03-14 Thread Sascha Hauer
On Wed, Mar 13, 2013 at 02:44:39PM +0100, Cerrato Renaud wrote:
> This patch fix a possible null pointer dereference exception because of a 
> missing null check on cdev->config
> 
> Signed-off-by: Cerrato Renaud 
> ---
>  drivers/usb/gadget/composite.c |   23 +--
>  1 files changed, 13 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> index 9af115e..1f6c5b2 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -777,18 +777,21 @@ unknown:
>   * recipients (endpoint, other, WUSB, ...) to the current
>   * configuration code.
>   */
> -f = cdev->config->interface[intf];
> -if (f && f->setup)
> -value = f->setup(f, ctrl);
> -else
> -f = NULL;
> +if(cdev->config) {

please do a:

if (!cdev->config)
goto out;

instead.

Your patch is whitespace damaged, I won't be able to apply it.
As Jean-Christophe mentioned, you should use git-send-mail for sending
your patches. It does things just right.

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

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


Re: [RFC PATCH 1/2] AM33XX: Move muxing defines to header file

2013-03-14 Thread Sascha Hauer
Hi Teresa,

On Tue, Mar 12, 2013 at 03:04:12PM +0100, Teresa Gámez wrote:
> The muxing in the am33xx_mux.c file is not generic as the muxing
> setup does not fit for every board. Move the structs and functions
> to the mach/am33xx-mux.h so board dependend mux setups can be
> created.
> 
> Signed-off-by: Teresa Gámez 

Looks good to me. Jan is more familiar with the am33xx. Jan,
could you have a look on it?

Sascha

> ---
>  arch/arm/boards/beaglebone/board.c   |4 +-
>  arch/arm/boards/beaglebone/lowlevel.c|2 +-
>  arch/arm/boards/pcm051/board.c   |2 +-
>  arch/arm/mach-omap/am33xx_mux.c  |  246 
> +-
>  arch/arm/mach-omap/include/mach/am33xx-mux.h |  246 
> +-
>  5 files changed, 252 insertions(+), 248 deletions(-)
> 
> diff --git a/arch/arm/boards/beaglebone/board.c 
> b/arch/arm/boards/beaglebone/board.c
> index e4b8b0a..70c6070 100644
> --- a/arch/arm/boards/beaglebone/board.c
> +++ b/arch/arm/boards/beaglebone/board.c
> @@ -95,7 +95,7 @@ static void beaglebone_eth_init(void)
>  
>   writel(0, AM33XX_MAC_MII_SEL);
>  
> - enable_mii1_pin_mux();
> + am33xx_enable_mii1_pin_mux();
>  
>   am33xx_add_cpsw(&cpsw_data);
>  }
> @@ -104,7 +104,7 @@ static int beaglebone_devices_init(void)
>  {
>   am33xx_add_mmc0(NULL);
>  
> - enable_i2c0_pin_mux();
> + am33xx_enable_i2c0_pin_mux();
>   beaglebone_eth_init();
>  
>   armlinux_set_bootparams((void *)0x8100);
> diff --git a/arch/arm/boards/beaglebone/lowlevel.c 
> b/arch/arm/boards/beaglebone/lowlevel.c
> index 76ac90b..a9737d9 100644
> --- a/arch/arm/boards/beaglebone/lowlevel.c
> +++ b/arch/arm/boards/beaglebone/lowlevel.c
> @@ -243,7 +243,7 @@ static int beaglebone_board_init(void)
>   beaglebone_sram_init();
>  
>   /* Enable pin mux */
> - enable_uart0_pin_mux();
> + am33xx_enable_uart0_pin_mux();
>  
>   return 0;
>  }
> diff --git a/arch/arm/boards/pcm051/board.c b/arch/arm/boards/pcm051/board.c
> index 9739a2c..a38d844 100644
> --- a/arch/arm/boards/pcm051/board.c
> +++ b/arch/arm/boards/pcm051/board.c
> @@ -52,7 +52,7 @@ mem_initcall(pcm051_mem_init);
>  
>  static int pcm051_devices_init(void)
>  {
> - enable_mmc0_pin_mux();
> + am33xx_enable_mmc0_pin_mux();
>  
>   am33xx_add_mmc0(NULL);
>  
> diff --git a/arch/arm/mach-omap/am33xx_mux.c b/arch/arm/mach-omap/am33xx_mux.c
> index 3d7f245..36fe379 100644
> --- a/arch/arm/mach-omap/am33xx_mux.c
> +++ b/arch/arm/mach-omap/am33xx_mux.c
> @@ -15,242 +15,12 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  
>  #define MUX_CFG(value, offset)   \
>   __raw_writel(value, (AM33XX_CTRL_BASE + offset));
>  
> -/* PAD Control Fields */
> -#define SLEWCTRL (0x1 << 6)
> -#define  RXACTIVE(0x1 << 5)
> -#define  PULLUP_EN   (0x1 << 4) /* Pull UP Selection */
> -#define PULLUDEN (0x0 << 3) /* Pull up enabled */
> -#define PULLUDDIS(0x1 << 3) /* Pull up disabled */
> -#define MODE(val)val
> -
> -/*
> - * PAD CONTROL OFFSETS
> - * Field names corresponds to the pad signal name
> - */
> -/* TODO replace with defines */
> -struct pad_signals {
> - int gpmc_ad0;
> - int gpmc_ad1;
> - int gpmc_ad2;
> - int gpmc_ad3;
> - int gpmc_ad4;
> - int gpmc_ad5;
> - int gpmc_ad6;
> - int gpmc_ad7;
> - int gpmc_ad8;
> - int gpmc_ad9;
> - int gpmc_ad10;
> - int gpmc_ad11;
> - int gpmc_ad12;
> - int gpmc_ad13;
> - int gpmc_ad14;
> - int gpmc_ad15;
> - int gpmc_a0;
> - int gpmc_a1;
> - int gpmc_a2;
> - int gpmc_a3;
> - int gpmc_a4;
> - int gpmc_a5;
> - int gpmc_a6;
> - int gpmc_a7;
> - int gpmc_a8;
> - int gpmc_a9;
> - int gpmc_a10;
> - int gpmc_a11;
> - int gpmc_wait0;
> - int gpmc_wpn;
> - int gpmc_be1n;
> - int gpmc_csn0;
> - int gpmc_csn1;
> - int gpmc_csn2;
> - int gpmc_csn3;
> - int gpmc_clk;
> - int gpmc_advn_ale;
> - int gpmc_oen_ren;
> - int gpmc_wen;
> - int gpmc_be0n_cle;
> - int lcd_data0;
> - int lcd_data1;
> - int lcd_data2;
> - int lcd_data3;
> - int lcd_data4;
> - int lcd_data5;
> - int lcd_data6;
> - int lcd_data7;
> - int lcd_data8;
> - int lcd_data9;
> - int lcd_data10;
> - int lcd_data11;
> - int lcd_data12;
> - int lcd_data13;
> - int lcd_data14;
> - int lcd_data15;
> - int lcd_vsync;
> - int lcd_hsync;
> - int lcd_pclk;
> - int lcd_ac_bias_en;
> - int mmc0_dat3;
> - int mmc0_dat2;
> - int mmc0_dat1;
> - int mmc0_dat0;
> - int mmc0_clk;
> - int mmc0_cmd;
> - int mii1_col;
> - int mii1_crs;
> - int mii1_rxerr;
> - int mii1_txen;
> - int mii1_rxdv;
> - int mii1_txd3;
> - int mii1_txd2;
> - int mii1_txd1;
> - int mii1_txd0;
> - int mii1_txclk;
> - int mii1_rxclk;
> - int mii1_

Re: Loading kernel from SPI NOR

2013-03-14 Thread Sascha Hauer
Hi Jeff,

On Wed, Mar 13, 2013 at 04:28:33PM -0700, Jeff Horn wrote:
> Hi,
> 
> I have a custom board based on the i.MX53.  We are using barebox 2012.05.0
> and booting the Freescale 2.6.35.3 kernel.  Our board has SPI NOR (m25p32)
> and I saw there is a driver in a more recent barebox.  I pulled 2013.01.0
> and added our board files but I can't seem to get the kernel to load.  I
> used the uimage tool and the -i option reported back that it can read the
> kernel and the -v option reported ok.  When I try and boot I see
> arch_number and then nothing.
> 
> I'm continuing to dig in to see what I can find.  Any pointers to where I
> can look is much appreciated.

The first thing you should check is whether your kernel is stored
correctly on the NOR flash. try a:

erase /dev/nor0
cp /someimage /dev/nor0
crc32 -f /someimage
ls -l /someimage
crc32 -f /dev/nor0 0+x

(with x being the size of /someimage as output by ls -l)

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

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