[PATCH 1/8] Cleanup Kconfig files

2012-12-07 Thread Alexander Shiyan
This patch provides a global cleanup barebox Kconfig files. This includes
replacing spaces to tabs, formatting in accordance format, removing
extraneous lines and spaces. No functional changes.

Signed-off-by: Alexander Shiyan 
---
 arch/arm/Kconfig  |6 +++---
 arch/arm/cpu/Kconfig  |7 +++
 arch/arm/mach-at91/Kconfig|7 ++-
 arch/arm/mach-imx/Kconfig |   29 -
 arch/arm/mach-mxs/Kconfig |6 +++---
 arch/arm/mach-netx/Kconfig|1 -
 arch/arm/mach-omap/Kconfig|   17 ++---
 arch/arm/mach-samsung/Kconfig |   18 +++---
 arch/blackfin/Kconfig |2 +-
 arch/mips/Kconfig |   26 +-
 arch/nios2/Kconfig|5 ++---
 arch/openrisc/Kconfig |2 +-
 arch/ppc/mach-mpc5xxx/Kconfig |1 +
 arch/ppc/mach-mpc85xx/Kconfig |3 ++-
 arch/x86/Kconfig  |   15 +++
 arch/x86/boot/Kconfig |2 +-
 arch/x86/mach-i386/Kconfig|2 +-
 commands/Kconfig  |   31 +++
 common/Kconfig|   16 
 crypto/Kconfig|2 +-
 drivers/Kconfig   |2 +-
 drivers/ata/Kconfig   |2 +-
 drivers/dma/Kconfig   |2 +-
 drivers/eeprom/Kconfig|6 +++---
 drivers/gpio/Kconfig  |2 +-
 drivers/i2c/Kconfig   |2 +-
 drivers/input/Kconfig |4 ++--
 drivers/mci/Kconfig   |4 ++--
 drivers/misc/Kconfig  |2 +-
 drivers/mtd/Kconfig   |2 +-
 drivers/mtd/devices/Kconfig   |8 
 drivers/mtd/nand/Kconfig  |8 
 drivers/mtd/ubi/Kconfig   |2 +-
 drivers/net/Kconfig   |2 +-
 drivers/net/phy/Kconfig   |2 +-
 drivers/nor/Kconfig   |6 +++---
 drivers/serial/Kconfig|4 ++--
 drivers/spi/Kconfig   |2 +-
 drivers/usb/Kconfig   |2 +-
 drivers/usb/gadget/Kconfig|2 +-
 drivers/video/Kconfig |2 +-
 drivers/watchdog/Kconfig  |2 +-
 fs/Kconfig|2 +-
 lib/Kconfig   |6 +++---
 lib/gui/Kconfig   |2 +-
 net/Kconfig   |2 +-
 46 files changed, 138 insertions(+), 142 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3afd885..01fe9de 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -19,7 +19,7 @@ config ARM_LINUX
 config HAVE_MACH_ARM_HEAD
bool
 
-menu "System Type   "
+menu "System Type"
 
 choice
prompt "ARM system type"
@@ -71,7 +71,7 @@ config ARCH_NOMADIK
select CPU_ARM926T
select CLOCKSOURCE_NOMADIK
help
-Support for the Nomadik platform by ST-Ericsson
+ Support for the Nomadik platform by ST-Ericsson
 
 config ARCH_OMAP
bool "TI OMAP"
@@ -153,7 +153,7 @@ config THUMB2_BAREBOX
 
 endmenu
 
-menu "Arm specific settings "
+menu "Arm specific settings"
 
 config CMD_ARM_CPUINFO
bool "cpuinfo command"
diff --git a/arch/arm/cpu/Kconfig b/arch/arm/cpu/Kconfig
index d8a5fb1..86bc174 100644
--- a/arch/arm/cpu/Kconfig
+++ b/arch/arm/cpu/Kconfig
@@ -4,7 +4,7 @@ config CPU_32
bool
default y
 
-# Select CPU types depending on the architecture selected.  This selects
+# Select CPU types depending on the architecture selected. This selects
 # which CPUs we support in the kernel image, and the compiler instruction
 # optimiser behaviour.
 
@@ -27,14 +27,13 @@ config CPU_ARM920T
  Say Y if you want support for the ARM920T processor.
  Otherwise, say N.
 
-
 # ARM926T
 config CPU_ARM926T
bool
select CPU_32v5
help
- This is a variant of the ARM920.  It has slightly different
- instruction sequences for cache and TLB operations.  Curiously,
+ This is a variant of the ARM920. It has slightly different
+ instruction sequences for cache and TLB operations. Curiously,
  there is no documentation on it at the ARM corporate website.
 
  Say Y if you want support for the ARM926T processor.
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 3de6061..2750dd5 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -116,13 +116,12 @@ config SUPPORT_CALAO_MOB_TNY_MD2
 if ARCH_AT91RM9200
 
 choice
-
prompt "AT91RM9200 Board Type"
 
 config MACH_AT91RM9200EK
bool "Atmel AT91RM9200-EK Evaluation Kit"
-   help
select HAVE_AT91_DATAFLASH_CARD
+   help
  Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit.
  
 
@@ -135,7 +134,6 @@ endif
 if ARCH_AT91SAM9260
 
 choice
-
prompt "AT91SAM9260 Board Type"
 
 config MACH_AT91SAM9260EK
@@ -218,7 +216,6 @@ endif
 if ARCH_AT91SAM9G20
 
 choice
-
prompt "

[PATCH 8/8] Fix wrong Kconfig reference to ARCH_IMX31

2012-12-07 Thread Alexander Shiyan

Signed-off-by: Alexander Shiyan 
---
 drivers/video/Kconfig |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index f09ffdf..354e68b 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -15,14 +15,14 @@ config IMXFB_DRIVER_VIDEO_IMX_OVERLAY
 
 config DRIVER_VIDEO_IMX_IPU
bool "i.MX31/35 framebuffer driver"
-   depends on ARCH_IMX35 || ARCH_IMX_31
+   depends on ARCH_IMX35 || ARCH_IMX31
help
  Add support for the IPU framebuffer device found on
  i.MX31 and i.MX35 CPUs.
 
 config DRIVER_VIDEO_IMX_IPU_OVERLAY
bool "i.MX31/35 framebuffer overlay support"
-   depends on DRIVER_VIDEO_IMX_IPU && (ARCH_IMX35 || ARCH_IMX_31)
+   depends on DRIVER_VIDEO_IMX_IPU && (ARCH_IMX35 || ARCH_IMX31)
 
 config DRIVER_VIDEO_STM
bool "i.MX23/28 framebuffer driver"
-- 
1.7.8.6


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


[PATCH 7/8] Remove bad Kconfig reference to MTD_NAND

2012-12-07 Thread Alexander Shiyan
Barebox not contain symbol MTD_NAND, so remove all references to it.

Signed-off-by: Alexander Shiyan 
---
 drivers/mtd/nand/Kconfig |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index aa3ea34..49daabf 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -104,7 +104,6 @@ config MTD_NAND_ECC_SMC
 
 config MTD_NAND_MUSEUM_IDS
bool "Enable chip ids for obsolete ancient NAND devices"
-   depends on MTD_NAND
default n
help
  Enable this option only when your board has first generation
-- 
1.7.8.6


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


[PATCH 5/8] Remove bad Kconfig reference to DISK_DRIVE

2012-12-07 Thread Alexander Shiyan
Barebox not contain symbol DISK_DRIVE, so remove all references to it.

Signed-off-by: Alexander Shiyan 
---
 drivers/ata/Kconfig |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 2e80c3e..636ae6c 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -26,7 +26,6 @@ config DISK_BIOS
 
 config DISK_ATA
bool "ATA type drives"
-   select DISK_DRIVE
help
  Support for native ATA/IDE drives
 
-- 
1.7.8.6


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


[PATCH 6/8] Remove bad Kconfig reference to HAS_PCI

2012-12-07 Thread Alexander Shiyan
Barebox not contain symbol HAS_PCI, so remove all references to it.

Signed-off-by: Alexander Shiyan 
---
 arch/x86/mach-i386/Kconfig |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/x86/mach-i386/Kconfig b/arch/x86/mach-i386/Kconfig
index cb12b9c..b64d21f 100644
--- a/arch/x86/mach-i386/Kconfig
+++ b/arch/x86/mach-i386/Kconfig
@@ -10,7 +10,6 @@ config X86_GENERIC_HAS_ISA
 
 config X86_GENERIC_HAS_PCI
bool "PCI support"
-   select HAS_PCI
help
  Say Y here if the target supports a PCI bus
 
-- 
1.7.8.6


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


[PATCH 2/8] Remove bad Kconfig reference to HAS_CFI

2012-12-07 Thread Alexander Shiyan
Barebox not contain symbol HAS_CFI, so remove all references to it.

Signed-off-by: Alexander Shiyan 
---
 arch/arm/mach-netx/Kconfig|1 -
 arch/arm/mach-pxa/Kconfig |1 -
 arch/ppc/mach-mpc5xxx/Kconfig |1 -
 3 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-netx/Kconfig b/arch/arm/mach-netx/Kconfig
index b9e3457..b767e54 100644
--- a/arch/arm/mach-netx/Kconfig
+++ b/arch/arm/mach-netx/Kconfig
@@ -45,7 +45,6 @@ choice
 config MACH_NXDB500
bool "Hilscher Netx nxdb500"
select HAS_NETX_ETHER
-   select HAS_CFI
select MACH_HAS_LOWLEVEL_INIT
help
  Say Y here if you are using the Hilscher Netx nxdb500 board
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 029fd8b..6671da9 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -42,7 +42,6 @@ config MACH_MIOA701
 
 config MACH_PCM027
bool "Phytec phyCORE-PXA270"
-   select HAS_CFI
select MACH_HAS_LOWLEVEL_INIT
select HAVE_MMU
help
diff --git a/arch/ppc/mach-mpc5xxx/Kconfig b/arch/ppc/mach-mpc5xxx/Kconfig
index db001d7..34254eb 100644
--- a/arch/ppc/mach-mpc5xxx/Kconfig
+++ b/arch/ppc/mach-mpc5xxx/Kconfig
@@ -17,7 +17,6 @@ choice
 
 config MACH_PHYCORE_MPC5200B_TINY
bool "Phycore mpc5200b tiny"
-   select HAS_CFI
help
  Say Y here if you are using the Phytec Phycore MPC5200B Tiny
  board aka pcm030.
-- 
1.7.8.6


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


[PATCH 4/8] Remove bad Kconfig reference to HAVE_CLK

2012-12-07 Thread Alexander Shiyan
Barebox not contain symbol HAVE_CLK, so remove all references to it.

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

diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 66c1c46..4589128 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -1,7 +1,6 @@
 
 config CLKDEV_LOOKUP
bool
-   select HAVE_CLK
 
 config COMMON_CLK
bool
-- 
1.7.8.6


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


[PATCH 3/8] Remove bad Kconfig reference to HAVE_MMU

2012-12-07 Thread Alexander Shiyan
Barebox not contain symbol HAVE_MMU, so remove all references to it.

Signed-off-by: Alexander Shiyan 
---
 arch/arm/mach-pxa/Kconfig |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 6671da9..6808d2f 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -43,7 +43,6 @@ config MACH_MIOA701
 config MACH_PCM027
bool "Phytec phyCORE-PXA270"
select MACH_HAS_LOWLEVEL_INIT
-   select HAVE_MMU
help
  Say Y here if you are using a Phytec phyCORE PXA270
  board
-- 
1.7.8.6


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


Re: [PATCH] Cleanup Kconfig files

2012-12-07 Thread Alexander Shiyan
On Mon, 26 Nov 2012 09:16:02 +0100
Sascha Hauer  wrote:

> On Sat, Nov 24, 2012 at 10:53:29PM +0400, Alexander Shiyan wrote:
> > This patch provides a global cleanup barebox Kconfig files. This includes
> > replacing spaces to tabs, formatting in accordance format, removing
> > extraneous lines and spaces. No functional changes.
...
> If nobody objects I'll apply it. If somebody objects, I probably say him
> that he should provide a patch for Kconfig instead.

I re-submit the updated cleanup patch based on v2012.12.0.

-- 
Alexander Shiyan 

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


[PATCH] fix GENERIC_PHY match nothing

2012-12-07 Thread 张忠山
According the match logic in function mdio_bus_match
generic phy driver matchs nothing.

If we want it match anything, We must let it's phy_id_mask
be all zeros

Signed-off-by: 张忠山 
---
 drivers/net/phy/generic.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/phy/generic.c b/drivers/net/phy/generic.c
index 3f5f127..c3743b9 100644
--- a/drivers/net/phy/generic.c
+++ b/drivers/net/phy/generic.c
@@ -25,7 +25,7 @@
 static struct phy_driver generic_phy = {
.drv.name = "Generic PHY",
.phy_id = PHY_ANY_UID,
-   .phy_id_mask = PHY_ANY_UID,
+   .phy_id_mask = 0,
.features = 0,
 };
 
-- 
1.7.4.4



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


Re: [PATCH] let kbuild build foo/bar.o correctly

2012-12-07 Thread 张忠山
How about this patch.

Why nobody say anything?

-- 
Best Regards,
zzs



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


Re: [PATCH v2] at91: reorder BOARDINFO alphabetically

2012-12-07 Thread Jean-Christophe PLAGNIOL-VILLARD
On 09:30 Fri 07 Dec , Sascha Hauer wrote:
> On Fri, Dec 07, 2012 at 07:52:49AM +0100, Jean-Christophe PLAGNIOL-VILLARD 
> wrote:
> > On 12:16 Thu 06 Dec , Fabio Porcedda wrote:
> > > This is to have a nicely ordered list and to decrease the
> > > likelihood of a conflict when adding a new board.
> > > 
> > > Signed-off-by: Fabio Porcedda 
> > > Cc: Jean-Christophe PLAGNIOL-VILLARD 
> > > ---
> > > v2:
> > NAK
> > 
> > I order them by Kconfig keepo  it that way
> 
> I'd say it makes more sense to keep them in the order the user actually
> sees them, it makes it easier to find the entries. What's the value in
> ordering them by Kconfig name?
> If you order them by Kconfig name, the Calao boards end up in three
> different places in the user visible view.

I do it the same we do on the kernel
and I do want to keep that way the board are order by Kconfig

not by name

Best Regards,
J.

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


Re: [PATCH 1/1] mtd: nand: fix unaligned write support

2012-12-07 Thread Jean-Christophe PLAGNIOL-VILLARD
On 19:28 Wed 05 Dec , Sascha Hauer wrote:
> On Wed, Dec 05, 2012 at 06:15:20PM +0100, Jean-Christophe PLAGNIOL-VILLARD 
> wrote:
> > via cdev we may write unaligned data the code was drop in the commit
> > 0a4b1c7e440a81819eb2137f923573a3055dc7a2
> > mtd core: call driver write function with complete buffer
> > 
> > which is true for spi flashes but the code is still mandatory on nand
> 
> I suggest the following simpler approach.
> 
> Sascha
> 
yes it work here

Best Regards,
J.
> 
> From 5248abe7e59f60085b9a2affd3db11a6ac0a9da9 Mon Sep 17 00:00:00 2001
> From: Sascha Hauer 
> Date: Wed, 5 Dec 2012 19:24:41 +0100
> Subject: [PATCH] mtd nand: allow partial page writes
> 
> The nand layer handles partial page writes just fine. If the start or
> end of the data is not page aligned, the nand layer will copy the data
> to a temporary page buffer.
> Remove the check which disallows partial page writes since this is what
> we want to do on barebox when for example an image is written to nand
> which is not padded to page size.
> 
> Signed-off-by: Sascha Hauer 
> ---
>  drivers/mtd/nand/nand_write.c |7 ---
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_write.c b/drivers/mtd/nand/nand_write.c
> index 5ed04ce..9997127 100644
> --- a/drivers/mtd/nand/nand_write.c
> +++ b/drivers/mtd/nand/nand_write.c
> @@ -273,13 +273,6 @@ int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
>   if (!writelen)
>   return 0;
>  
> - /* reject writes, which are not page aligned */
> - if (NOTALIGNED(to) || NOTALIGNED(ops->len)) {
> - printk(KERN_NOTICE "nand_write: "
> -"Attempt to write not page aligned data\n");
> - return -EINVAL;
> - }
> -
>   column = to & (mtd->writesize - 1);
>   subpage = column || (writelen & (mtd->writesize - 1));
>  
> -- 
> 1.7.10.4
> 
> -- 
> 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


mdio_bus_match() bug

2012-12-07 Thread 张忠山
In drivers/net/phy/mdio_bus.c: mdio_bus_match(), It compare
phy_id between driver and device.

In drivers/net/phy/generic.c set generic phy driver's phy_id
to PHY_ANY_UID

My phy is DM9161E, it's id is 0x181b881.

Of course they won't match! But the generic phy driver indeed
can works with DM9161E

Maybe the match logic should be fixed

-- 
Best Regards,
zzs



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


Re: [PATCH] clk: use the 'CLK_ALWAYS_ENABLED' flag for clk-fixed by default

2012-12-07 Thread Sascha Hauer
On Thu, Dec 06, 2012 at 10:08:57PM +0400, Antony Pavlov wrote:
> Signed-off-by: Antony Pavlov 
> ---
>  drivers/clk/clk-fixed.c |1 +
>  1 file changed, 1 insertion(+)

Applied, thanks.

Overall I'm not quite sure how we continue here. ATM for i.MX I enable
all gates during startup and do not handle the gates at all later. This
has the effect that the clock tree now looks like this:

dummy (rate 0, always enabled)
ckih (rate 2600, always enabled)
mpll (rate 39900, disabled)
mpll_main2 (rate 26600, disabled)
ahb (rate 13300, disabled)
ipg (rate 6650, disabled)
nfc_div (rate 3325, disabled)
per1_div (rate 1477, disabled)
per2_div (rate 2660, disabled)
per3_div (rate 6650, disabled)
lcdc_per_gate (rate 6650, disabled)
per4_div (rate 2660, disabled)
cpu_sel (rate 39900, disabled)
cpu_div (rate 39900, disabled)
spll (rate 24000, disabled)
usb_div (rate 6000, disabled)
ckil (rate 32768, always enabled)
clko_sel (rate 32768, disabled)
clko_div (rate 6553, disabled)

The dividers and muxes can't be disabled, so it would be better to print
'enabled' here. I just created the following patch which basically
exploits the is_enabled callback. This way we can print the true
hardware status of the clocks instead of the software use counter which
is IMO more important to know. The patch only falls back to the software
enable counter if no information from the hardware is available.


Consider this situation:

OSC - gate -- divider1 ---
   \
' divider2 ---

With the following patch this means that barebox correctly prints
divider1 and divider2 as enabled when the gate is enabled. The Linux
clock framework instead would only give you information about the
software state, so that when somebody enables only divider1 (which
propagates to the gate), then divider2 would still be shown as disabled.

Sascha

diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
index 58a7ea5..232fb0e 100644
--- a/drivers/clk/clk-divider.c
+++ b/drivers/clk/clk-divider.c
@@ -71,6 +71,7 @@ static unsigned long clk_divider_recalc_rate(struct clk *clk,
 struct clk_ops clk_divider_ops = {
.set_rate = clk_divider_set_rate,
.recalc_rate = clk_divider_recalc_rate,
+   .is_enabled = clk_is_enabled_always,
 };
 
 struct clk *clk_divider(const char *name, const char *parent,
diff --git a/drivers/clk/clk-fixed.c b/drivers/clk/clk-fixed.c
index 5e81e72..9295dde 100644
--- a/drivers/clk/clk-fixed.c
+++ b/drivers/clk/clk-fixed.c
@@ -34,6 +34,7 @@ static unsigned long clk_fixed_recalc_rate(struct clk *clk,
 
 struct clk_ops clk_fixed_ops = {
.recalc_rate = clk_fixed_recalc_rate,
+   .is_enabled = clk_is_enabled_always,
 };
 
 struct clk *clk_fixed(const char *name, int rate)
diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c
index cf1bb1a..a455094 100644
--- a/drivers/clk/clk-gate.c
+++ b/drivers/clk/clk-gate.c
@@ -49,9 +49,23 @@ 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);
+   u32 val;
+
+   val = readl(g->reg);
+
+   if (val & (1 << g->shift))
+   return 1;
+   else
+   return 0;
+}
+
 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,
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
index cb5f1a1..6cf2d69 100644
--- a/drivers/clk/clk-mux.c
+++ b/drivers/clk/clk-mux.c
@@ -51,6 +51,7 @@ static int clk_mux_set_parent(struct clk *clk, u8 idx)
 struct clk_ops clk_mux_ops = {
.get_parent = clk_mux_get_parent,
.set_parent = clk_mux_set_parent,
+   .is_enabled = clk_is_enabled_always,
 };
 
 struct clk *clk_mux(const char *name, void __iomem *reg,
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index cb94755..a1a16ed 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -218,6 +218,32 @@ int clk_register(struct clk *clk)
return 0;
 }
 
+int clk_is_enabled(struct clk *clk)
+{
+   int enabled;
+
+   if (IS_ERR(clk))
+   return 0;
+
+   if (clk->flags & CLK_ALWAYS_ENABLED)
+   return 1;
+
+   if (clk->ops->is_enabled)
+   enabled = clk->ops->is_enabled(clk);
+   else
+   enabled = clk->enable_count ? 1 : 0;;
+
+   if (enabled)
+   return clk_is_enabled(clk_get_parent(clk));
+   else
+   return 0;
+}
+
+int clk_is_enabled_always(struct clk *clk)
+{
+   return 1;
+}
+
 static void dump_one(struct clk *clk, int verbose, int indent)
 {
  

Re: [PATCH v2] at91: reorder BOARDINFO alphabetically

2012-12-07 Thread Fabio Porcedda
On Fri, Dec 7, 2012 at 9:30 AM, Sascha Hauer  wrote:
> On Fri, Dec 07, 2012 at 07:52:49AM +0100, Jean-Christophe PLAGNIOL-VILLARD 
> wrote:
>> On 12:16 Thu 06 Dec , Fabio Porcedda wrote:
>> > This is to have a nicely ordered list and to decrease the
>> > likelihood of a conflict when adding a new board.
>> >
>> > Signed-off-by: Fabio Porcedda 
>> > Cc: Jean-Christophe PLAGNIOL-VILLARD 
>> > ---
>> > v2:
>> NAK
>>
>> I order them by Kconfig keepo  it that way
>
> I'd say it makes more sense to keep them in the order the user actually
> sees them, it makes it easier to find the entries. What's the value in
> ordering them by Kconfig name?
> If you order them by Kconfig name, the Calao boards end up in three
> different places in the user visible view.

IMHO it's easier and nicer to order by text, in fact the entries were not even
completely ordered by Kconfig.

--
Fabio Porcedda

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


Re: about the dm9000 in mini2440

2012-12-07 Thread Juergen Beisert
Yi Qingliang wrote:
> On Thursday, December 06, 2012 12:27:45 PM Eric Bénard wrote:
> > Le Thu, 06 Dec 2012 15:55:23 +,
> >
> > Yi Qingliang  a écrit :
> > > the address of dm9000 is 0x2800, it should be cs5, but in function
> > > "mini2440_devices_init", it set the cs4 instead, why??
> >
> > The mini2440 supported in Barebox is this one and maybe not the one
> > your are using ;-)
> > http://www.friendlyarm.net/products/mini2440
>
> there is "mini2440 friendlyARM" on my board, whose color is white.
> blue pcb, maybe friendlyARM has multi version mini2440?

FriendlyARM has some copyist. A blue PCB I have never seen yet.

> I say the 0x2800 is cs5, based on the memory layout picture in the
> manual. although the schematics is same as Juergen Beisert's.

And the schematics says it is CS4.

> I can't get the original disk, only the board. So how to check the EED0?
> ps: In the manual of dm9000, it said that EED0 is pulled down internaly.

Sure. But if you have some power floating around your board the chip might 
detect a high level at system start. But this idea is just a shot into the 
dark.

Regards,
Juergen

-- 
Pengutronix e.K.  | Juergen Beisert |
Linux Solutions for Science and Industry  | http://www.pengutronix.de/  |

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


Re: about the dm9000 in mini2440

2012-12-07 Thread Juergen Beisert
Yi Qingliang wrote:
> and if connected jtager, the ON switch does not work some time.

Seems your jtager powers the system by accident.

Regards,
Juergen

-- 
Pengutronix e.K.  | Juergen Beisert |
Linux Solutions for Science and Industry  | http://www.pengutronix.de/  |

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


Re: about the dm9000 in mini2440

2012-12-07 Thread Juergen Beisert
Yi Qingliang wrote:
> I got it finally, but not root cause.
> reproduce:
>
> 1. connect jtag with openjtag(not the official openjtag, but 100ask.net
> produced based on openmoko's).
> 2. use ON/OFF switch on the board
>
> then I got "Wrong databus"
> but if I disconnect the power line, and reconnect it, everything OK.
> and if not connect jtager, and use ON/OFF switch, everyghing OK.
>
> what's the fuck problem?

Good question. The DM9000 uses the EED0 pin to decide if a 16 or 32 bit data 
bus is in use, when the reset signal is gone. Maybe your system does 
not "see" a correct reset.

Regards,
Juergen

-- 
Pengutronix e.K.  | Juergen Beisert |
Linux Solutions for Science and Industry  | http://www.pengutronix.de/  |

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


Re: [PATCH v2] at91: reorder BOARDINFO alphabetically

2012-12-07 Thread Sascha Hauer
On Fri, Dec 07, 2012 at 07:52:49AM +0100, Jean-Christophe PLAGNIOL-VILLARD 
wrote:
> On 12:16 Thu 06 Dec , Fabio Porcedda wrote:
> > This is to have a nicely ordered list and to decrease the
> > likelihood of a conflict when adding a new board.
> > 
> > Signed-off-by: Fabio Porcedda 
> > Cc: Jean-Christophe PLAGNIOL-VILLARD 
> > ---
> > v2:
> NAK
> 
> I order them by Kconfig keepo  it that way

I'd say it makes more sense to keep them in the order the user actually
sees them, it makes it easier to find the entries. What's the value in
ordering them by Kconfig name?
If you order them by Kconfig name, the Calao boards end up in three
different places in the user visible view.

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