Re: [uClinux-dev] [RFC/PATCH] m68knommu: refactor Coldfire GPIO not to require GPIOLIB, eliminate mcf_gpio_chips.

2012-06-06 Thread Greg Ungerer

Hi Steven,

On 06/06/12 00:23, Steven King wrote:

On Monday 04 June 2012 11:27:04 pm Greg Ungerer wrote:

On 22/05/12 06:10, Steven King wrote:

If we're not connecting external GPIO extenders via i2c or spi or
whatever, we probably don't need GPIOLIB.  If we provide an alternate
implementation of the GPIOLIB functions to use when only on-chip GPIO is
needed, we can change ARCH_REQUIRE_GPIOLIB to ARCH_WANTS_OPTIONAL_GPIOLIB
so that GPIOLIB becomes optional.

The downside is that in the GPIOLIB=n case, we lose all error checking
done by gpiolib, ie multiply allocating the gpio, free'ing gpio etc., so
that the only checking that can be done is if we reference a gpio on an
external part. Targets that need the extra error checking can still
select GPIOLIB=y.

For the case where GPIOLIB=y, we can simplify the table of gpio chips to
use a single chip, eliminating the tables of chips in the 5xxx.c files.
The original motivation for the definition of multiple chips was to match
the way many of the Coldfire variants defined their gpio as a spare array
in memory. However, all this really gains us is some error checking when
we request a gpio, gpiolib can check that it doesn't fall in one of the
holes.  If thats important, I think we can still come up with a better
way of accomplishing that.

Also in this patch is some general cleanup and reorganizing of the gpio
header files (I'm sure I must have had a reason why I sometimes used a
prefix of mcf_gpio and other times mcfgpio but for the life of me I can't
think of it now).

Signed-off-by: Steven King


This looks pretty good to me. I like the simplified setup and use.
If you are still happy with it I can apply to the for-next branch of
the m68knommu git tree?


Yes, please do.  Thanks.


Ok, done. I had a merge conflict on Kconfig.cpu, but I thinked I
fixed it up right.

Regards
Greg



Greg Ungerer  --  Principal EngineerEMAIL: g...@snapgear.com
SnapGear Group, McAfee  PHONE:   +61 7 3435 2888
8 Gardner Close FAX: +61 7 3217 5323
Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] [PATCH] m68knommu: Add support for the Freescale m5253demo board.

2012-06-06 Thread Greg Ungerer

Hi Steven,

On 06/06/12 02:48, Steven King wrote:

Add basic support for the m5253demo using the dm9000 ethernet controller.

This patch is against m68knommu/for-next and is on top of the m5251/5253
patch.

Signed-off-by: Steven King
---
  arch/m68k/Kconfig.machine   |7 +
  arch/m68k/configs/m5253demo_defconfig   |  858 +++


You should do a "make ARCH=m68k savedefconfig" from the top of the kernel
tree to produce a minimal defconfig file. (See "make help" for all the
wonderful options available from the top level make).

Regards
Greg



  arch/m68k/include/asm/io_no.h   |8 +
  arch/m68k/include/asm/m525xsim.h|3 +
  arch/m68k/platform/coldfire/Makefile|1 +
  arch/m68k/platform/coldfire/m5253demo.c |  161 ++
  6 files changed, 1038 insertions(+)

diff --git a/arch/m68k/Kconfig.machine b/arch/m68k/Kconfig.machine
index 7cdf6b0..10c97dc 100644
--- a/arch/m68k/Kconfig.machine
+++ b/arch/m68k/Kconfig.machine
@@ -252,6 +252,13 @@ config M5249C3
help
  Support for the Motorola M5249C3 board.

+config M5253DEMO
+   bool "Freescale M5253DEMO board support"
+   depends on M525x
+   select FREESCALE
+   help
+ Support for the Freescale M5253DEMO board.
+
  config M5271EVB
bool "Freescale (Motorola) M5271EVB board support"
depends on M5271
diff --git a/arch/m68k/configs/m5253demo_defconfig 
b/arch/m68k/configs/m5253demo_defconfig
new file mode 100644
index 000..d01de29
--- /dev/null
+++ b/arch/m68k/configs/m5253demo_defconfig
@@ -0,0 +1,858 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux/m68k 3.5.0-rc1 Kernel Configuration
+#
+CONFIG_M68K=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_CSUM=y
+CONFIG_TIME_LOW_RES=y
+CONFIG_NO_IOPORT=y
+# CONFIG_NO_DMA is not set
+CONFIG_ZONE_DMA=y
+CONFIG_CPU_HAS_NO_BITFIELDS=y
+CONFIG_CPU_HAS_NO_MULDIV64=y
+CONFIG_HZ=100
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_DEFAULT_HOSTNAME="(none)"
+# CONFIG_SYSVIPC is not set
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_FHANDLE is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+
+#
+# IRQ subsystem
+#
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_SHOW=y
+
+#
+# RCU Subsystem
+#
+CONFIG_TINY_RCU=y
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+# CONFIG_CHECKPOINT_RESTORE is not set
+# CONFIG_NAMESPACES is not set
+# CONFIG_SCHED_AUTOGROUP is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EXPERT=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+# CONFIG_FUTEX is not set
+# CONFIG_EPOLL is not set
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+# CONFIG_AIO is not set
+CONFIG_EMBEDDED=y
+
+#
+# Kernel Performance Events And Counters
+#
+# CONFIG_VM_EVENT_COUNTERS is not set
+CONFIG_COMPAT_BRK=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_MMAP_ALLOW_UNINITIALIZED is not set
+# CONFIG_PROFILING is not set
+
+#
+# GCOV-based kernel profiling
+#
+# CONFIG_GCOV_KERNEL is not set
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+# CONFIG_LBDAF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_BSGLIB is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+# CONFIG_INLINE_SPIN_TRYLOCK is not set
+# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK is not set
+# CONFIG_INLINE_SPIN_LOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
+# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
+CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
+# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_READ_TRYLOCK is not set
+# CONFIG_INLINE_READ_LOCK is not set
+# CONFIG_INLINE_READ_LOCK_BH is not set
+# CONFIG_INLINE_READ_LOCK_IRQ is not set
+# CONFIG_INLIN

Re: [uClinux-dev] [RFC/PATCH] m68knommu: refactor Coldfire GPIO not to require GPIOLIB, eliminate mcf_gpio_chips.

2012-06-06 Thread Steven King
On Wednesday 06 June 2012 12:07:33 am Greg Ungerer wrote:
> Hi Steven,
>
> On 06/06/12 00:23, Steven King wrote:
> > On Monday 04 June 2012 11:27:04 pm Greg Ungerer wrote:
> >> On 22/05/12 06:10, Steven King wrote:
> >>> If we're not connecting external GPIO extenders via i2c or spi or
> >>> whatever, we probably don't need GPIOLIB.  If we provide an alternate
> >>> implementation of the GPIOLIB functions to use when only on-chip GPIO
> >>> is needed, we can change ARCH_REQUIRE_GPIOLIB to
> >>> ARCH_WANTS_OPTIONAL_GPIOLIB so that GPIOLIB becomes optional.
> >>>
> >>> The downside is that in the GPIOLIB=n case, we lose all error checking
> >>> done by gpiolib, ie multiply allocating the gpio, free'ing gpio etc.,
> >>> so that the only checking that can be done is if we reference a gpio on
> >>> an external part. Targets that need the extra error checking can still
> >>> select GPIOLIB=y.
> >>>
> >>> For the case where GPIOLIB=y, we can simplify the table of gpio chips
> >>> to use a single chip, eliminating the tables of chips in the 5xxx.c
> >>> files. The original motivation for the definition of multiple chips was
> >>> to match the way many of the Coldfire variants defined their gpio as a
> >>> spare array in memory. However, all this really gains us is some error
> >>> checking when we request a gpio, gpiolib can check that it doesn't fall
> >>> in one of the holes.  If thats important, I think we can still come up
> >>> with a better way of accomplishing that.
> >>>
> >>> Also in this patch is some general cleanup and reorganizing of the gpio
> >>> header files (I'm sure I must have had a reason why I sometimes used a
> >>> prefix of mcf_gpio and other times mcfgpio but for the life of me I
> >>> can't think of it now).
> >>>
> >>> Signed-off-by: Steven King
> >>
> >> This looks pretty good to me. I like the simplified setup and use.
> >> If you are still happy with it I can apply to the for-next branch of
> >> the m68knommu git tree?
> >
> > Yes, please do.  Thanks.
>
> Ok, done. I had a merge conflict on Kconfig.cpu, but I thinked I
> fixed it up right.

Yeah, I ran into that conflict too when I rebased my trees;  curious, I looked 
at the log and that ARCH_HAVE_CUSTOM_GPIO_H was added by Mark Brown, and from 
the commit message it sounds like removing it as you did may break whatever 
it was he was intending. (cc'ing Mark).
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[uClinux-dev] [PATCH net-next] fec: Add support for Coldfire M5441x enet-mac.

2012-06-06 Thread Steven King
Add support for the Freescale Coldfire M5441x; as these parts have an 
enet-mac, add a quirk to distinguish them from the other Coldfire parts so we 
can use the existing enet-mac support.

Signed-off-by: Steven king 
---
 drivers/net/ethernet/freescale/Kconfig |5 ++---
 drivers/net/ethernet/freescale/fec.c   |6 +-
 drivers/net/ethernet/freescale/fec.h   |3 ++-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/freescale/Kconfig 
b/drivers/net/ethernet/freescale/Kconfig
index 3574e14..f9aa244 100644
--- a/drivers/net/ethernet/freescale/Kconfig
+++ b/drivers/net/ethernet/freescale/Kconfig
@@ -7,7 +7,7 @@ config NET_VENDOR_FREESCALE
default y
depends on FSL_SOC || QUICC_ENGINE || CPM1 || CPM2 || PPC_MPC512x || \
   M523x || M527x || M5272 || M528x || M520x || M532x || \
-  ARCH_MXC || ARCH_MXS || (PPC_MPC52xx && PPC_BESTCOMM)
+  M5441x || ARCH_MXC || ARCH_MXS || (PPC_MPC52xx && 
PPC_BESTCOMM)
---help---
  If you have a network (Ethernet) card belonging to this class, say Y
  and read the Ethernet-HOWTO, available from
@@ -22,8 +22,7 @@ if NET_VENDOR_FREESCALE
 
 config FEC
tristate "FEC ethernet controller (of ColdFire and some i.MX CPUs)"
-   depends on (M523x || M527x || M5272 || M528x || M520x || M532x || \
-  ARCH_MXC || SOC_IMX28)
+   depends on (M523x || M527x || M5272 || M528x || M520x || M532x || 
M5441x || ARCH_MXC || SOC_IMX28)
default ARCH_MXC || SOC_IMX28 if ARM
select PHYLIB
---help---
diff --git a/drivers/net/ethernet/freescale/fec.c 
b/drivers/net/ethernet/freescale/fec.c
index ff7f4c5..9567667 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -94,6 +94,9 @@ static struct platform_device_id fec_devtype[] = {
.name = "imx6q-fec",
.driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT,
}, {
+   .name = "enet-fec",
+   .driver_data = FEC_QUIRK_ENET_MAC,
+   }, {
/* sentinel */
}
 };
@@ -187,7 +190,8 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address");
  * account when setting it.
  */
 #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || 
\
-defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARM)
+defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARM) || \
+defined(CONFIG_M5441x)
 #defineOPT_FRAME_SIZE  (PKT_MAXBUF_SIZE << 16)
 #else
 #defineOPT_FRAME_SIZE  0
diff --git a/drivers/net/ethernet/freescale/fec.h 
b/drivers/net/ethernet/freescale/fec.h
index 8408c62..298cfb7 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -15,7 +15,8 @@
 
 #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || 
\
 defined(CONFIG_M520x) || defined(CONFIG_M532x) || \
-defined(CONFIG_ARCH_MXC) || defined(CONFIG_SOC_IMX28)
+defined(CONFIG_ARCH_MXC) || defined(CONFIG_SOC_IMX28) || \
+defined(CONFIG_M5441x)
 /*
  * Just figures, Motorola would have to change the offsets for
  * registers in the same peripheral device on different models
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] [PATCH net-next] fec: Add support for Coldfire M5441x enet-mac.

2012-06-06 Thread Steven King
On Wednesday 06 June 2012 10:34:21 am Jan Ceuleers wrote:
> On 06/06/2012 07:06 PM, Steven King wrote:
> > Add support for the Freescale Coldfire M5441x; as these parts have an
> > enet-mac, add a quirk to distinguish them from the other Coldfire parts
> > so we can use the existing enet-mac support.
>
> Stephen,
>
> You are activating certain functionality based on whether M5441x is
> defined. But where is this being defined? Should this not be added in a
> Kconfig somewhere as a platform option?

Yes.  Hopefully, once I send Greg my updated patches to add support for the 
m5441x, then it will be a selection in the m68k port.  I just happened to 
have these ready to go after David chastised me for sending them too late in 
the last merge cycle...
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[uClinux-dev] [PATCH] m68knommu: use MCF_IRQ_PIT1 instead of MCFINT_VECBASE + MCFINT_PIT1

2012-06-06 Thread Steven King
use MCF_IRQ_PIT1 instead of MCFINT_VECBASE + MCFINT_PIT1 so we can support
those parts that have the pit1 interrupt on other than the first interrupt
controller.

Signed-off-by: Steven King 
---
 arch/m68k/include/asm/m520xsim.h  |1 +
 arch/m68k/include/asm/m523xsim.h  |1 +
 arch/m68k/include/asm/m527xsim.h  |1 +
 arch/m68k/include/asm/m528xsim.h  |2 +-
 arch/m68k/platform/coldfire/pit.c |4 ++--
 5 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/m68k/include/asm/m520xsim.h b/arch/m68k/include/asm/m520xsim.h
index 17f2aab..5a8b5e4 100644
--- a/arch/m68k/include/asm/m520xsim.h
+++ b/arch/m68k/include/asm/m520xsim.h
@@ -62,6 +62,7 @@
 #define MCF_IRQ_FECENTC0(MCFINT_VECBASE + MCFINT_FECENTC0)
 
 #defineMCF_IRQ_QSPI(MCFINT_VECBASE + MCFINT_QSPI)
+#define MCF_IRQ_PIT1(MCFINT_VECBASE + MCFINT_PIT1)
 
 /*
  *  SDRAM configuration registers.
diff --git a/arch/m68k/include/asm/m523xsim.h b/arch/m68k/include/asm/m523xsim.h
index 075062d..91d3abc 100644
--- a/arch/m68k/include/asm/m523xsim.h
+++ b/arch/m68k/include/asm/m523xsim.h
@@ -52,6 +52,7 @@
 #defineMCF_IRQ_FECENTC0(MCFINT_VECBASE + MCFINT_FECENTC0)
 
 #defineMCF_IRQ_QSPI(MCFINT_VECBASE + MCFINT_QSPI)
+#define MCF_IRQ_PIT1   (MCFINT_VECBASE + MCFINT_PIT1)
 
 /*
  * SDRAM configuration registers.
diff --git a/arch/m68k/include/asm/m527xsim.h b/arch/m68k/include/asm/m527xsim.h
index 83db810..71aa510 100644
--- a/arch/m68k/include/asm/m527xsim.h
+++ b/arch/m68k/include/asm/m527xsim.h
@@ -60,6 +60,7 @@
 #defineMCF_IRQ_FECENTC1(MCFINT2_VECBASE + MCFINT2_FECENTC1)
 
 #defineMCF_IRQ_QSPI(MCFINT_VECBASE + MCFINT_QSPI)
+#define MCF_IRQ_PIT1   (MCFINT_VECBASE + MCFINT_PIT1)
 
 /*
  * SDRAM configuration registers.
diff --git a/arch/m68k/include/asm/m528xsim.h b/arch/m68k/include/asm/m528xsim.h
index 497c31c..4acb3c0 100644
--- a/arch/m68k/include/asm/m528xsim.h
+++ b/arch/m68k/include/asm/m528xsim.h
@@ -52,7 +52,7 @@
 #defineMCF_IRQ_FECENTC0(MCFINT_VECBASE + MCFINT_FECENTC0)
 
 #defineMCF_IRQ_QSPI(MCFINT_VECBASE + MCFINT_QSPI)
-
+#define MCF_IRQ_PIT1   (MCFINT_VECBASE + MCFINT_PIT1)
 /*
  * SDRAM configuration registers.
  */
diff --git a/arch/m68k/platform/coldfire/pit.c 
b/arch/m68k/platform/coldfire/pit.c
index e62dbbc..e8f3b97 100644
--- a/arch/m68k/platform/coldfire/pit.c
+++ b/arch/m68k/platform/coldfire/pit.c
@@ -93,7 +93,7 @@ struct clock_event_device cf_pit_clockevent = {
.set_mode   = init_cf_pit_timer,
.set_next_event = cf_pit_next_event,
.shift  = 32,
-   .irq= MCFINT_VECBASE + MCFINT_PIT1,
+   .irq= MCF_IRQ_PIT1,
 };
 
 
@@ -159,7 +159,7 @@ void hw_timer_init(irq_handler_t handler)
clockevent_delta2ns(0x3f, &cf_pit_clockevent);
clockevents_register_device(&cf_pit_clockevent);
 
-   setup_irq(MCFINT_VECBASE + MCFINT_PIT1, &pit_irq);
+   setup_irq(MCF_IRQ_PIT1, &pit_irq);
 
clocksource_register_hz(&pit_clk, FREQ);
 }
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[uClinux-dev] [PATCH] Add support for the Coldfire m5441x.

2012-06-06 Thread Steven King
Add support for the Coldfire 5441x (54410/54415/54416/54417/54418).  Currently
we only support noMMU mode.  It requires the PIT patch posted previously as it
uses the PIT instead of the dma timer as a clock source so we can get all that
GENERIC_CLOCKEVENTS goodness.  It also adds some simple clk definitions and
very simple minded power management.  The gpio code is tweeked and some
additional devices are added to devices.c.  The Makefile uses -mv4e as
apparently, the only difference a v4m (m5441x) and a v4e is the later has a
FPU, which I don't think should matter to us in the kernel.

Signed-off-by: Steven King 
---
 arch/m68k/Kconfig.cpu   |8 +
 arch/m68k/Makefile  |1 +
 arch/m68k/include/asm/gpio.h|   10 +-
 arch/m68k/include/asm/m5441xsim.h   |  270 +++
 arch/m68k/include/asm/m54xxacr.h|4 +
 arch/m68k/include/asm/mcfclk.h  |   43 +
 arch/m68k/include/asm/mcfgpio.h |   30 +++-
 arch/m68k/include/asm/mcfsim.h  |2 +
 arch/m68k/include/asm/mcftimer.h|2 +-
 arch/m68k/platform/coldfire/Makefile|1 +
 arch/m68k/platform/coldfire/clk.c   |  107 +++-
 arch/m68k/platform/coldfire/device.c|   57 ++-
 arch/m68k/platform/coldfire/intc-simr.c |   26 ++-
 arch/m68k/platform/coldfire/m5441x.c|  224 +
 arch/m68k/platform/coldfire/timers.c|2 +-
 15 files changed, 763 insertions(+), 24 deletions(-)

diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
index 09fbdc3..d6f1938 100644
--- a/arch/m68k/Kconfig.cpu
+++ b/arch/m68k/Kconfig.cpu
@@ -253,6 +253,14 @@ config M548x
help
  Freescale ColdFire 5480/5481/5482/5483/5484/5485 processor support.

+config M5441x
+   bool "MCF5441x"
+   depends on !MMU
+   select GENERIC_CLOCKEVENTS
+   select HAVE_CACHE_CB
+   help
+ Freescale Coldfire 54410/54415/54416/54417/54418 processor support.
+
 endif # COLDFIRE


diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index b7f2e2d..59b11c4 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -41,6 +41,7 @@ cpuflags-$(CONFIG_M68030) :=
 cpuflags-$(CONFIG_M68020)  :=
 cpuflags-$(CONFIG_M68360)  := -m68332
 cpuflags-$(CONFIG_M68000)  := -m68000
+cpuflags-$(CONFIG_M5441x)  := $(call cc-option,-mcpu=54455,-mcfv4e)
 cpuflags-$(CONFIG_M54xx)   := $(call cc-option,-mcpu=5475,-m5200)
 cpuflags-$(CONFIG_M5407)   := $(call cc-option,-mcpu=5407,-m5200)
 cpuflags-$(CONFIG_M532x)   := $(call cc-option,-mcpu=532x,-m5307)
diff --git a/arch/m68k/include/asm/gpio.h b/arch/m68k/include/asm/gpio.h
index 5308622..4395ffc 100644
--- a/arch/m68k/include/asm/gpio.h
+++ b/arch/m68k/include/asm/gpio.h
@@ -64,8 +64,14 @@ static inline void gpio_set_value(unsigned gpio, int value)

 static inline int gpio_to_irq(unsigned gpio)
 {
-   return (gpio < MCFGPIO_IRQ_MAX) ? gpio + MCFGPIO_IRQ_VECBASE
-   : __gpio_to_irq(gpio);
+#if defined(MCFGPIO_IRQ_MIN)
+   if ((gpio >= MCFGPIO_IRQ_MIN) && (gpio < MCFGPIO_IRQ_MAX))
+#else
+   if (gpio < MCFGPIO_IRQ_MAX)
+#endif
+   return gpio + MCFGPIO_IRQ_VECBASE;
+   else
+   return __gpio_to_irq(gpio);
 }

 static inline int irq_to_gpio(unsigned irq)
diff --git a/arch/m68k/include/asm/m5441xsim.h 
b/arch/m68k/include/asm/m5441xsim.h
new file mode 100644
index 000..86315a9
--- /dev/null
+++ b/arch/m68k/include/asm/m5441xsim.h
@@ -0,0 +1,270 @@
+/*
+ * m5441xsim.h -- Coldfire 5441x register definitions
+ *
+ * (C) Copyright 2012, Steven King 
+*/
+
+#ifndef m5441xsim_h
+#define m5441xsim_h
+
+#define CPU_NAME   "COLDFIRE(m5441x)"
+#define CPU_INSTR_PER_JIFFY2
+#define MCF_BUSCLK (MCF_CLK / 2)
+
+#include 
+
+/*
+ *  Reset Controller Module.
+ */
+
+#defineMCF_RCR 0xec09
+#defineMCF_RSR 0xec090001
+
+#defineMCF_RCR_SWRESET 0x80/* Software reset bit */
+#defineMCF_RCR_FRCSTOUT0x40/* Force external reset 
*/
+
+/*
+ *  Interrupt Controller Modules.
+ */
+/* the 5441x have 3 interrupt controllers, each control 64 interrupts */
+#define MCFINT_VECBASE 64
+#define MCFINT0_VECBASEMCFINT_VECBASE
+#define MCFINT1_VECBASE(MCFINT0_VECBASE + 64)
+#define MCFINT2_VECBASE(MCFINT1_VECBASE + 64)
+
+/* interrupt controller 0 */
+#define MCFINTC0_SIMR  0xfc04801c
+#define MCFINTC0_CIMR  0xfc04801d
+#defineMCFINTC0_ICR0   0xfc048040
+/* interrupt controller 1 */
+#define MCFINTC1_SIMR  0xfc04c01c
+#define MCFINTC1_CIMR  0xfc04c01d
+#defineMCFINTC1_ICR0   0xfc04c040
+/* interrupt controller 2 */
+#define MCFINTC2_SIMR  0xfc05001c
+#define MCFINTC2_CIMR  0xfc05001d
+#defineMCFINTC2_ICR0   0xfc050040
+
+/* on interru

Re: [uClinux-dev] [RFC/PATCH] m68knommu: refactor Coldfire GPIO not to require GPIOLIB, eliminate mcf_gpio_chips.

2012-06-06 Thread Greg Ungerer

On 07/06/12 00:20, Steven King wrote:

On Wednesday 06 June 2012 12:07:33 am Greg Ungerer wrote:

Hi Steven,

On 06/06/12 00:23, Steven King wrote:

On Monday 04 June 2012 11:27:04 pm Greg Ungerer wrote:

On 22/05/12 06:10, Steven King wrote:

If we're not connecting external GPIO extenders via i2c or spi or
whatever, we probably don't need GPIOLIB.  If we provide an alternate
implementation of the GPIOLIB functions to use when only on-chip GPIO
is needed, we can change ARCH_REQUIRE_GPIOLIB to
ARCH_WANTS_OPTIONAL_GPIOLIB so that GPIOLIB becomes optional.

The downside is that in the GPIOLIB=n case, we lose all error checking
done by gpiolib, ie multiply allocating the gpio, free'ing gpio etc.,
so that the only checking that can be done is if we reference a gpio on
an external part. Targets that need the extra error checking can still
select GPIOLIB=y.

For the case where GPIOLIB=y, we can simplify the table of gpio chips
to use a single chip, eliminating the tables of chips in the 5xxx.c
files. The original motivation for the definition of multiple chips was
to match the way many of the Coldfire variants defined their gpio as a
spare array in memory. However, all this really gains us is some error
checking when we request a gpio, gpiolib can check that it doesn't fall
in one of the holes.  If thats important, I think we can still come up
with a better way of accomplishing that.

Also in this patch is some general cleanup and reorganizing of the gpio
header files (I'm sure I must have had a reason why I sometimes used a
prefix of mcf_gpio and other times mcfgpio but for the life of me I
can't think of it now).

Signed-off-by: Steven King


This looks pretty good to me. I like the simplified setup and use.
If you are still happy with it I can apply to the for-next branch of
the m68knommu git tree?


Yes, please do.  Thanks.


Ok, done. I had a merge conflict on Kconfig.cpu, but I thinked I
fixed it up right.


Yeah, I ran into that conflict too when I rebased my trees;  curious, I looked
at the log and that ARCH_HAVE_CUSTOM_GPIO_H was added by Mark Brown, and from
the commit message it sounds like removing it as you did may break whatever
it was he was intending. (cc'ing Mark).


Relooking at it you may be right. It still compiles for coldfire
the way I did it. Wasn't sure if it only made sense to have
ARCH_HAVE_CUSTOM_GPIO_H if you also had ARCH_REQUIRE_GPIOLIB on.

In any, I have changed the patch on for-next to leave the
ARCH_HAVE_CUSTOM_GPIO_H in place. It does no harm being there.

Regards
Greg




Greg Ungerer  --  Principal EngineerEMAIL: g...@snapgear.com
SnapGear Group, McAfee  PHONE:   +61 7 3435 2888
8 Gardner Close FAX: +61 7 3217 5323
Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] [PATCH] m68knommu: Add support for the Coldfire 5251/5253

2012-06-06 Thread Greg Ungerer

Hi Steven,

On 06/06/12 01:23, Steven King wrote:

Basic support for the Coldfire 5251/5253.

Signed-off-by: Steven king
---
  arch/m68k/Kconfig.cpu   |8 ++
  arch/m68k/Makefile  |1 +
  arch/m68k/include/asm/dma.h |4 +-
  arch/m68k/include/asm/m525xsim.h|  196 +++
  arch/m68k/include/asm/mcfgpio.h |8 +-
  arch/m68k/include/asm/mcfsim.h  |3 +
  arch/m68k/include/asm/mcfuart.h |4 +-
  arch/m68k/platform/coldfire/Makefile|1 +
  arch/m68k/platform/coldfire/head.S  |6 +-
  arch/m68k/platform/coldfire/intc-525x.c |   91 ++
  arch/m68k/platform/coldfire/m525x.c |   66 +++
  11 files changed, 378 insertions(+), 10 deletions(-)


I have pushed this onto the for-next branch of the m68knommu git tree.

We definitely need to work on merging the m5249sim.h and m525xsim.h,
they have way to much in common.

Regards
Greg



--

Greg Ungerer  --  Principal EngineerEMAIL: g...@snapgear.com
SnapGear Group, McAfee  PHONE:   +61 7 3435 2888
8 Gardner Close FAX: +61 7 3217 5323
Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] [PATCH] coldfire-qspi: Add support for the Coldfire 5251/5253.

2012-06-06 Thread Greg Ungerer

On 06/06/12 02:24, Steven King wrote:

The Coldfire 5251/5253 have a QSPI controller.  Enable selection of the
coldfire-qspi driver if the M525x is selected.

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


Applied to for-next branch of m68knommu git tree.

Regards
Greg




diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index cd2fe35..cb90bc6 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -125,7 +125,7 @@ config SPI_BUTTERFLY

  config SPI_COLDFIRE_QSPI
tristate "Freescale Coldfire QSPI controller"
-   depends on (M520x || M523x || M5249 || M527x || M528x || M532x)
+   depends on (M520x || M523x || M5249 || M525x || M527x || M528x || M532x)
help
  This enables support for the Coldfire QSPI controller in master
  mode.






--

Greg Ungerer  --  Principal EngineerEMAIL: g...@snapgear.com
SnapGear Group, McAfee  PHONE:   +61 7 3435 2888
8 Gardner Close FAX: +61 7 3217 5323
Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] [PATCH] m68knommu: use MCF_IRQ_PIT1 instead of MCFINT_VECBASE + MCFINT_PIT1

2012-06-06 Thread Greg Ungerer

On 07/06/12 07:02, Steven King wrote:

use MCF_IRQ_PIT1 instead of MCFINT_VECBASE + MCFINT_PIT1 so we can support
those parts that have the pit1 interrupt on other than the first interrupt
controller.

Signed-off-by: Steven King


Looks good. Applied to for-next branch of m68knommu git tree.

Thanks
Greg



--

Greg Ungerer  --  Principal EngineerEMAIL: g...@snapgear.com
SnapGear Group, McAfee  PHONE:   +61 7 3435 2888
8 Gardner Close FAX: +61 7 3217 5323
Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] [PATCH] m68knommu: Add support for the Freescale m5253demo board.

2012-06-06 Thread Greg Ungerer

Hi Steven,

On 06/06/12 02:48, Steven King wrote:

Add basic support for the m5253demo using the dm9000 ethernet controller.


Is the m5253demo a real board?
Or do you mean Freescale's M5253EVB board?

If it is really the m5235evb then we should use that name for its files.

And generally for a common denominator like the m5253evb I have just
used the basic m5253.c as the base board support. A good portion of
people use the same basic layout, you end up with a lot of boards
that have the same (or similar) peripheral components hooked up in
the same way. Those that are really different can have their own board
files.

Regards
Greg




This patch is against m68knommu/for-next and is on top of the m5251/5253
patch.

Signed-off-by: Steven King
---
  arch/m68k/Kconfig.machine   |7 +
  arch/m68k/configs/m5253demo_defconfig   |  858 +++
  arch/m68k/include/asm/io_no.h   |8 +
  arch/m68k/include/asm/m525xsim.h|3 +
  arch/m68k/platform/coldfire/Makefile|1 +
  arch/m68k/platform/coldfire/m5253demo.c |  161 ++
  6 files changed, 1038 insertions(+)

diff --git a/arch/m68k/Kconfig.machine b/arch/m68k/Kconfig.machine
index 7cdf6b0..10c97dc 100644
--- a/arch/m68k/Kconfig.machine
+++ b/arch/m68k/Kconfig.machine
@@ -252,6 +252,13 @@ config M5249C3
help
  Support for the Motorola M5249C3 board.

+config M5253DEMO
+   bool "Freescale M5253DEMO board support"
+   depends on M525x
+   select FREESCALE
+   help
+ Support for the Freescale M5253DEMO board.
+
  config M5271EVB
bool "Freescale (Motorola) M5271EVB board support"
depends on M5271
diff --git a/arch/m68k/configs/m5253demo_defconfig 
b/arch/m68k/configs/m5253demo_defconfig
new file mode 100644
index 000..d01de29
--- /dev/null
+++ b/arch/m68k/configs/m5253demo_defconfig
@@ -0,0 +1,858 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux/m68k 3.5.0-rc1 Kernel Configuration
+#
+CONFIG_M68K=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_CSUM=y
+CONFIG_TIME_LOW_RES=y
+CONFIG_NO_IOPORT=y
+# CONFIG_NO_DMA is not set
+CONFIG_ZONE_DMA=y
+CONFIG_CPU_HAS_NO_BITFIELDS=y
+CONFIG_CPU_HAS_NO_MULDIV64=y
+CONFIG_HZ=100
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_DEFAULT_HOSTNAME="(none)"
+# CONFIG_SYSVIPC is not set
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_FHANDLE is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+
+#
+# IRQ subsystem
+#
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_SHOW=y
+
+#
+# RCU Subsystem
+#
+CONFIG_TINY_RCU=y
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+# CONFIG_CHECKPOINT_RESTORE is not set
+# CONFIG_NAMESPACES is not set
+# CONFIG_SCHED_AUTOGROUP is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EXPERT=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+# CONFIG_FUTEX is not set
+# CONFIG_EPOLL is not set
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+# CONFIG_AIO is not set
+CONFIG_EMBEDDED=y
+
+#
+# Kernel Performance Events And Counters
+#
+# CONFIG_VM_EVENT_COUNTERS is not set
+CONFIG_COMPAT_BRK=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_MMAP_ALLOW_UNINITIALIZED is not set
+# CONFIG_PROFILING is not set
+
+#
+# GCOV-based kernel profiling
+#
+# CONFIG_GCOV_KERNEL is not set
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+# CONFIG_LBDAF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_BSGLIB is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+# CONFIG_INLINE_SPIN_TRYLOCK is not set
+# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK is not set
+# CONFIG_INLINE_SPIN_LOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
+# CON

Re: [uClinux-dev] [PATCH] m68knommu: Add support for the Coldfire 5251/5253

2012-06-06 Thread Steven King
On Wednesday 06 June 2012 8:26:14 pm Greg Ungerer wrote:
> Hi Steven,
>
> On 06/06/12 01:23, Steven King wrote:
> > Basic support for the Coldfire 5251/5253.
> >
> > Signed-off-by: Steven king
> > ---
> >   arch/m68k/Kconfig.cpu   |8 ++
> >   arch/m68k/Makefile  |1 +
> >   arch/m68k/include/asm/dma.h |4 +-
> >   arch/m68k/include/asm/m525xsim.h|  196
> > +++ arch/m68k/include/asm/mcfgpio.h |
> >8 +-
> >   arch/m68k/include/asm/mcfsim.h  |3 +
> >   arch/m68k/include/asm/mcfuart.h |4 +-
> >   arch/m68k/platform/coldfire/Makefile|1 +
> >   arch/m68k/platform/coldfire/head.S  |6 +-
> >   arch/m68k/platform/coldfire/intc-525x.c |   91 ++
> >   arch/m68k/platform/coldfire/m525x.c |   66 +++
> >   11 files changed, 378 insertions(+), 10 deletions(-)
>
> I have pushed this onto the for-next branch of the m68knommu git tree.
>
> We definitely need to work on merging the m5249sim.h and m525xsim.h,
> they have way to much in common.

Yes, I agree.  My current thinking is that once I have my target features for 
the '53 working (alsa SoC audio, maybe the ata and maybe the usb), go back 
and figure out what bits dont apply to the '49.  A lot should be the same, 
but you know how Freescale is, they like to make slight variations of the 
same IP block.
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] [PATCH] m68knommu: Add support for the Freescale m5253demo board.

2012-06-06 Thread Steven King
On Wednesday 06 June 2012 9:04:09 pm Greg Ungerer wrote:
> Hi Steven,
>
> On 06/06/12 02:48, Steven King wrote:
> > Add basic support for the m5253demo using the dm9000 ethernet controller.
>
> Is the m5253demo a real board?
> Or do you mean Freescale's M5253EVB board?
>
> If it is really the m5235evb then we should use that name for its files.
>
> And generally for a common denominator like the m5253evb I have just
> used the basic m5253.c as the base board support. A good portion of
> people use the same basic layout, you end up with a lot of boards
> that have the same (or similar) peripheral components hooked up in
> the same way. Those that are really different can have their own board
> files.

No the m5253demo is a real board:
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=M5253DEMO
distinct from the m5253evb:
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=M5253EVB

like most of the freescale 'demo' boards, smaller, cheaper, and a different 
peripheral set;  I dont think the evb has the wm8731 but does has a tft 
display connector and a keypad, the m5253demo has more ram?... really they 
are quite different.
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev