[PATCH 09/12] introduce pr_fmt
With this the files can give more context to their pr_* messages by specifying a at the beginning of the files. Basically the same mechanism as in the Kernel. Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- include/printk.h | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/include/printk.h b/include/printk.h index 82be308..1d45616 100644 --- a/include/printk.h +++ b/include/printk.h @@ -55,14 +55,18 @@ int dev_printf(const struct device_d *dev, const char *format, ...) ret;\ }) -#define pr_emerg(fmt, arg...) __pr_printk(0, fmt, ##arg) -#define pr_alert(fmt, arg...) __pr_printk(1, fmt, ##arg) -#define pr_crit(fmt, arg...) __pr_printk(2, fmt, ##arg) -#define pr_warning(fmt, arg...)__pr_printk(3, fmt, ##arg) -#define pr_err(fmt, arg...)__pr_printk(4, fmt, ##arg) -#define pr_notice(fmt, arg...) __pr_printk(5, fmt, ##arg) -#define pr_info(fmt, arg...) __pr_printk(6, fmt, ##arg) -#define pr_debug(fmt, arg...) __pr_printk(7, fmt, ##arg) -#define debug(fmt, arg...) __pr_printk(7, fmt, ##arg) +#ifndef pr_fmt +#define pr_fmt(fmt) fmt +#endif + +#define pr_emerg(fmt, arg...) __pr_printk(0, pr_fmt(fmt), ##arg) +#define pr_alert(fmt, arg...) __pr_printk(1, pr_fmt(fmt), ##arg) +#define pr_crit(fmt, arg...) __pr_printk(2, pr_fmt(fmt), ##arg) +#define pr_warning(fmt, arg...)__pr_printk(3, pr_fmt(fmt), ##arg) +#define pr_err(fmt, arg...)__pr_printk(4, pr_fmt(fmt), ##arg) +#define pr_notice(fmt, arg...) __pr_printk(5, pr_fmt(fmt), ##arg) +#define pr_info(fmt, arg...) __pr_printk(6, pr_fmt(fmt), ##arg) +#define pr_debug(fmt, arg...) __pr_printk(7, pr_fmt(fmt), ##arg) +#define debug(fmt, arg...) __pr_printk(7, pr_fmt(fmt), ##arg) #endif -- 1.7.10.4 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 02/12] mtd m25p80: consistenly switch to dev_* messages
Also, fix variable names in m25p80_write debug message. Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- drivers/mtd/devices/m25p80.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 428d126..55b1020 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -408,7 +408,8 @@ static int m25p80_write(struct mtd_info *mtd, loff_t to, size_t len, struct spi_transfer t[2]; struct spi_message m; - debug(m25p80_write %ld bytes at 0x%08lX\n, (unsigned long)count, offset); + dev_dbg(flash-spi-dev, m25p80_write %ld bytes at 0x%08llx\n, + (unsigned long)len, to); spi_message_init(m); memset(t, 0, (sizeof t)); @@ -484,7 +485,7 @@ static int sst_write(struct mtd_info *mtd, loff_t to, size_t len, size_t actual; int cmd_sz, ret; - pr_debug(%s: %s to 0x%08x, len %zd\n, dev_name(flash-spi-dev), + dev_dbg(flash-spi-dev, %s to 0x%08x, len %zd\n, __func__, (u32)to, len); spi_message_init(m); @@ -767,7 +768,7 @@ static const struct spi_device_id *jedec_probe(struct spi_device *spi) */ tmp = spi_write_then_read(spi, code, 1, id, 5); if (tmp 0) { - pr_debug(%s: error %d reading JEDEC ID\n, + dev_dbg(spi-dev, %s: error %d reading JEDEC ID\n, dev_name(spi-dev), tmp); return ERR_PTR(tmp); } @@ -923,7 +924,7 @@ static int m25p_probe(struct device_d *dev) dev_info(dev, %s (%lld Kbytes)\n, id-name, (long long)flash-mtd.size 10); - pr_debug(mtd .name = %s, .size = 0x%llx (%lldMiB) + dev_dbg(dev, mtd .name = %s, .size = 0x%llx (%lldMiB) .erasesize = 0x%.8x (%uKiB) .numeraseregions = %d\n, flash-mtd.name, (long long)flash-mtd.size, (long long)(flash-mtd.size 20), @@ -932,7 +933,7 @@ static int m25p_probe(struct device_d *dev) if (flash-mtd.numeraseregions) for (i = 0; i flash-mtd.numeraseregions; i++) - pr_debug(mtd.eraseregions[%d] = { .offset = 0x%llx, + dev_dbg(dev, mtd.eraseregions[%d] = { .offset = 0x%llx, .erasesize = 0x%.8x (%uKiB), .numblocks = %d }\n, i, (long long)flash-mtd.eraseregions[i].offset, -- 1.7.10.4 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 05/12] nios2: Use unsigned long for __kernel_size_t
Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- arch/nios2/include/asm/posix_types.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/nios2/include/asm/posix_types.h b/arch/nios2/include/asm/posix_types.h index 12906b3..5a901ff 100644 --- a/arch/nios2/include/asm/posix_types.h +++ b/arch/nios2/include/asm/posix_types.h @@ -27,7 +27,7 @@ typedef int __kernel_pid_t; typedef unsigned short __kernel_ipc_pid_t; typedef unsigned short __kernel_uid_t; typedef unsigned short __kernel_gid_t; -typedef unsigned int __kernel_size_t; +typedef unsigned long __kernel_size_t; typedef int__kernel_ssize_t; typedef int__kernel_ptrdiff_t; typedef long __kernel_time_t; -- 1.7.10.4 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 04/12] nios2: Let readl return an unsigned int
Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- arch/nios2/include/asm/io.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/nios2/include/asm/io.h b/arch/nios2/include/asm/io.h index a88f0e2..8ee48e0 100644 --- a/arch/nios2/include/asm/io.h +++ b/arch/nios2/include/asm/io.h @@ -37,7 +37,7 @@ ({unsigned short val;\ asm volatile(ldhio %0, 0(%1) : =r(val) : r (addr)); val; }) #define readl(addr)\ - ({unsigned long val;\ + ({unsigned int val;\ asm volatile(ldwio %0, 0(%1) : =r(val) : r (addr)); val; }) #define writeb(val, addr)\ -- 1.7.10.4 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH] introduce compiletime loglevel
This makes the loglevel configurable at compile time. This allows to optimize away the lesser important messages from the binary. Also added is a pr_fmt macro as in the kernel which allows to define a file specific prefix to the pr_* messages. As a positive side effect pr_debug() and debug() is no longer optimized away by the preprocessor but by gcc. This way we have nice warnings for all the wrong debug calls in the code, so this series also cleans them up and it makes it harder to introduce new wrong debug calls. Sascha Jean-Christophe PLAGNIOL-VILLARD (1): consolidate print* in a single header Sascha Hauer (11): mtd m25p80: consistenly switch to dev_* messages treewide: fix format specifiers nios2: Let readl return an unsigned int nios2: Use unsigned long for __kernel_size_t blackfin: Use unsigned long for __kernel_size_t USB ehci: Use dev_* for messages introduce compile time loglevel introduce pr_fmt ARM mmu: Use pr_debug ARM pcm038: Specify pr_fmt and change messages to pr_* mtd nand: Specify pr_fmt and change messages to pr_* arch/arm/boards/pcm038/pcm038.c |5 ++- arch/arm/cpu/mmu.c | 27 ++-- arch/arm/mach-imx/esdctl.c |4 +- arch/arm/mach-omap/gpmc.c |6 +-- arch/blackfin/include/asm/posix_types.h |2 +- arch/nios2/include/asm/io.h |2 +- arch/nios2/include/asm/posix_types.h|2 +- arch/ppc/lib/board.c|4 +- common/Kconfig | 16 +++ common/environment.c| 10 +++-- common/hush.c |4 +- common/module.c |2 +- common/parser.c |4 +- common/resource.c | 26 --- common/uimage.c |5 ++- drivers/mci/mxs.c |2 +- drivers/mtd/devices/m25p80.c| 11 ++--- drivers/mtd/nand/nand_base.c| 39 + drivers/mtd/nand/nand_bbt.c | 43 +- drivers/mtd/nand/nand_write.c |4 +- drivers/nor/cfi_flash.c | 14 +++--- drivers/nor/cfi_flash.h |4 ++ drivers/usb/host/ehci-hcd.c | 73 +-- fs/tftp.c |4 +- include/common.h| 17 +-- include/driver.h| 29 include/linux/mtd/mtd.h |2 +- include/printk.h| 72 ++ lib/gui/bmp.c |2 +- lib/xfuncs.c|4 +- 30 files changed, 269 insertions(+), 170 deletions(-) create mode 100644 include/printk.h ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 10/12] ARM mmu: Use pr_debug
Also, specify a pr_fmt and add missing GPL header. Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- arch/arm/cpu/mmu.c | 27 --- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c index 40b7ec4..4b6db37 100644 --- a/arch/arm/cpu/mmu.c +++ b/arch/arm/cpu/mmu.c @@ -1,3 +1,24 @@ +/* + * start-pbl.c + * + * Copyright (c) 2009-2013 Sascha Hauer s.ha...@pengutronix.de, Pengutronix + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#define pr_fmt(fmt)mmu: fmt + #include common.h #include init.h #include asm/mmu.h @@ -138,7 +159,7 @@ static int arm_mmu_remap_sdram(struct memory_bank *bank) int i, pte; u32 *ptes; - debug(remapping SDRAM from 0x%08lx (size 0x%08lx)\n, + pr_debug(remapping SDRAM from 0x%08lx (size 0x%08lx)\n, phys, bank-size); /* @@ -150,7 +171,7 @@ static int arm_mmu_remap_sdram(struct memory_bank *bank) ptes = xmemalign(PAGE_SIZE, num_ptes * sizeof(u32)); - debug(ptes: 0x%p ttb_start: 0x%08lx ttb_end: 0x%08lx\n, + pr_debug(ptes: 0x%p ttb_start: 0x%08lx ttb_end: 0x%08lx\n, ptes, ttb_start, ttb_end); for (i = 0; i num_ptes; i++) { @@ -242,7 +263,7 @@ static int mmu_init(void) ttb = memalign(0x1, 0x4000); - debug(ttb: 0x%p\n, ttb); + pr_debug(ttb: 0x%p\n, ttb); /* Set the ttb register */ asm volatile (mcr p15,0,%0,c2,c0,0 : : r(ttb) /*:*/); -- 1.7.10.4 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 08/12] introduce compile time loglevel
Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- common/Kconfig | 16 + include/printk.h | 66 +++--- 2 files changed, 54 insertions(+), 28 deletions(-) diff --git a/common/Kconfig b/common/Kconfig index b60b78b..30d6107 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -637,6 +637,22 @@ endmenu menu Debugging +config COMPILE_LOGLEVEL + int loglevel + default 6 + help + This defines the maximum loglevel compiled into the binary. Less important + messages will be compiled away resulting in a smaller binary. + + 0system is unusable (emerg) + 1action must be taken immediately (alert) + 2critical conditions (crit) + 3error conditions (err) + 4warning conditions (warn) + 5normal but significant condition (notice) + 6informational (info) + 7debug-level messages (debug) + config DEBUG_INFO bool prompt enable debug symbols diff --git a/include/printk.h b/include/printk.h index 9e6f4bd..82be308 100644 --- a/include/printk.h +++ b/include/printk.h @@ -10,49 +10,59 @@ #define MSG_INFO 6/* informational */ #define MSG_DEBUG 7/* debug-level messages */ +#ifdef DEBUG +#define LOGLEVEL MSG_DEBUG +#else +#define LOGLEVEL CONFIG_COMPILE_LOGLEVEL +#endif + /* debugging and troubleshooting/diagnostic helpers. */ int dev_printf(const struct device_d *dev, const char *format, ...) __attribute__ ((format(__printf__, 2, 3))); +#define __dev_printf(level, dev, format, args...) \ + ({ \ + int ret = 0; \ + if (level = LOGLEVEL) \ + ret = dev_printf(dev, format, ##args); \ + ret;\ +}) + #define dev_emerg(dev, format, arg...) \ - dev_printf((dev) , format , ## arg) + __dev_printf(0, (dev) , format , ## arg) #define dev_alert(dev, format, arg...) \ - dev_printf((dev) , format , ## arg) + __dev_printf(1, (dev) , format , ## arg) #define dev_crit(dev, format, arg...) \ - dev_printf((dev) , format , ## arg) + __dev_printf(2, (dev) , format , ## arg) #define dev_err(dev, format, arg...) \ - dev_printf(dev , format , ## arg) + __dev_printf(3, (dev) , format , ## arg) #define dev_warn(dev, format, arg...) \ - dev_printf((dev) , format , ## arg) + __dev_printf(4, (dev) , format , ## arg) #define dev_notice(dev, format, arg...)\ - dev_printf((dev) , format , ## arg) + __dev_printf(5, (dev) , format , ## arg) #define dev_info(dev, format, arg...) \ - dev_printf((dev) , format , ## arg) - -#if defined(DEBUG) + __dev_printf(6, (dev) , format , ## arg) #define dev_dbg(dev, format, arg...) \ - dev_printf((dev) , format , ## arg) -#else -#define dev_dbg(dev, format, arg...) \ - ({ if (0) dev_printf((dev), format, ##arg); 0; }) -#endif + __dev_printf(7, (dev) , format , ## arg) -#define pr_info(fmt, arg...) printk(fmt, ##arg) -#define pr_notice(fmt, arg...) printk(fmt, ##arg) -#define pr_err(fmt, arg...)printk(fmt, ##arg) -#define pr_warning(fmt, arg...)printk(fmt, ##arg) -#define pr_crit(fmt, arg...) printk(fmt, ##arg) -#define pr_alert(fmt, arg...) printk(fmt, ##arg) -#define pr_emerg(fmt, arg...) printk(fmt, ##arg) +#define __pr_printk(level, format, args...) \ + ({ \ + int ret = 0;\ + if (level = LOGLEVEL) \ + ret = printk(format, ##args); \ + ret;\ +}) -#ifdef DEBUG -#define pr_debug(fmt, arg...) printk(fmt, ##arg) -#define debug(fmt, arg...) printf(fmt, ##arg) -#else -#define pr_debug(fmt, arg...) do {} while(0) -#define debug(fmt, arg...) do {} while(0) -#endif +#define pr_emerg(fmt, arg...) __pr_printk(0, fmt, ##arg) +#define pr_alert(fmt, arg...) __pr_printk(1, fmt, ##arg) +#define pr_crit(fmt, arg...) __pr_printk(2, fmt, ##arg) +#define pr_warning(fmt, arg...)__pr_printk(3, fmt, ##arg) +#define pr_err(fmt, arg...)__pr_printk(4, fmt, ##arg) +#define pr_notice(fmt, arg...) __pr_printk(5, fmt, ##arg) +#define pr_info(fmt, arg...) __pr_printk(6, fmt, ##arg) +#define pr_debug(fmt, arg...) __pr_printk(7, fmt, ##arg) +#define debug(fmt, arg...) __pr_printk(7, fmt, ##arg) #endif -- 1.7.10.4 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 01/12] consolidate print* in a single header
From: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- include/common.h | 17 +--- include/driver.h | 29 --- include/printk.h | 58 ++ 3 files changed, 59 insertions(+), 45 deletions(-) create mode 100644 include/printk.h diff --git a/include/common.h b/include/common.h index b1c96de..32a5d96 100644 --- a/include/common.h +++ b/include/common.h @@ -29,6 +29,7 @@ #include linux/kernel.h #include linux/stddef.h #include asm/common.h +#include printk.h /* * sanity check. The Linux Kernel defines only one of __LITTLE_ENDIAN and @@ -48,22 +49,6 @@ #error None of __LITTLE_ENDIAN and __BIG_ENDIAN are defined #endif -#define pr_info(fmt, arg...) printf(fmt, ##arg) -#define pr_notice(fmt, arg...) printf(fmt, ##arg) -#define pr_err(fmt, arg...)printf(fmt, ##arg) -#define pr_warning(fmt, arg...)printf(fmt, ##arg) -#define pr_crit(fmt, arg...) printf(fmt, ##arg) -#define pr_alert(fmt, arg...) printf(fmt, ##arg) -#define pr_emerg(fmt, arg...) printf(fmt, ##arg) - -#ifdef DEBUG -#define pr_debug(fmt, arg...) printf(fmt, ##arg) -#else -#define pr_debug(fmt, arg...) do {} while(0) -#endif - -#define debug(fmt, arg...) pr_debug(fmt, ##arg) - #define BUG() do { \ printf(BUG: failure at %s:%d/%s()!\n, __FILE__, __LINE__, __FUNCTION__); \ panic(BUG!); \ diff --git a/include/driver.h b/include/driver.h index 7ad0374..31f5d69 100644 --- a/include/driver.h +++ b/include/driver.h @@ -358,35 +358,6 @@ static inline int dev_close_default(struct device_d *dev, struct filep *f) return 0; } -/* debugging and troubleshooting/diagnostic helpers. */ - -int dev_printf(const struct device_d *dev, const char *format, ...) - __attribute__ ((format(__printf__, 2, 3))); - - -#define dev_emerg(dev, format, arg...) \ - dev_printf((dev) , format , ## arg) -#define dev_alert(dev, format, arg...) \ - dev_printf((dev) , format , ## arg) -#define dev_crit(dev, format, arg...) \ - dev_printf((dev) , format , ## arg) -#define dev_err(dev, format, arg...) \ - dev_printf(dev , format , ## arg) -#define dev_warn(dev, format, arg...) \ - dev_printf((dev) , format , ## arg) -#define dev_notice(dev, format, arg...)\ - dev_printf((dev) , format , ## arg) -#define dev_info(dev, format, arg...) \ - dev_printf((dev) , format , ## arg) - -#if defined(DEBUG) -#define dev_dbg(dev, format, arg...) \ - dev_printf((dev) , format , ## arg) -#else -#define dev_dbg(dev, format, arg...) \ - ({ if (0) dev_printf((dev), format, ##arg); 0; }) -#endif - struct bus_type { char *name; int (*match)(struct device_d *dev, struct driver_d *drv); diff --git a/include/printk.h b/include/printk.h new file mode 100644 index 000..9e6f4bd --- /dev/null +++ b/include/printk.h @@ -0,0 +1,58 @@ +#ifndef __PRINTK_H +#define __PRINTK_H + +#define MSG_EMERG 0/* system is unusable */ +#define MSG_ALERT 1/* action must be taken immediately */ +#define MSG_CRIT 2/* critical conditions */ +#define MSG_ERR3/* error conditions */ +#define MSG_WARNING4/* warning conditions */ +#define MSG_NOTICE 5/* normal but significant condition */ +#define MSG_INFO 6/* informational */ +#define MSG_DEBUG 7/* debug-level messages */ + +/* debugging and troubleshooting/diagnostic helpers. */ + +int dev_printf(const struct device_d *dev, const char *format, ...) + __attribute__ ((format(__printf__, 2, 3))); + + +#define dev_emerg(dev, format, arg...) \ + dev_printf((dev) , format , ## arg) +#define dev_alert(dev, format, arg...) \ + dev_printf((dev) , format , ## arg) +#define dev_crit(dev, format, arg...) \ + dev_printf((dev) , format , ## arg) +#define dev_err(dev, format, arg...) \ + dev_printf(dev , format , ## arg) +#define dev_warn(dev, format, arg...) \ + dev_printf((dev) , format , ## arg) +#define dev_notice(dev, format, arg...)\ + dev_printf((dev) , format , ## arg) +#define dev_info(dev, format, arg...) \ + dev_printf((dev) , format , ## arg) + +#if defined(DEBUG) +#define dev_dbg(dev, format, arg...) \ + dev_printf((dev) , format , ## arg) +#else +#define dev_dbg(dev, format, arg...) \ + ({ if (0) dev_printf((dev), format, ##arg); 0; }) +#endif + +#define pr_info(fmt, arg...) printk(fmt, ##arg) +#define pr_notice(fmt, arg...) printk(fmt, ##arg) +#define pr_err(fmt, arg...)printk(fmt, ##arg) +#define pr_warning(fmt, arg...)printk(fmt, ##arg) +#define pr_crit(fmt, arg...) printk(fmt, ##arg) +#define pr_alert(fmt,
[PATCH 11/12] ARM pcm038: Specify pr_fmt and change messages to pr_*
Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- arch/arm/boards/pcm038/pcm038.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c index ea50a78..5e9c0fd 100644 --- a/arch/arm/boards/pcm038/pcm038.c +++ b/arch/arm/boards/pcm038/pcm038.c @@ -13,6 +13,7 @@ * * */ +#define pr_fmt(fmt) pcm038: fmt #include common.h #include net.h @@ -170,7 +171,7 @@ static int pcm038_power_init(void) /* Clocks have changed. Notify clients */ clock_notifier_call_chain(); } else { - printf(Failed to initialize PMIC. Will continue with low CPU speed\n); + pr_err(Failed to initialize PMIC. Will continue with low CPU speed\n); } } @@ -315,7 +316,7 @@ static int pcm038_devices_init(void) envdev = NOR; } - printf(Using environment in %s Flash\n, envdev); + pr_notice(Using environment in %s Flash\n, envdev); if (imx_iim_read(1, 1, uid, 6) == 6) armlinux_set_serial(uid); -- 1.7.10.4 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 07/12] USB ehci: Use dev_* for messages
Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- drivers/usb/host/ehci-hcd.c | 73 +++ 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index ad8cf2f..9cce6b6 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -148,7 +148,7 @@ static int ehci_reset(struct ehci_priv *ehci) ehci_writel(ehci-hcor-or_usbcmd, cmd); ret = handshake(ehci-hcor-or_usbcmd, CMD_RESET, 0, 250 * 1000); if (ret 0) { - printf(EHCI fail to reset\n); + dev_err(ehci-dev, fail to reset\n); goto out; } @@ -187,7 +187,7 @@ static int ehci_td_buffer(struct qTD *td, void *buf, size_t sz) } if (idx == 5) { - debug(out of buffer pointers (%u bytes left)\n, sz); + pr_debug(out of buffer pointers (%u bytes left)\n, sz); return -1; } @@ -210,10 +210,10 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer, int ret = 0, i; uint64_t start, timeout_val; - debug(dev=%p, pipe=%lx, buffer=%p, length=%d, req=%p\n, dev, pipe, + dev_dbg(ehci-dev, pipe=%lx, buffer=%p, length=%d, req=%p\n, pipe, buffer, length, req); if (req != NULL) - debug(req=%u (%#x), type=%u (%#x), value=%u (%#x), index=%u\n, + dev_dbg(ehci-dev, (req=%u (%#x), type=%u (%#x), value=%u (%#x), index=%u\n, req-request, req-request, req-requesttype, req-requesttype, le16_to_cpu(req-value), le16_to_cpu(req-value), @@ -258,7 +258,7 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer, (0 15) | (0 12) | (3 10) | (2 8) | (0x80 0); td-qt_token = cpu_to_hc32(token); if (ehci_td_buffer(td, req, sizeof(*req)) != 0) { - debug(unable construct SETUP td\n); + dev_dbg(ehci-dev, unable construct SETUP td\n); goto fail; } *tdp = cpu_to_hc32((uint32_t) td); @@ -280,7 +280,7 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer, ((usb_pipein(pipe) ? 1 : 0) 8) | (0x80 0); td-qt_token = cpu_to_hc32(token); if (ehci_td_buffer(td, buffer, length) != 0) { - printf(unable construct DATA td\n); + dev_err(ehci-dev, unable construct DATA td\n); goto fail; } *tdp = cpu_to_hc32((uint32_t) td); @@ -325,7 +325,7 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer, ret = handshake(ehci-hcor-or_usbsts, STD_ASS, STD_ASS, 100 * 1000); if (ret 0) { - printf(EHCI fail timeout STD_ASS set\n); + dev_err(ehci-dev, fail timeout STD_ASS set\n); goto fail; } @@ -364,7 +364,7 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer, ret = handshake(ehci-hcor-or_usbsts, STD_ASS, 0, 100 * 1000); if (ret 0) { - printf(EHCI fail timeout STD_ASS reset\n); + dev_err(ehci-dev, fail timeout STD_ASS reset\n); goto fail; } @@ -372,7 +372,7 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer, token = hc32_to_cpu(qh-qt_token); if (!(token 0x80)) { - debug(TOKEN=0x%08x\n, token); + dev_dbg(ehci-dev, TOKEN=0x%08x\n, token); switch (token 0xfc) { case 0: toggle = token 31; @@ -398,7 +398,7 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer, dev-act_len = length - ((token 16) 0x7fff); } else { dev-act_len = 0; - debug(dev=%u, usbsts=%#x, p[1]=%#x, p[2]=%#x\n, + dev_dbg(ehci-dev, dev=%u, usbsts=%#x, p[1]=%#x, p[2]=%#x\n, dev-devnum, ehci_readl(ehci-hcor-or_usbsts), ehci_readl(ehci-hcor-or_portsc[0]), ehci_readl(ehci-hcor-or_portsc[1])); @@ -407,7 +407,7 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer, return (dev-status != USB_ST_NOT_PROC) ? 0 : -1; fail: - printf(fail1\n); + dev_err(ehci-dev, fail1\n); td = (void *)hc32_to_cpu(qh-qt_next); while (td != (void *)QT_NEXT_TERMINATE) { qh-qt_next = td-qt_next; @@ -461,14 +461,14 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, uint32_t *status_reg; if (le16_to_cpu(req-index) = CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS) { - printf(The request
[PATCH 12/12] mtd nand: Specify pr_fmt and change messages to pr_*
Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- drivers/mtd/nand/nand_base.c | 39 - drivers/mtd/nand/nand_bbt.c | 43 ++--- drivers/mtd/nand/nand_write.c |4 +++- include/linux/mtd/mtd.h |2 +- 4 files changed, 48 insertions(+), 40 deletions(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index fe9a6e7..411aba7 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -31,6 +31,9 @@ * published by the Free Software Foundation. * */ + +#define pr_fmt(fmt) nand: fmt + #include common.h #include errno.h #include clock.h @@ -1074,19 +1077,19 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip, chip-read_byte(mtd) != 'F' || chip-read_byte(mtd) != 'I') return 0; - printk(KERN_INFO ONFI flash detected ... ); + pr_info(ONFI flash detected ... ); chip-cmdfunc(mtd, NAND_CMD_PARAM, 0, -1); for (i = 0; i 3; i++) { chip-read_buf(mtd, (uint8_t *)p, sizeof(*p)); if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 254) == le16_to_cpu(p-crc)) { - printk(KERN_INFO ONFI param page %d valid\n, i); + pr_info(ONFI param page %d valid\n, i); break; } } if (i == 3) { - printk(KERN_INFO no valid ONFI param page found\n); + pr_info(no valid ONFI param page found\n); return 0; } @@ -1106,7 +1109,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip, chip-onfi_version = 0; if (!chip-onfi_version) { - printk(KERN_INFO unsupported ONFI version: %d\n, val); + pr_info(unsupported ONFI version: %d\n, val); return 0; } @@ -1170,7 +1173,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, id_data[1] = chip-read_byte(mtd); if (id_data[0] != *maf_id || id_data[1] != dev_id) { - printk(KERN_ERR %s: second ID read did not match + pr_err(%s: second ID read did not match %02x,%02x against %02x,%02x\n, __func__, *maf_id, dev_id, id_data[0], id_data[1]); return ERR_PTR(-ENODEV); @@ -1191,7 +1194,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, if (ret) goto ident_done; else { - printk(KERN_ERR NAND type unknown: %02x,%02x\n, *maf_id, dev_id); + pr_err(NAND type unknown: %02x,%02x\n, *maf_id, dev_id); return ERR_PTR(-ENODEV); } } @@ -1329,10 +1332,10 @@ ident_done: * chip correct ! */ if (busw != (chip-options NAND_BUSWIDTH_16)) { - printk(KERN_INFO NAND device: Manufacturer ID: + pr_info(NAND device: Manufacturer ID: 0x%02x, Chip ID: 0x%02x (%s %s)\n, *maf_id, dev_id, nand_manuf_ids[maf_idx].name, mtd-name); - printk(KERN_WARNING NAND bus width %d instead %d bit\n, + pr_warning(NAND bus width %d instead %d bit\n, (chip-options NAND_BUSWIDTH_16) ? 16 : 8, busw ? 16 : 8); return ERR_PTR(-EINVAL); @@ -1367,7 +1370,7 @@ ident_done: if (mtd-writesize 512 chip-cmdfunc == nand_command) chip-cmdfunc = nand_command_lp; - printk(NAND device: Manufacturer ID: 0x%02x, Chip ID: 0x%02x (%s %s), + pr_notice(Manufacturer ID: 0x%02x, Chip ID: 0x%02x (%s %s), page size: %d, OOB size: %d\n, *maf_id, dev_id, nand_manuf_ids[maf_idx].name, chip-onfi_version ? chip-onfi_params.model : type-name, @@ -1393,7 +1396,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips) struct nand_flash_dev *type; if (chip-options NAND_BUSWIDTH_AUTO !chip-set_buswidth) { - printk(KERN_ERR buswidth detection but no buswidth callback\n); + pr_err(buswidth detection but no buswidth callback\n); return -EINVAL; } @@ -1406,7 +1409,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips) type = nand_get_flash_type(mtd, chip, busw, nand_maf_id); if (IS_ERR(type)) { - printk(KERN_WARNING No NAND device found (%ld)!\n, PTR_ERR(type)); + pr_warning(No NAND device found (%ld)!\n, PTR_ERR(type)); chip-select_chip(mtd, -1); return PTR_ERR(type); } @@ -1422,7 +1425,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips) break; } if
[PATCH 03/12] treewide: fix format specifiers
Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- arch/arm/mach-imx/esdctl.c |4 ++-- arch/arm/mach-omap/gpmc.c |6 +++--- arch/ppc/lib/board.c |4 ++-- common/environment.c | 10 ++ common/hush.c |4 +--- common/module.c|2 +- common/parser.c|4 +--- common/resource.c | 26 +++--- common/uimage.c|5 +++-- drivers/mci/mxs.c |2 +- drivers/nor/cfi_flash.c| 14 +- drivers/nor/cfi_flash.h|4 fs/tftp.c |4 ++-- lib/gui/bmp.c |2 +- lib/xfuncs.c |4 ++-- 15 files changed, 57 insertions(+), 38 deletions(-) diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c index dd70e6d..841a9ed 100644 --- a/arch/arm/mach-imx/esdctl.c +++ b/arch/arm/mach-imx/esdctl.c @@ -168,8 +168,8 @@ static inline unsigned long imx_v4_sdram_size(void __iomem *esdctlbase, int cs) static void add_mem(unsigned long base0, unsigned long size0, unsigned long base1, unsigned long size1) { - debug(%s: cs0 base: 0x%08x cs0 size: 0x%08x\n, __func__, base0, size0); - debug(%s: cs1 base: 0x%08x cs1 size: 0x%08x\n, __func__, base1, size1); + debug(%s: cs0 base: 0x%08lx cs0 size: 0x%08lx\n, __func__, base0, size0); + debug(%s: cs1 base: 0x%08lx cs1 size: 0x%08lx\n, __func__, base1, size1); if (base0 + size0 == base1 size1 0) { /* diff --git a/arch/arm/mach-omap/gpmc.c b/arch/arm/mach-omap/gpmc.c index 3aaa4f6..bb84b38 100644 --- a/arch/arm/mach-omap/gpmc.c +++ b/arch/arm/mach-omap/gpmc.c @@ -89,7 +89,7 @@ void gpmc_generic_init(unsigned int cfg) * But NEVER run me in XIP mode! I will Die! */ while (x GPMC_NUM_CS) { - debug(gpmccs=%d Reg:0x%x -0x0\n, x, reg); + debug(gpmccs=%d Reg:0x%p -0x0\n, x, reg); writel(0x0, reg); reg += GPMC_CONFIG_CS_SIZE; x++; @@ -119,14 +119,14 @@ void gpmc_cs_config(char cs, struct gpmc_config *config) /* Write the CFG1-6 regs */ while (x 6) { - debug(gpmccfg%d Reg:0x%x -0x%08x\n, + debug(gpmccfg%d Reg:0x%p -0x%08x\n, x, reg, config-cfg[x]); writel(config-cfg[x], reg); reg += GPMC_CONFIG_REG_OFF; x++; } /* reg now points to CFG7 */ - debug(gpmccfg%d Reg:0x%x -0x%08x\n, + debug(gpmccfg%d Reg:0x%p -0x%08x\n, x, reg, (0x1 6) |/* CS enable */ ((config-size 0xF) 8) | /* Size */ ((config-base 24) 0x3F)); diff --git a/arch/ppc/lib/board.c b/arch/ppc/lib/board.c index d219862..18d2588 100644 --- a/arch/ppc/lib/board.c +++ b/arch/ppc/lib/board.c @@ -52,8 +52,8 @@ void board_init_r (ulong end_of_ram) */ malloc_end = (_text_base - (128 10)) ~(4095); - debug(malloc_end: 0x%08x\n, malloc_end); - debug(TEXT_BASE after relocation: 0x%08x\n, _text_base); + debug(malloc_end: 0x%08lx\n, malloc_end); + debug(TEXT_BASE after relocation: 0x%08lx\n, _text_base); mem_malloc_init((void *)(malloc_end - MALLOC_SIZE), (void *)(malloc_end - 1)); diff --git a/common/environment.c b/common/environment.c index e11cd9d..379e76e 100644 --- a/common/environment.c +++ b/common/environment.c @@ -106,11 +106,13 @@ int file_save_action(const char *filename, struct stat *statbuf, memcpy(data-writep, path, len); inode-size = ENVFS_32(len); data-writep += PAD4(len); - debug(handling symlink %s size %ld namelen %d headerlen %d\n, filename + strlen(data-base), - len, namelen, ENVFS_32(inode-headerlen)); + debug(handling symlink %s size %d namelen %d headerlen %d\n, + filename + strlen(data-base), + len, namelen, ENVFS_32(inode-headerlen)); } else { - debug(handling file %s size %ld namelen %d headerlen %d\n, filename + strlen(data-base), - statbuf-st_size, namelen, ENVFS_32(inode-headerlen)); + debug(handling file %s size %lld namelen %d headerlen %d\n, + filename + strlen(data-base), + statbuf-st_size, namelen, ENVFS_32(inode-headerlen)); inode-size = ENVFS_32(statbuf-st_size); fd = open(filename, O_RDONLY); diff --git a/common/hush.c b/common/hush.c index f9e6411..1f468f6 100644 --- a/common/hush.c +++ b/common/hush.c @@ -937,14 +937,12 @@ static int run_list_real(struct p_context *ctx, struct pipe *pi) return rcode; } -#ifdef DEBUG /* broken, of course, but OK for testing */ -static char *indenter(int i) +static
[PATCH] ARM OMAP: move lowlevel board code to lowlevel.c
This moves the board specific lowlevel code to a separate file for the omap (and am33xx) boards. This is just a preparation for the barebox-arm-entry series which needs the SDRAM setup in lowlevel code rather than initcalls. No functional change in this series. Sascha Sascha Hauer (6): ARM omap3 beagle: move lowlevel code to lowlevel.c ARM omap3 phycard-a-l1: move lowlevel code to lowlevel.c ARM omap3 omap343xdsp: move lowlevel code to lowlevel.c ARM omap3 omap3evm: move lowlevel code to lowlevel.c ARM am33xx beaglebone: move lowlevel code to lowlevel.c ARM omap3 beagle: Compile xload defconfig in Thumb2 mode arch/arm/boards/beagle/Makefile |2 + arch/arm/boards/beagle/board.c | 169 --- arch/arm/boards/beagle/lowlevel.c| 167 +++ arch/arm/boards/beaglebone/Makefile |2 + arch/arm/boards/beaglebone/board.c | 240 -- arch/arm/boards/beaglebone/lowlevel.c| 248 ++ arch/arm/boards/omap343xdsp/Makefile |2 + arch/arm/boards/omap343xdsp/board.c | 547 -- arch/arm/boards/omap343xdsp/lowlevel.c | 546 + arch/arm/boards/omap3evm/Makefile|2 + arch/arm/boards/omap3evm/board.c | 158 --- arch/arm/boards/omap3evm/lowlevel.c | 160 +++ arch/arm/boards/phycard-a-l1/Makefile|2 + arch/arm/boards/phycard-a-l1/lowlevel.c | 251 ++ arch/arm/boards/phycard-a-l1/pca-a-l1.c | 247 -- arch/arm/configs/omap3530_beagle_xload_defconfig |2 +- 16 files changed, 1383 insertions(+), 1362 deletions(-) create mode 100644 arch/arm/boards/beagle/lowlevel.c create mode 100644 arch/arm/boards/beaglebone/lowlevel.c create mode 100644 arch/arm/boards/omap343xdsp/lowlevel.c create mode 100644 arch/arm/boards/omap3evm/lowlevel.c create mode 100644 arch/arm/boards/phycard-a-l1/lowlevel.c ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 4/6] ARM omap3 omap3evm: move lowlevel code to lowlevel.c
Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- arch/arm/boards/omap3evm/Makefile |2 + arch/arm/boards/omap3evm/board.c| 158 -- arch/arm/boards/omap3evm/lowlevel.c | 160 +++ 3 files changed, 162 insertions(+), 158 deletions(-) create mode 100644 arch/arm/boards/omap3evm/lowlevel.c diff --git a/arch/arm/boards/omap3evm/Makefile b/arch/arm/boards/omap3evm/Makefile index dcfc293..88c223a 100644 --- a/arch/arm/boards/omap3evm/Makefile +++ b/arch/arm/boards/omap3evm/Makefile @@ -1 +1,3 @@ obj-y += board.o +obj-y += lowlevel.o +pbl-y += lowlevel.o diff --git a/arch/arm/boards/omap3evm/board.c b/arch/arm/boards/omap3evm/board.c index f636fe3..7585541 100644 --- a/arch/arm/boards/omap3evm/board.c +++ b/arch/arm/boards/omap3evm/board.c @@ -47,170 +47,12 @@ #include ns16550.h #include asm/armlinux.h #include mach/omap3-silicon.h -#include mach/sdrc.h -#include mach/sys_info.h -#include mach/syslib.h -#include mach/control.h #include mach/omap3-mux.h #include mach/gpmc.h #include errno.h #include generated/mach-types.h #include mach/omap3-devices.h - -/* - * Boot-time initialization(s) - */ - -/** - * @brief Initialize the SDRC module - * - * @return void - */ -static void sdrc_init(void) -{ - /* SDRAM software reset */ - /* No idle ack and RESET enable */ - writel(0x1A, OMAP3_SDRC_REG(SYSCONFIG)); - sdelay(100); - /* No idle ack and RESET disable */ - writel(0x18, OMAP3_SDRC_REG(SYSCONFIG)); - - /* SDRC Sharing register */ - /* 32-bit SDRAM on data lane [31:0] - CS0 */ - /* pin tri-stated = 1 */ - writel(0x0100, OMAP3_SDRC_REG(SHARING)); - - /* - SDRC Registers Configuration - */ - /* SDRC_MCFG0 register */ - writel(0x02584099, OMAP3_SDRC_REG(MCFG_0)); - - /* SDRC_RFR_CTRL0 register */ - writel(0x54601, OMAP3_SDRC_REG(RFR_CTRL_0)); - - /* SDRC_ACTIM_CTRLA0 register */ - writel(0xA29DB4C6, OMAP3_SDRC_REG(ACTIM_CTRLA_0)); - - /* SDRC_ACTIM_CTRLB0 register */ - writel(0x12214, OMAP3_SDRC_REG(ACTIM_CTRLB_0)); - - /* Disble Power Down of CKE due to 1 CKE on combo part */ - writel(0x0081, OMAP3_SDRC_REG(POWER)); - - /* SDRC_MANUAL command register */ - /* NOP command */ - writel(0x, OMAP3_SDRC_REG(MANUAL_0)); - /* Precharge command */ - writel(0x0001, OMAP3_SDRC_REG(MANUAL_0)); - /* Auto-refresh command */ - writel(0x0002, OMAP3_SDRC_REG(MANUAL_0)); - /* Auto-refresh command */ - writel(0x0002, OMAP3_SDRC_REG(MANUAL_0)); - - /* SDRC MR0 register Burst length=4 */ - writel(0x0032, OMAP3_SDRC_REG(MR_0)); - - /* SDRC DLLA control register */ - writel(0x000A, OMAP3_SDRC_REG(DLLA_CTRL)); - - return; -} - -/** - * @brief Do the necessary pin muxing required for OMAP3EVM. Some pins in OMAP3 - * do not have alternate modes. We don't program these pins. - * - * See @ref MUX_VAL for description of the muxing mode. - * - * @return void - */ -static void mux_config(void) -{ - /* -* SDRC -* - SDRC_D0-SDRC_D31: Default MUX mode is mode0. -*/ - - /* -* GPMC -* - GPMC_D0-GPMC_D7: Default MUX mode is mode0. -* - GPMC_NADV_ALE: Default MUX mode is mode0. -* - GPMC_NOE: Default MUX mode is mode0. -* - GPMC_NWE: Default MUX mode is mode0. -* - GPMC_WAIT0: Default MUX mode is mode0. -*/ - MUX_VAL(CP(GPMC_A1),(IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A2),(IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A3),(IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A4),(IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A5),(IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A6),(IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A7),(IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A8),(IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A9),(IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A10), (IDIS | PTD | DIS | M0)); - - MUX_VAL(CP(GPMC_D8),(IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_D9),(IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_D10), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_D11), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_D12), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_D13), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_D14), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_D15), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_CLK), (IDIS | PTD | DIS | M0)); - - MUX_VAL(CP(GPMC_NBE0_CLE), (IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_NBE1), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_NWP), (IEN |
[PATCH 1/6] ARM omap3 beagle: move lowlevel code to lowlevel.c
Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- arch/arm/boards/beagle/Makefile |2 + arch/arm/boards/beagle/board.c| 169 - arch/arm/boards/beagle/lowlevel.c | 167 3 files changed, 169 insertions(+), 169 deletions(-) create mode 100644 arch/arm/boards/beagle/lowlevel.c diff --git a/arch/arm/boards/beagle/Makefile b/arch/arm/boards/beagle/Makefile index dcfc293..88c223a 100644 --- a/arch/arm/boards/beagle/Makefile +++ b/arch/arm/boards/beagle/Makefile @@ -1 +1,3 @@ obj-y += board.o +obj-y += lowlevel.o +pbl-y += lowlevel.o diff --git a/arch/arm/boards/beagle/board.c b/arch/arm/boards/beagle/board.c index 88096bb..bed4651 100644 --- a/arch/arm/boards/beagle/board.c +++ b/arch/arm/boards/beagle/board.c @@ -55,12 +55,6 @@ #include ns16550.h #include asm/armlinux.h #include generated/mach-types.h -#include mach/omap3-silicon.h -#include mach/sdrc.h -#include mach/sys_info.h -#include mach/syslib.h -#include mach/control.h -#include mach/omap3-mux.h #include mach/gpmc.h #include mach/gpmc_nand.h #include mach/ehci.h @@ -70,169 +64,6 @@ #include usb/ehci.h #include mach/xload.h -/ Board Boot Time ***/ - -/** - * @brief Do the SDRC initialization for 128Meg Micron DDR for CS0 - * - * @return void - */ -static void sdrc_init(void) -{ - /* SDRAM software reset */ - /* No idle ack and RESET enable */ - writel(0x1A, OMAP3_SDRC_REG(SYSCONFIG)); - sdelay(100); - /* No idle ack and RESET disable */ - writel(0x18, OMAP3_SDRC_REG(SYSCONFIG)); - - /* SDRC Sharing register */ - /* 32-bit SDRAM on data lane [31:0] - CS0 */ - /* pin tri-stated = 1 */ - writel(0x0100, OMAP3_SDRC_REG(SHARING)); - - /* - SDRC Registers Configuration - */ - /* SDRC_MCFG0 register */ - writel(0x02584099, OMAP3_SDRC_REG(MCFG_0)); - - /* SDRC_RFR_CTRL0 register */ - writel(0x54601, OMAP3_SDRC_REG(RFR_CTRL_0)); - - /* SDRC_ACTIM_CTRLA0 register */ - writel(0xA29DB4C6, OMAP3_SDRC_REG(ACTIM_CTRLA_0)); - - /* SDRC_ACTIM_CTRLB0 register */ - writel(0x12214, OMAP3_SDRC_REG(ACTIM_CTRLB_0)); - - /* Disble Power Down of CKE due to 1 CKE on combo part */ - writel(0x0081, OMAP3_SDRC_REG(POWER)); - - /* SDRC_MANUAL command register */ - /* NOP command */ - writel(0x, OMAP3_SDRC_REG(MANUAL_0)); - /* Precharge command */ - writel(0x0001, OMAP3_SDRC_REG(MANUAL_0)); - /* Auto-refresh command */ - writel(0x0002, OMAP3_SDRC_REG(MANUAL_0)); - /* Auto-refresh command */ - writel(0x0002, OMAP3_SDRC_REG(MANUAL_0)); - - /* SDRC MR0 register Burst length=4 */ - writel(0x0032, OMAP3_SDRC_REG(MR_0)); - - /* SDRC DLLA control register */ - writel(0x000A, OMAP3_SDRC_REG(DLLA_CTRL)); - - return; -} - -/** - * @brief Do the pin muxing required for Board operation. - * We enable ONLY the pins we require to set. OMAP provides pins which do not - * have alternate modes. Such pins done need to be set. - * - * See @ref MUX_VAL for description of the muxing mode. - * - * @return void - */ -static void mux_config(void) -{ - /* SDRC_D0 - SDRC_D31 default mux mode is mode0 */ - - /* GPMC */ - MUX_VAL(CP(GPMC_A1), (IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A2), (IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A3), (IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A4), (IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A5), (IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A6), (IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A7), (IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A8), (IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A9), (IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_A10), (IDIS | PTD | DIS | M0)); - - /* D0-D7 default mux mode is mode0 */ - MUX_VAL(CP(GPMC_D8), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_D9), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_D10), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_D11), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_D12), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_D13), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_D14), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_D15), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_CLK), (IDIS | PTD | DIS | M0)); - /* GPMC_NADV_ALE default mux mode is mode0 */ - /* GPMC_NOE default mux mode is mode0 */ - /* GPMC_NWE default mux mode is mode0 */ - /* GPMC_NBE0_CLE default mux mode is mode0 */ - MUX_VAL(CP(GPMC_NBE0_CLE), (IDIS | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_NBE1), (IEN | PTD | DIS | M0)); - MUX_VAL(CP(GPMC_NWP), (IEN | PTD | DIS | M0)); - /* GPMC_WAIT0 default mux mode is mode0 */ - MUX_VAL(CP(GPMC_WAIT1), (IEN | PTU | EN | M0)); - - /* SERIAL INTERFACE */ -
[PATCH 2/6] ARM omap3 phycard-a-l1: move lowlevel code to lowlevel.c
Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- arch/arm/boards/phycard-a-l1/Makefile |2 + arch/arm/boards/phycard-a-l1/lowlevel.c | 251 +++ arch/arm/boards/phycard-a-l1/pca-a-l1.c | 247 -- 3 files changed, 253 insertions(+), 247 deletions(-) create mode 100644 arch/arm/boards/phycard-a-l1/lowlevel.c diff --git a/arch/arm/boards/phycard-a-l1/Makefile b/arch/arm/boards/phycard-a-l1/Makefile index 7041e11..5565c3d 100644 --- a/arch/arm/boards/phycard-a-l1/Makefile +++ b/arch/arm/boards/phycard-a-l1/Makefile @@ -15,3 +15,5 @@ # obj-y += pca-a-l1.o +obj-y += lowlevel.o +pbl-y += lowlevel.o diff --git a/arch/arm/boards/phycard-a-l1/lowlevel.c b/arch/arm/boards/phycard-a-l1/lowlevel.c new file mode 100644 index 000..d82c43d --- /dev/null +++ b/arch/arm/boards/phycard-a-l1/lowlevel.c @@ -0,0 +1,251 @@ +#include common.h +#include io.h +#include init.h +#include sizes.h +#include mach/omap3-mux.h +#include mach/sdrc.h +#include mach/control.h +#include mach/syslib.h +#include mach/omap3-silicon.h +#include mach/sys_info.h + +/* Slower full frequency range default timings for x32 operation */ +#define SDP_SDRC_SHARING 0x0100 +/* Diabling power down mode using CKE pin */ +#define SDP_SDRC_POWER_POP 0x0081 +/* rkw - need to find of 90/72 degree recommendation for speed like before. */ +#define SDP_SDRC_DLLAB_CTRL ((DLL_ENADLL 3) | \ + (DLL_LOCKDLL 2) | (DLL_DLLPHASE_90 1)) + +/* used to create an array of memory configuartions. */ +struct sdrc_config { + u32 cs_cfg; + u32 mcfg; + u32 mr; + u32 actim_ctrla; + u32 actim_ctrlb; + u32 rfr_ctrl; +} const sdrc_config[] = { +/* max cs_size for autodetection, common timing */ +/* 2x256MByte, 14 Rows, 10 Columns , RBC (BAL=2) */ +{ 0x0004, 0x03590099, 0x0032, 0x9A9DB4C6, 0x00011216, 0x0004e201}, +/* MT46H32M32LF 2x128MByte, 13 Rows, 10 Columns */ +{ 0x0001, 0x02584099, 0x0032, 0x9A9DB4C6, 0x00011216, 0x0004e201}, +/* MT46H64M32LF 1x256MByte, 14 Rows, 10 Columns */ +{ 0x0002, 0x03588099, 0x0032, 0x629DB4C6, 0x0003, 0x0004e201}, +/* MT64H128M32L2 2x256MByte, 14 Rows, 10 Columns */ +{ 0x0002, 0x03588099, 0x0032, 0x629DB4C6, 0x0003, 0x0004e201}, +}; + +/* + * Boot-time initialization(s) + */ + +/* + * init_sdram_ddr() - Init DDR controller. + */ +void init_sdram_ddr(void) +{ + /* reset sdrc controller */ + writel(SOFTRESET, OMAP3_SDRC_REG(SYSCONFIG)); + wait_on_value(10, 10, OMAP3_SDRC_REG(STATUS), 1200); + writel(0, OMAP3_SDRC_REG(SYSCONFIG)); + + /* setup sdrc to ball mux */ + writel(SDP_SDRC_SHARING, OMAP3_SDRC_REG(SHARING)); + writel(SDP_SDRC_POWER_POP, OMAP3_SDRC_REG(POWER)); + + /* set up dll */ + writel(SDP_SDRC_DLLAB_CTRL, OMAP3_SDRC_REG(DLLA_CTRL)); + sdelay(0x2000); /* give time to lock */ + +} +/* + * config_sdram_ddr() - Init DDR on dev board. + */ +void config_sdram_ddr(u8 cs, u8 cfg) +{ + + writel(sdrc_config[cfg].mcfg, OMAP3_SDRC_REG(MCFG_0) + (0x30 * cs)); + writel(sdrc_config[cfg].actim_ctrla, OMAP3_SDRC_REG(ACTIM_CTRLA_0) + (0x28 * cs)); + writel(sdrc_config[cfg].actim_ctrlb, OMAP3_SDRC_REG(ACTIM_CTRLB_0) + (0x28 * cs)); + writel(sdrc_config[cfg].rfr_ctrl, OMAP3_SDRC_REG(RFR_CTRL_0) + (0x30 * cs)); + + writel(CMD_NOP, OMAP3_SDRC_REG(MANUAL_0) + (0x30 * cs)); + + sdelay(5000); + + writel(CMD_PRECHARGE, OMAP3_SDRC_REG(MANUAL_0) + (0x30 * cs)); + writel(CMD_AUTOREFRESH, OMAP3_SDRC_REG(MANUAL_0) + (0x30 * cs)); + writel(CMD_AUTOREFRESH, OMAP3_SDRC_REG(MANUAL_0) + (0x30 * cs)); + + /* set mr0 */ + writel(sdrc_config[cfg].mr, OMAP3_SDRC_REG(MR_0) + (0x30 * cs)); + + sdelay(2000); +} + +/** + * @brief Initialize the SDRC module + * Initialisation for 1x256MByte but normally + * done by x-loader. + * @return void + */ +static void pcaal1_sdrc_init(void) +{ + u32 test0, test1; + char cfg; + + init_sdram_ddr(); + + config_sdram_ddr(0, 0); /* 256MByte at CS0 */ + config_sdram_ddr(1, 0); /* 256MByte at CS1 */ + + test0 = get_ram_size((long *) 0x8000, SZ_256M); + test1 = get_ram_size((long *) 0xA000, SZ_256M); + + /* mask out lower nible, its not tested with + in common/memsize.c */ + test1 = 0xfff0; + + if ((test1 0) (test1 != test0)) + hang(); + + cfg = -1; /* illegal configuration found */ + + if (test1 == 0) { + init_sdram_ddr(); + writel((sdrc_config[(uchar) cfg].mcfg 0xfffc00ff), OMAP3_SDRC_REG(MCFG_1)); + +
[PATCH 6/6] ARM omap3 beagle: Compile xload defconfig in Thumb2 mode
Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- arch/arm/configs/omap3530_beagle_xload_defconfig |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/configs/omap3530_beagle_xload_defconfig b/arch/arm/configs/omap3530_beagle_xload_defconfig index d951b1c..383ea28 100644 --- a/arch/arm/configs/omap3530_beagle_xload_defconfig +++ b/arch/arm/configs/omap3530_beagle_xload_defconfig @@ -1,7 +1,7 @@ CONFIG_ARCH_OMAP=y CONFIG_OMAP_BUILD_IFT=y CONFIG_MACH_BEAGLE=y -CONFIG_AEABI=y +CONFIG_THUMB2_BAREBOX=y # CONFIG_CMD_ARM_CPUINFO is not set # CONFIG_ARM_EXCEPTIONS is not set CONFIG_TEXT_BASE=0x4020 -- 1.7.10.4 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 5/6] ARM am33xx beaglebone: move lowlevel code to lowlevel.c
Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- arch/arm/boards/beaglebone/Makefile |2 + arch/arm/boards/beaglebone/board.c| 240 --- arch/arm/boards/beaglebone/lowlevel.c | 248 + 3 files changed, 250 insertions(+), 240 deletions(-) create mode 100644 arch/arm/boards/beaglebone/lowlevel.c diff --git a/arch/arm/boards/beaglebone/Makefile b/arch/arm/boards/beaglebone/Makefile index dcfc293..88c223a 100644 --- a/arch/arm/boards/beaglebone/Makefile +++ b/arch/arm/boards/beaglebone/Makefile @@ -1 +1,3 @@ obj-y += board.o +obj-y += lowlevel.o +pbl-y += lowlevel.o diff --git a/arch/arm/boards/beaglebone/board.c b/arch/arm/boards/beaglebone/board.c index f9ac7a4..6eb2c0a 100644 --- a/arch/arm/boards/beaglebone/board.c +++ b/arch/arm/boards/beaglebone/board.c @@ -48,246 +48,6 @@ #include mach/am33xx-mux.h #include mach/wdt.h -/* UART Defines */ -#define UART_SYSCFG_OFFSET (0x54) -#define UART_SYSSTS_OFFSET (0x58) - -#define UART_RESET (0x1 1) -#define UART_CLK_RUNNING_MASK 0x1 -#define UART_SMART_IDLE_EN (0x1 0x3) - -/* AM335X EMIF Register values */ -#define EMIF_SDMGT 0x8000 -#define EMIF_SDRAM 0x4650 -#define EMIF_PHYCFG0x2 -#define DDR_PHY_RESET (0x1 10) -#define DDR_FUNCTIONAL_MODE_EN 0x1 -#define DDR_PHY_READY (0x1 2) -#defineVTP_CTRL_READY (0x1 5) -#define VTP_CTRL_ENABLE(0x1 6) -#define VTP_CTRL_LOCK_EN (0x1 4) -#define VTP_CTRL_START_EN (0x1) -#define DDR2_RATIO 0x80/* for mDDR */ -#define CMD_FORCE 0x00/* common #def */ -#define CMD_DELAY 0x00 - -#define EMIF_READ_LATENCY 0x05 -#define EMIF_TIM1 0x0666B3D6 -#define EMIF_TIM2 0x143731DA -#defineEMIF_TIM3 0x0347 -#define EMIF_SDCFG 0x43805332 -#define EMIF_SDREF 0x081a -#define DDR2_DLL_LOCK_DIFF 0x0 -#define DDR2_RD_DQS0x12 -#define DDR2_PHY_FIFO_WE 0x80 - -#defineDDR2_INVERT_CLKOUT 0x00 -#defineDDR2_WR_DQS 0x00 -#defineDDR2_PHY_WRLVL 0x00 -#defineDDR2_PHY_GATELVL0x00 -#defineDDR2_PHY_WR_DATA0x40 -#definePHY_RANK0_DELAY 0x01 -#define PHY_DLL_LOCK_DIFF 0x0 -#define DDR_IOCTRL_VALUE 0x18B - -static void beaglebone_data_macro_config(int dataMacroNum) -{ - u32 BaseAddrOffset = 0x00;; - - if (dataMacroNum == 1) - BaseAddrOffset = 0xA4; - - __raw_writel(((DDR2_RD_DQS30)|(DDR2_RD_DQS20) - |(DDR2_RD_DQS10)|(DDR2_RD_DQS0)), - (AM33XX_DATA0_RD_DQS_SLAVE_RATIO_0 + BaseAddrOffset)); - __raw_writel(DDR2_RD_DQS2, - (AM33XX_DATA0_RD_DQS_SLAVE_RATIO_1 + BaseAddrOffset)); - __raw_writel(((DDR2_WR_DQS30)|(DDR2_WR_DQS20) - |(DDR2_WR_DQS10)|(DDR2_WR_DQS0)), - (AM33XX_DATA0_WR_DQS_SLAVE_RATIO_0 + BaseAddrOffset)); - __raw_writel(DDR2_WR_DQS2, - (AM33XX_DATA0_WR_DQS_SLAVE_RATIO_1 + BaseAddrOffset)); - __raw_writel(((DDR2_PHY_WRLVL30)|(DDR2_PHY_WRLVL20) - |(DDR2_PHY_WRLVL10)|(DDR2_PHY_WRLVL0)), - (AM33XX_DATA0_WRLVL_INIT_RATIO_0 + BaseAddrOffset)); - __raw_writel(DDR2_PHY_WRLVL2, - (AM33XX_DATA0_WRLVL_INIT_RATIO_1 + BaseAddrOffset)); - __raw_writel(((DDR2_PHY_GATELVL30)|(DDR2_PHY_GATELVL20) - |(DDR2_PHY_GATELVL10)|(DDR2_PHY_GATELVL0)), - (AM33XX_DATA0_GATELVL_INIT_RATIO_0 + BaseAddrOffset)); - __raw_writel(DDR2_PHY_GATELVL2, - (AM33XX_DATA0_GATELVL_INIT_RATIO_1 + BaseAddrOffset)); - __raw_writel(((DDR2_PHY_FIFO_WE30)|(DDR2_PHY_FIFO_WE20) - |(DDR2_PHY_FIFO_WE10)|(DDR2_PHY_FIFO_WE0)), - (AM33XX_DATA0_FIFO_WE_SLAVE_RATIO_0 + BaseAddrOffset)); - __raw_writel(DDR2_PHY_FIFO_WE2, - (AM33XX_DATA0_FIFO_WE_SLAVE_RATIO_1 + BaseAddrOffset)); - __raw_writel(((DDR2_PHY_WR_DATA30)|(DDR2_PHY_WR_DATA20) - |(DDR2_PHY_WR_DATA10)|(DDR2_PHY_WR_DATA0)), - (AM33XX_DATA0_WR_DATA_SLAVE_RATIO_0 + BaseAddrOffset)); - __raw_writel(DDR2_PHY_WR_DATA2, - (AM33XX_DATA0_WR_DATA_SLAVE_RATIO_1 + BaseAddrOffset)); - __raw_writel(PHY_DLL_LOCK_DIFF, - (AM33XX_DATA0_DLL_LOCK_DIFF_0 + BaseAddrOffset)); -} - -static void beaglebone_cmd_macro_config(void) -{ - __raw_writel(DDR2_RATIO, AM33XX_CMD0_CTRL_SLAVE_RATIO_0); - __raw_writel(CMD_FORCE, AM33XX_CMD0_CTRL_SLAVE_FORCE_0); - __raw_writel(CMD_DELAY, AM33XX_CMD0_CTRL_SLAVE_DELAY_0); - __raw_writel(DDR2_DLL_LOCK_DIFF, AM33XX_CMD0_DLL_LOCK_DIFF_0); - __raw_writel(DDR2_INVERT_CLKOUT, AM33XX_CMD0_INVERT_CLKOUT_0); - - __raw_writel(DDR2_RATIO, AM33XX_CMD1_CTRL_SLAVE_RATIO_0); - __raw_writel(CMD_FORCE,
[PATCH 3/6] ARM omap3 omap343xdsp: move lowlevel code to lowlevel.c
Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- arch/arm/boards/omap343xdsp/Makefile |2 + arch/arm/boards/omap343xdsp/board.c| 547 arch/arm/boards/omap343xdsp/lowlevel.c | 546 +++ 3 files changed, 548 insertions(+), 547 deletions(-) create mode 100644 arch/arm/boards/omap343xdsp/lowlevel.c diff --git a/arch/arm/boards/omap343xdsp/Makefile b/arch/arm/boards/omap343xdsp/Makefile index dcfc293..88c223a 100644 --- a/arch/arm/boards/omap343xdsp/Makefile +++ b/arch/arm/boards/omap343xdsp/Makefile @@ -1 +1,3 @@ obj-y += board.o +obj-y += lowlevel.o +pbl-y += lowlevel.o diff --git a/arch/arm/boards/omap343xdsp/board.c b/arch/arm/boards/omap343xdsp/board.c index 6dbbc4c..215fe02 100644 --- a/arch/arm/boards/omap343xdsp/board.c +++ b/arch/arm/boards/omap343xdsp/board.c @@ -50,556 +50,9 @@ #include asm/armlinux.h #include mach/omap3-silicon.h #include mach/omap3-devices.h -#include mach/sdrc.h -#include mach/sys_info.h -#include mach/syslib.h -#include mach/control.h -#include mach/omap3-mux.h #include mach/gpmc.h #include errno.h -/ Board Boot Time ***/ -static void sdrc_init(void); -static void mux_config(void); - -/** - * @brief The basic entry point for board initialization. - * - * This is called as part of machine init (after arch init). - * This is again called with stack in SRAM, so not too many - * constructs possible here. - * - * @return void - */ -static int sdp343x_board_init(void) -{ - int in_sdram = running_in_sdram(); - - if (!in_sdram) - omap3_core_init(); - - mux_config(); - if (!in_sdram) - sdrc_init(); - - return 0; -} -pure_initcall(sdp343x_board_init); - -/** - * @brief Do the SDRC initialization for 128Meg Infenion DDR for CS0 - * - * @return void - */ -static void sdrc_init(void) -{ - /* Issue SDRC Soft reset */ - writel(0x12, OMAP3_SDRC_REG(SYSCONFIG)); -/* Wait until Reset complete */ -while ((readl(OMAP3_SDRC_REG(STATUS)) 0x1) == 0); -/* SDRC to normal mode */ - writel(0x10, OMAP3_SDRC_REG(SYSCONFIG)); - /* SDRC Sharing register */ - /* 32-bit SDRAM on data lane [31:0] - CS0 */ - /* pin tri-stated = 1 */ - writel(0x0100, OMAP3_SDRC_REG(SHARING)); - - /* - SDRC_REG(CS0 Configuration - */ - /* SDRC_REG(MCFG0 register */ - writel(0x02584019, OMAP3_SDRC_REG(MCFG_0)); - - /* SDRC_REG(RFR_CTRL0 register */ - writel(0x0003DE01, OMAP3_SDRC_REG(RFR_CTRL_0)); - - /* SDRC_REG(ACTIM_CTRLA0 register */ - writel(0X5A9A4486, OMAP3_SDRC_REG(ACTIM_CTRLA_0)); - - /* SDRC_REG(ACTIM_CTRLB0 register */ - writel(0x0010, OMAP3_SDRC_REG(ACTIM_CTRLB_0)); - - /* Disble Power Down of CKE cuz of 1 CKE on combo part */ - writel(0x0081, OMAP3_SDRC_REG(POWER)); - - /* SDRC_REG(Manual command register */ - /* NOP command */ - writel(0x, OMAP3_SDRC_REG(MANUAL_0)); - /* Precharge command */ - writel(0x0001, OMAP3_SDRC_REG(MANUAL_0)); - /* Auto-refresh command */ - writel(0x0002, OMAP3_SDRC_REG(MANUAL_0)); - /* Auto-refresh command */ - writel(0x0002, OMAP3_SDRC_REG(MANUAL_0)); - - /* SDRC MR0 register */ - /* CAS latency = 3 */ - /* Write Burst = Read Burst */ - /* Serial Mode */ - writel(0x0032, OMAP3_SDRC_REG(MR_0)); /* Burst length =4 */ - -/* SDRC DLLA control register */ - /* Enable DLL A */ - writel(0x000A, OMAP3_SDRC_REG(DLLA_CTRL)); - -/* wait until DLL is locked */ -while ((readl(OMAP3_SDRC_REG(DLLA_STATUS)) 0x4) == 0); - return; -} - -/** - * @brief Do the pin muxing required for Board operation. - * - * See @ref MUX_VAL for description of the muxing mode. Since some versions - * of Linux depend on all pin muxing being done at barebox level, we may need to - * enable CONFIG_MACH_OMAP_ADVANCED_MUX to enable the full fledged pin muxing. - * - * @return void - */ -static void mux_config(void) -{ - /* Essential MUX Settings */ - MUX_VAL(CP(SDRC_D0), (IEN | PTD | DIS | M0)); /* SDRC_D0 */ - MUX_VAL(CP(SDRC_D1), (IEN | PTD | DIS | M0)); /* SDRC_D1 */ - MUX_VAL(CP(SDRC_D2), (IEN | PTD | DIS | M0)); /* SDRC_D2 */ - MUX_VAL(CP(SDRC_D3), (IEN | PTD | DIS | M0)); /* SDRC_D3 */ - MUX_VAL(CP(SDRC_D4), (IEN | PTD | DIS | M0)); /* SDRC_D4 */ - MUX_VAL(CP(SDRC_D5), (IEN | PTD | DIS | M0)); /* SDRC_D5 */ - MUX_VAL(CP(SDRC_D6), (IEN | PTD | DIS | M0)); /* SDRC_D6 */ - MUX_VAL(CP(SDRC_D7), (IEN | PTD | DIS | M0)); /* SDRC_D7 */ - MUX_VAL(CP(SDRC_D8), (IEN | PTD | DIS | M0)); /* SDRC_D8 */ - MUX_VAL(CP(SDRC_D9), (IEN | PTD | DIS | M0)); /* SDRC_D9 */ - MUX_VAL(CP(SDRC_D10), (IEN | PTD | DIS | M0)); /* SDRC_D10 */ - MUX_VAL(CP(SDRC_D11), (IEN | PTD | DIS |
Re: [PATCH 1/1] w1: add dual search support
On Mon, Jan 28, 2013 at 11:23:00PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: Some 1-wire device need to be search twice to be detected Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com Applied, thanks Sascha --- drivers/w1/Kconfig |5 + drivers/w1/w1.c| 27 ++- drivers/w1/w1.h|2 ++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/w1/Kconfig b/drivers/w1/Kconfig index ab34997..dbc1e3c 100644 --- a/drivers/w1/Kconfig +++ b/drivers/w1/Kconfig @@ -11,4 +11,9 @@ if W1 source drivers/w1/masters/Kconfig source drivers/w1/slaves/Kconfig +config W1_DUAL_SEARCH + bool dual search + ---help--- + Some device need to be searched twice to be detected + endif # W1 diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index d2f94c9..eb6bec8 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -402,6 +402,21 @@ struct bus_type w1_bustype= { .remove = w1_bus_remove, }; +static bool w1_is_registered(struct w1_bus *bus, u64 rn) +{ + struct device_d *dev = NULL; + struct w1_device *w1_dev; + + bus_for_each_device(w1_bustype, dev) { + w1_dev = to_w1_device(dev); + + if (w1_dev-bus == bus w1_dev-reg_num == rn) + return true; + } + + return false; +} + static int w1_device_register(struct w1_bus *bus, struct w1_device *dev) { char str[18]; @@ -442,9 +457,15 @@ int w1_driver_register(struct w1_driver *drv) void w1_found(struct w1_bus *bus, u64 rn) { - struct w1_device *dev = xzalloc(sizeof(*dev)); + struct w1_device *dev; u64 tmp = be64_to_cpu(rn); + if (IS_ENABLED(CONFIG_W1_DUAL_SEARCH) + bus-is_searched w1_is_registered(bus, rn)) + return; + + dev = xzalloc(sizeof(*dev)); + dev-reg_num = rn; dev-fid = tmp 56; dev-id = (tmp 8) 0x; @@ -605,7 +626,11 @@ int w1_bus_register(struct w1_bus *bus) if (ret) return ret; + bus-is_searched = false; w1_search(bus, W1_SEARCH); + bus-is_searched = true; + if (IS_ENABLED(CONFIG_W1_DUAL_SEARCH)) + w1_search(bus, W1_SEARCH); return 0; } diff --git a/drivers/w1/w1.h b/drivers/w1/w1.h index 1373f69..b92d8cd 100644 --- a/drivers/w1/w1.h +++ b/drivers/w1/w1.h @@ -133,6 +133,8 @@ struct w1_bus int max_slave_count, slave_count; + boolis_searched; + void*data; struct list_head list; }; -- 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: [PATCH 0/2] macb: sync with linux and prepare for gmac support
On Mon, Jan 28, 2013 at 11:25:10PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: HI, The following changes since commit aff77ab814543ac61d0b3a00fcb6d1efefe24150: Merge branch 'for-next/omap' into next (2013-01-28 08:29:48 +0100) are available in the git repository at: git://git.jcrosoft.org/barebox.git delivery/macb Applied, thanks Sascha for you to fetch changes up to 7f3b3f22956d05718ab6a643afea26ada8c6d8c9: macb: allow to pass the phy interface (2013-01-29 05:11:55 +0800) Jean-Christophe PLAGNIOL-VILLARD (2): macb: sync register access and clock with the kernel macb: allow to pass the phy interface arch/arm/boards/at91rm9200ek/init.c |2 +- arch/arm/boards/at91sam9260ek/init.c |2 +- arch/arm/boards/at91sam9263ek/init.c |2 +- arch/arm/boards/at91sam9m10g45ek/init.c |2 +- arch/arm/boards/at91sam9x5ek/init.c |2 +- arch/arm/boards/pm9263/init.c|2 +- arch/arm/boards/pm9g45/init.c|2 +- arch/arm/boards/qil-a9260/init.c |2 +- arch/arm/boards/tny-a926x/init.c |2 +- arch/arm/boards/usb-a926x/init.c |2 +- arch/arm/mach-at91/at91rm9200_devices.c |2 +- arch/arm/mach-at91/at91sam9260_devices.c |2 +- arch/arm/mach-at91/at91sam9263_devices.c |2 +- arch/arm/mach-at91/at91sam9g45_devices.c |2 +- arch/arm/mach-at91/at91sam9x5_devices.c |4 ++-- arch/arm/mach-at91/include/mach/board.h |3 ++- drivers/net/at91_ether.c |2 +- drivers/net/macb.c | 69 ++--- drivers/net/macb.h |6 ++ 19 files changed, 55 insertions(+), 57 deletions(-) Best Regards, J. ___ 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 1/1] at91sam9m10ihd: set missing lcd power control
On Mon, Jan 28, 2013 at 10:32:07AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com Applied, thanks Sascha --- arch/arm/boards/at91sam9m10ihd/init.c |1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boards/at91sam9m10ihd/init.c b/arch/arm/boards/at91sam9m10ihd/init.c index da32a04..6d9a4ad 100644 --- a/arch/arm/boards/at91sam9m10ihd/init.c +++ b/arch/arm/boards/at91sam9m10ihd/init.c @@ -223,6 +223,7 @@ static struct atmel_lcdfb_platform_data ek_lcdc_data = { .default_lcdcon2= AT91SAM9G45_DEFAULT_LCDCON2, .guard_time = 9, .lcd_wiring_mode= ATMEL_LCDC_WIRING_RGB, + .atmel_lcdfb_power_control = at91_lcdc_power_control, .mode_list = at91fb_default_monspecs, .num_modes = ARRAY_SIZE(at91fb_default_monspecs), }; -- 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: [PATCH] ARM: efika-mx-smartbook: clean up whitespaces
On Mon, Jan 28, 2013 at 01:26:40PM +0400, Antony Pavlov wrote: Signed-off-by: Antony Pavlov antonynpav...@gmail.com Applied, thanks Sascha --- arch/arm/boards/efika-mx-smartbook/board.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/arm/boards/efika-mx-smartbook/board.c b/arch/arm/boards/efika-mx-smartbook/board.c index a455c55..5c02689 100644 --- a/arch/arm/boards/efika-mx-smartbook/board.c +++ b/arch/arm/boards/efika-mx-smartbook/board.c @@ -198,7 +198,7 @@ static int efikamx_mem_init(void) { arm_add_mem_device(ram0, 0x9000, SZ_512M); -return 0; + return 0; } mem_initcall(efikamx_mem_init); @@ -220,7 +220,7 @@ static const struct spi_board_info efikamx_spi_board_info[] = { .chip_select = 1, .max_speed_hz = 20 * 1000 * 1000, .bus_num = 0, -}, + }, }; static void efikamx_power_init(void) @@ -294,11 +294,11 @@ static void efikamx_power_init(void) /* Set VDIG to 1.8V, VGEN3 to 1.8V, VCAM to 2.6V */ mc13xxx_reg_read(mc, MC13892_REG_SETTING_0, val); val = ~(MC13892_SETTING_0_VCAM_MASK | -MC13892_SETTING_0_VGEN3_MASK | -MC13892_SETTING_0_VDIG_MASK); + MC13892_SETTING_0_VGEN3_MASK | + MC13892_SETTING_0_VDIG_MASK); val |= MC13892_SETTING_0_VDIG_1_8 | -MC13892_SETTING_0_VGEN3_1_8 | -MC13892_SETTING_0_VCAM_2_6; + MC13892_SETTING_0_VGEN3_1_8 | + MC13892_SETTING_0_VCAM_2_6; mc13xxx_reg_write(mc, MC13892_REG_SETTING_0, val); /* Set VVIDEO to 2.775V, VAUDIO to 3V, VSD to 3.15V */ @@ -455,7 +455,7 @@ static int efikamx_devices_init(void) imx51_add_mmc1(efikasb_sd2_data); for (i = 0; i ARRAY_SIZE(leds); i++) -led_gpio_register(leds[i]); + led_gpio_register(leds[i]); imx51_add_i2c1(NULL); -- 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: [PATCH 2/2] at91: add sama5d3xek board support
Hi Jean-Christophe, Le Mon, 28 Jan 2013 23:36:46 +0100, Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com a écrit : +++ b/arch/arm/boards/sama5d3xek/init.c @@ -0,0 +1,328 @@ +/* + * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * + */ + +#include common.h +#include net.h +#include init.h +#include environment.h +#include fec.h why do you need fec.h on an Atmel board ? Eric ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 1/2] nand_write: initialize OOB buffer for each page
Previously, during a multi-page write, chip-oob_poi would not be reinitialized. Signed-off-by: Jan Luebbe j...@pengutronix.de --- drivers/mtd/nand/nand_write.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/nand_write.c b/drivers/mtd/nand/nand_write.c index 9997127..f4f2fed 100644 --- a/drivers/mtd/nand/nand_write.c +++ b/drivers/mtd/nand/nand_write.c @@ -296,15 +296,15 @@ int nand_do_write_ops(struct mtd_info *mtd, loff_t to, (chip-pagebuf chip-page_shift) (to + ops-len)) chip-pagebuf = -1; - /* Initialize to all 0xFF, to avoid the possibility of - left over OOB data from a previous OOB read. */ - memset(chip-oob_poi, 0xff, mtd-oobsize); - while(1) { int bytes = mtd-writesize; int cached = writelen bytes page != blockmask; uint8_t *wbuf = buf; + /* Initialize to all 0xFF, to avoid the possibility of + left over OOB data from a previous OOB read or write. */ + memset(chip-oob_poi, 0xff, mtd-oobsize); + /* Partial page write ? */ if (unlikely(column || writelen (mtd-writesize - 1))) { cached = 0; -- 1.7.10.4 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 2/2] nand_omap_gpmc: use 0x00 for ECC padding in BCH ROM mode
The kernel uses these bytes to differentiate between erased/programmed pages. Signed-off-by: Jan Luebbe j...@pengutronix.de --- drivers/mtd/nand/nand_omap_gpmc.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c index 9050a8d..b81ad53 100644 --- a/drivers/mtd/nand/nand_omap_gpmc.c +++ b/drivers/mtd/nand/nand_omap_gpmc.c @@ -751,6 +751,35 @@ static int omap_gpmc_read_page_bch_rom_mode(struct mtd_info *mtd, return 0; } +static void omap_gpmc_write_page_bch_rom_mode(struct mtd_info *mtd, struct nand_chip *chip, + const uint8_t *buf) +{ + int i, eccsize = chip-ecc.size; + int eccbytes = chip-ecc.bytes; + int eccsteps = chip-ecc.steps; + uint8_t *ecc_calc = chip-buffers-ecccalc; + const uint8_t *p = buf; + uint32_t *eccpos = chip-ecc.layout-eccpos; + + for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { + chip-ecc.hwctl(mtd, NAND_ECC_WRITE); + chip-write_buf(mtd, p, eccsize); + chip-ecc.calculate(mtd, p, ecc_calc[i]); + } + + for (i = 0; i chip-ecc.total; i++) + chip-oob_poi[eccpos[i]] = ecc_calc[i]; + + /* +* set padding byte for each subpage to 0x00, so the kernel +* can detect erased pages +*/ + for (i = 0; i 4; i++) { + chip-oob_poi[1+14*(i+1)] = 0x00; + } + + chip-write_buf(mtd, chip-oob_poi, mtd-oobsize); +} static int omap_gpmc_eccmode(struct gpmc_nand_info *oinfo, enum gpmc_ecc_mode mode) { @@ -823,6 +852,7 @@ static int omap_gpmc_eccmode(struct gpmc_nand_info *oinfo, oinfo-nand.ecc.bytes= 4 * 13; oinfo-nand.ecc.size = 4 * 512; nand-ecc.read_page = omap_gpmc_read_page_bch_rom_mode; + nand-ecc.write_page = omap_gpmc_write_page_bch_rom_mode; omap_oobinfo.oobfree-length = 0; j = 0; for (i = 2; i 15; i++) -- 1.7.10.4 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH] commands: reset: add shutdown_barebox() before reset_cpu()
Some of controlled by barebox peripheral devices may be not affected by CPU reset, so we need call shutdown_barebox() to stop them. Signed-off-by: Antony Pavlov antonynpav...@gmail.com --- commands/reset.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/commands/reset.c b/commands/reset.c index 835926b..79885f4 100644 --- a/commands/reset.c +++ b/commands/reset.c @@ -20,17 +20,40 @@ #include common.h #include command.h #include complete.h +#include getopt.h static int cmd_reset(int argc, char *argv[]) { + int opt, shutdown_flag; + + shutdown_flag = 1; + + while ((opt = getopt(argc, argv, f)) 0) { + switch (opt) { + case 'f': + shutdown_flag = 0; + break; + } + } + + if (shutdown_flag) + shutdown_barebox(); + reset_cpu(0); /* Not reached */ return 1; } +BAREBOX_CMD_HELP_START(reset) +BAREBOX_CMD_HELP_USAGE(reset [-f]\n) +BAREBOX_CMD_HELP_SHORT(Perform RESET of the CPU.\n) +BAREBOX_CMD_HELP_OPT(-f, force RESET, don't call shutdown\n) +BAREBOX_CMD_HELP_END + BAREBOX_CMD_START(reset) .cmd= cmd_reset, .usage = Perform RESET of the CPU, + BAREBOX_CMD_HELP(cmd_reset_help) BAREBOX_CMD_COMPLETE(empty_complete) BAREBOX_CMD_END -- 1.7.10.4 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 0/2] at91: add sama5d3 support
On 23:29 Mon 28 Jan , Jean-Christophe PLAGNIOL-VILLARD wrote: HI, this patch serie add the support of the new Cortex-A5 of Atmel the sama5d3x series This patch serie depends on the w1 dual scan and the macb prepare for gmac wait I'll send a v2 as I need to udpate the at91clk command for the new pmc support Best Regards, J. The following changes since commit 1be4806dcc68d6999a07e93ec83c6b12a213dffa: at91: add clock dump command (2013-01-29 04:16:21 +0800) are available in the git repository at: git://git.jcrosoft.org/barebox.git delivery/sama5 for you to fetch changes up to b396017b1f8d8de00b7737e0a7aa24942bdc727a: at91: add sama5d3xek board support (2013-01-29 05:08:56 +0800) Jean-Christophe PLAGNIOL-VILLARD (2): at91: add sama5d3 support at91: add sama5d3xek board support arch/arm/Makefile |1 + arch/arm/boards/sama5d3xek/Makefile |2 + arch/arm/boards/sama5d3xek/config.h |6 ++ arch/arm/boards/sama5d3xek/env/config | 44 + arch/arm/boards/sama5d3xek/hw_version.c | 251 ++ arch/arm/boards/sama5d3xek/hw_version.h | 34 +++ arch/arm/boards/sama5d3xek/init.c | 328 ++ arch/arm/configs/sama5d3xek_defconfig | 91 +++ arch/arm/mach-at91/Kconfig| 33 +++ arch/arm/mach-at91/Makefile |2 + arch/arm/mach-at91/clock.c| 75 --- arch/arm/mach-at91/clock.h|2 + arch/arm/mach-at91/include/mach/at91_pmc.h|7 +- arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h | 39 +++- arch/arm/mach-at91/include/mach/cpu.h | 27 ++ arch/arm/mach-at91/include/mach/hardware.h|8 ++ arch/arm/mach-at91/include/mach/sama5d3.h | 152 +++ arch/arm/mach-at91/include/mach/sama5d3_matrix.h | 15 +++ arch/arm/mach-at91/sama5d3.c | 319 arch/arm/mach-at91/sama5d3_devices.c | 444 + arch/arm/mach-at91/sama5d3_lowlevel_init.c| 24 + arch/arm/mach-at91/setup.c| 27 ++ arch/arm/mach-at91/soc.h |5 + 23 files changed, 1918 insertions(+), 18 deletions(-) create mode 100644 arch/arm/boards/sama5d3xek/Makefile create mode 100644 arch/arm/boards/sama5d3xek/config.h create mode 100644 arch/arm/boards/sama5d3xek/env/config create mode 100644 arch/arm/boards/sama5d3xek/hw_version.c create mode 100644 arch/arm/boards/sama5d3xek/hw_version.h create mode 100644 arch/arm/boards/sama5d3xek/init.c create mode 100644 arch/arm/configs/sama5d3xek_defconfig create mode 100644 arch/arm/mach-at91/include/mach/sama5d3.h create mode 100644 arch/arm/mach-at91/include/mach/sama5d3_matrix.h create mode 100644 arch/arm/mach-at91/sama5d3.c create mode 100644 arch/arm/mach-at91/sama5d3_devices.c create mode 100644 arch/arm/mach-at91/sama5d3_lowlevel_init.c Best Regards, J. ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH v5] ARM: at91: Add Telit EVK-PRO3 board support
http://www.telit.com Based on at91sam9260ek board support. Signed-off-by: Fabio Porcedda fabio.porce...@gmail.com Cc: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com --- v5: - fix mci configuration - some codestyle improvements v4: - use a gpio for dfu - remove HAVE_NAND_ATMEL_BUSWIDTH_16 v3: - add dfu support - init.c: reduced bootstrap size - init.c: moved istructions from evk_add_device_nand function to the struct - init.c: remove blank line - renamed to telit-evk-pro3 v2: - init.c: remove 9260ek and g20ek references - init.c: rename ek_ - evk_ - init.c: cleanup headers - init.c: use clock framework - init.c: remove function ek_set_board_type - init.c: remove bus_width_16 initialization arch/arm/Makefile | 1 + arch/arm/boards/telit-evk-pro3/Makefile| 1 + arch/arm/boards/telit-evk-pro3/config.h| 6 + arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi | 10 ++ .../boards/telit-evk-pro3/env/init/config-board| 8 + .../boards/telit-evk-pro3/env/init/mtdparts-nand | 11 ++ arch/arm/boards/telit-evk-pro3/env/init/usb| 40 + arch/arm/boards/telit-evk-pro3/init.c | 176 + arch/arm/configs/telit_evk_pro3_defconfig | 73 + arch/arm/mach-at91/Kconfig | 8 + 10 files changed, 334 insertions(+) create mode 100644 arch/arm/boards/telit-evk-pro3/Makefile create mode 100644 arch/arm/boards/telit-evk-pro3/config.h create mode 100644 arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi create mode 100644 arch/arm/boards/telit-evk-pro3/env/init/config-board create mode 100644 arch/arm/boards/telit-evk-pro3/env/init/mtdparts-nand create mode 100644 arch/arm/boards/telit-evk-pro3/env/init/usb create mode 100644 arch/arm/boards/telit-evk-pro3/init.c create mode 100644 arch/arm/configs/telit_evk_pro3_defconfig diff --git a/arch/arm/Makefile b/arch/arm/Makefile index a36adfb..60661eb 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -94,6 +94,7 @@ board-$(CONFIG_MACH_EUKREA_CPUIMX35) := eukrea_cpuimx35 board-$(CONFIG_MACH_EUKREA_CPUIMX51SD) := eukrea_cpuimx51 board-$(CONFIG_MACH_FREESCALE_MX25_3STACK) := freescale-mx25-3-stack board-$(CONFIG_MACH_FREESCALE_MX35_3STACK) := freescale-mx35-3-stack +board-$(CONFIG_MACH_GE863) := telit-evk-pro3 board-$(CONFIG_MACH_IMX21ADS) := imx21ads board-$(CONFIG_MACH_IMX27ADS) := imx27ads board-$(CONFIG_MACH_IMX233_OLINUXINO) := imx233-olinuxino diff --git a/arch/arm/boards/telit-evk-pro3/Makefile b/arch/arm/boards/telit-evk-pro3/Makefile new file mode 100644 index 000..eb072c0 --- /dev/null +++ b/arch/arm/boards/telit-evk-pro3/Makefile @@ -0,0 +1 @@ +obj-y += init.o diff --git a/arch/arm/boards/telit-evk-pro3/config.h b/arch/arm/boards/telit-evk-pro3/config.h new file mode 100644 index 000..7aeff30 --- /dev/null +++ b/arch/arm/boards/telit-evk-pro3/config.h @@ -0,0 +1,6 @@ +#ifndef __CONFIG_H +#define __CONFIG_H + +#define AT91_MAIN_CLOCK600 /* 6.000 MHz crystal */ + +#endif /* __CONFIG_H */ diff --git a/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi b/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi new file mode 100644 index 000..1987492 --- /dev/null +++ b/arch/arm/boards/telit-evk-pro3/env/boot/nand-ubi @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ $1 = menu ]; then + boot-menu-add-entry $0 nand (UBI) + exit +fi + +global.bootm.image=/dev/nand0.kernel.bb +#global.bootm.oftree=/env/oftree +global.linux.bootargs.dyn.root=root=ubi0:rootfs ubi.mtd=nand0.rootfs rootfstype=ubifs diff --git a/arch/arm/boards/telit-evk-pro3/env/init/config-board b/arch/arm/boards/telit-evk-pro3/env/init/config-board new file mode 100644 index 000..741b902 --- /dev/null +++ b/arch/arm/boards/telit-evk-pro3/env/init/config-board @@ -0,0 +1,8 @@ +#!/bin/sh + +# board defaults, do not change in running system. Change /env/config +# instead + +global.hostname=evk-pro3 +global.linux.bootargs.base=console=ttyS0,115200 +global.boot.default=nand-ubi diff --git a/arch/arm/boards/telit-evk-pro3/env/init/mtdparts-nand b/arch/arm/boards/telit-evk-pro3/env/init/mtdparts-nand new file mode 100644 index 000..58e859b --- /dev/null +++ b/arch/arm/boards/telit-evk-pro3/env/init/mtdparts-nand @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ $1 = menu ]; then + init-menu-add-entry $0 NAND partitions + exit +fi + +mtdparts=0xC(nand0.bootstrap),256k(nand0.barebox)ro,128k(nand0.bareboxenv),3M(nand0.kernel),-(nand0.rootfs) +kernelname=atmel_nand + +mtdparts-add -b -d nand0 -k ${kernelname} -p ${mtdparts} diff --git a/arch/arm/boards/telit-evk-pro3/env/init/usb b/arch/arm/boards/telit-evk-pro3/env/init/usb new file mode 100644 index 000..47429f5 --- /dev/null +++ b/arch/arm/boards/telit-evk-pro3/env/init/usb @@ -0,0 +1,40 @@ +#!/bin/sh + +# Connect PC31 to GND to enable DFU
[PATCH 0/2 v2] at91: add sama5d3 support
HI, v2: update clock support drop fec.h this patch serie add the support of the new Cortex-A5 of Atmel the sama5d3x series This patch serie depends on the w1 dual scan and the macb prepare for gmac The following changes since commit 1be4806dcc68d6999a07e93ec83c6b12a213dffa: at91: add clock dump command (2013-01-29 04:16:21 +0800) are available in the git repository at: git://git.jcrosoft.org/barebox.git delivery/sama5 for you to fetch changes up to 77510b9afb1a126fac5eb6a364666ad6f832cb44: at91: add sama5d3xek board support (2013-01-29 20:24:07 +0800) Jean-Christophe PLAGNIOL-VILLARD (2): at91: add sama5d3 support at91: add sama5d3xek board support arch/arm/Makefile |1 + arch/arm/boards/sama5d3xek/Makefile |2 + arch/arm/boards/sama5d3xek/config.h |6 ++ arch/arm/boards/sama5d3xek/env/config | 44 + arch/arm/boards/sama5d3xek/hw_version.c | 251 ++ arch/arm/boards/sama5d3xek/hw_version.h | 34 +++ arch/arm/boards/sama5d3xek/init.c | 351 ++ arch/arm/configs/sama5d3xek_defconfig | 91 +++ arch/arm/mach-at91/Kconfig| 31 +++ arch/arm/mach-at91/Makefile |1 + arch/arm/mach-at91/clock.c| 113 ++- arch/arm/mach-at91/clock.h|2 + arch/arm/mach-at91/include/mach/at91_pmc.h| 14 ++- arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h | 37 arch/arm/mach-at91/include/mach/cpu.h | 27 ++ arch/arm/mach-at91/include/mach/hardware.h|8 ++ arch/arm/mach-at91/include/mach/sama5d3.h | 152 +++ arch/arm/mach-at91/include/mach/sama5d3_matrix.h | 15 +++ arch/arm/mach-at91/sama5d3.c | 336 +++ arch/arm/mach-at91/sama5d3_devices.c | 444 + arch/arm/mach-at91/setup.c| 27 ++ arch/arm/mach-at91/soc.h |5 + 22 files changed, 1964 insertions(+), 28 deletions(-) create mode 100644 arch/arm/boards/sama5d3xek/Makefile create mode 100644 arch/arm/boards/sama5d3xek/config.h create mode 100644 arch/arm/boards/sama5d3xek/env/config create mode 100644 arch/arm/boards/sama5d3xek/hw_version.c create mode 100644 arch/arm/boards/sama5d3xek/hw_version.h create mode 100644 arch/arm/boards/sama5d3xek/init.c create mode 100644 arch/arm/configs/sama5d3xek_defconfig create mode 100644 arch/arm/mach-at91/include/mach/sama5d3.h create mode 100644 arch/arm/mach-at91/include/mach/sama5d3_matrix.h create mode 100644 arch/arm/mach-at91/sama5d3.c create mode 100644 arch/arm/mach-at91/sama5d3_devices.c Best Regards, J. ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 2/2] at91: add sama5d3xek board support
currently missing the GMAC support Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com --- arch/arm/Makefile |1 + arch/arm/boards/sama5d3xek/Makefile |2 + arch/arm/boards/sama5d3xek/config.h |6 + arch/arm/boards/sama5d3xek/env/config | 44 arch/arm/boards/sama5d3xek/hw_version.c | 251 ++ arch/arm/boards/sama5d3xek/hw_version.h | 34 +++ arch/arm/boards/sama5d3xek/init.c | 351 +++ arch/arm/configs/sama5d3xek_defconfig | 91 arch/arm/mach-at91/Kconfig | 17 ++ 9 files changed, 797 insertions(+) create mode 100644 arch/arm/boards/sama5d3xek/Makefile create mode 100644 arch/arm/boards/sama5d3xek/config.h create mode 100644 arch/arm/boards/sama5d3xek/env/config create mode 100644 arch/arm/boards/sama5d3xek/hw_version.c create mode 100644 arch/arm/boards/sama5d3xek/hw_version.h create mode 100644 arch/arm/boards/sama5d3xek/init.c create mode 100644 arch/arm/configs/sama5d3xek_defconfig diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 66c9933..81fa64b 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -80,6 +80,7 @@ board-$(CONFIG_MACH_AT91SAM9N12EK):= at91sam9n12ek board-$(CONFIG_MACH_AT91SAM9X5EK) := at91sam9x5ek board-$(CONFIG_MACH_AT91SAM9M10IHD):= at91sam9m10ihd board-$(CONFIG_MACH_AT91SAM9M10G45EK) := at91sam9m10g45ek +board-$(CONFIG_MACH_SAMA5D3XEK):= sama5d3xek board-$(CONFIG_MACH_CLEP7212) := clep7212 board-$(CONFIG_MACH_DSS11) := dss11 board-$(CONFIG_MACH_EDB9301) := edb93xx diff --git a/arch/arm/boards/sama5d3xek/Makefile b/arch/arm/boards/sama5d3xek/Makefile new file mode 100644 index 000..f2acf20 --- /dev/null +++ b/arch/arm/boards/sama5d3xek/Makefile @@ -0,0 +1,2 @@ +obj-y += init.o +obj-y += hw_version.o diff --git a/arch/arm/boards/sama5d3xek/config.h b/arch/arm/boards/sama5d3xek/config.h new file mode 100644 index 000..d971810 --- /dev/null +++ b/arch/arm/boards/sama5d3xek/config.h @@ -0,0 +1,6 @@ +#ifndef __CONFIG_H +#define __CONFIG_H + +#define AT91_MAIN_CLOCK1200/* 12 MHz crystal */ + +#endif /* __CONFIG_H */ diff --git a/arch/arm/boards/sama5d3xek/env/config b/arch/arm/boards/sama5d3xek/env/config new file mode 100644 index 000..375e90d --- /dev/null +++ b/arch/arm/boards/sama5d3xek/env/config @@ -0,0 +1,44 @@ +#!/bin/sh + +# use 'dhcp' to do dhcp in barebox and in kernel +# use 'none' if you want to skip kernel ip autoconfiguration +ip=dhcp-barebox +global.dhcp.vendor_id=barebox-sama5d3xek +global.dhcp.client_id=${sama5d3xcm.board}-${sama5d3xcm.vendor} + +# 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', 'nor' or 'nand' +kernel_loc=nfs +# can be either 'net', 'nor', 'nand' or 'initrd' +rootfs_loc=net +# can be either 'nfs', 'tftp', 'nand' or empty +oftree_loc=nfs + +# can be either 'jffs2' or 'ubifs' +rootfs_type=ubifs +rootfsimage=root.$rootfs_type +ubiroot=rootfs + +# The image type of the kernel. Can be uimage, zimage, raw, or raw_lzo +kernelimage=zImage +#kernelimage=uImage +#kernelimage=Image +#kernelimage=Image.lzo + +nand_device=atmel_nand +nand_parts=256k(at91bootstrap),384k(barebox)ro,256k@768k(bareboxenv),256k(bareboxenv2),128k@1536k(oftree),5M@2M(kernel),-@8M(rootfs) +rootfs_mtdblock_nand=7 + +m25p80_parts=64k(bootstrap),384k(barebox),256k(bareboxenv),256k(bareboxenv2),128k(oftree),-(updater) + +autoboot_timeout=3 + +bootargs=console=ttyS0,115200 + +# set a fancy prompt (if support is compiled in) +PS1=\e[1;32mbarebox@\e[1;31m\h:\w\e[0m\n# diff --git a/arch/arm/boards/sama5d3xek/hw_version.c b/arch/arm/boards/sama5d3xek/hw_version.c new file mode 100644 index 000..a9fcf7d --- /dev/null +++ b/arch/arm/boards/sama5d3xek/hw_version.c @@ -0,0 +1,251 @@ +/* + * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * + */ + +#include common.h +#include fs.h +#include fcntl.h +#include libbb.h +#include asm/armlinux.h +#include of.h +#include libfdt.h + +#include hw_version.h + +enum board_type { + BOARD_TYPE_MB, + BOARD_TYPE_DM, + BOARD_TYPE_CPU, +}; + +static struct board_info { + char *name; + enum board_type type; + unsigned char id; +}
[PATCH 1/2] at91: add sama5d3 support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com --- arch/arm/mach-at91/Kconfig| 14 + arch/arm/mach-at91/Makefile |1 + arch/arm/mach-at91/clock.c| 113 -- arch/arm/mach-at91/clock.h|2 + arch/arm/mach-at91/include/mach/at91_pmc.h| 14 +- arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h | 37 ++ arch/arm/mach-at91/include/mach/cpu.h | 27 ++ arch/arm/mach-at91/include/mach/hardware.h|8 + arch/arm/mach-at91/include/mach/sama5d3.h | 152 +++ arch/arm/mach-at91/include/mach/sama5d3_matrix.h | 15 + arch/arm/mach-at91/sama5d3.c | 336 arch/arm/mach-at91/sama5d3_devices.c | 444 + arch/arm/mach-at91/setup.c| 27 ++ arch/arm/mach-at91/soc.h |5 + 14 files changed, 1167 insertions(+), 28 deletions(-) create mode 100644 arch/arm/mach-at91/include/mach/sama5d3.h create mode 100644 arch/arm/mach-at91/include/mach/sama5d3_matrix.h create mode 100644 arch/arm/mach-at91/sama5d3.c create mode 100644 arch/arm/mach-at91/sama5d3_devices.c diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index cd25ac8..81718d9 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig @@ -18,6 +18,12 @@ config SOC_AT91SAM9 select AT91SAM9_SMC select AT91SAM9_TIMER +config SOC_SAMA5 + bool + select CPU_V7 + select AT91SAM9_SMC + select AT91SAM9_TIMER + config ARCH_TEXT_BASE hex default 0x73f0 if ARCH_AT91SAM9G45 @@ -168,6 +174,13 @@ config ARCH_AT91SAM9N12 bool AT91SAM9N12 select SOC_AT91SAM9N12 +config ARCH_SAMA5D3 + bool SAMA5D3x + select SOC_SAMA5 + select HAVE_AT91_DBGU1 + select HAS_MACB + select AT91SAM9G45_RESET + endchoice config ARCH_BAREBOX_MAX_BARE_INIT_SIZE @@ -180,6 +193,7 @@ config ARCH_BAREBOX_MAX_BARE_INIT_SIZE default 0xF000 if ARCH_AT91SAM9G45 default 0x6000 if ARCH_AT91SAM9X5 default 0x6000 if ARCH_AT91SAM9N12 + default 0x6000 if ARCH_SAMA5D3 default 0x config SUPPORT_CALAO_DAB_MMX diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index 634b160..3def8b9 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile @@ -24,3 +24,4 @@ obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam9260_devices.o obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam9g45_devices.o obj-$(CONFIG_ARCH_AT91SAM9X5) += at91sam9x5.o at91sam9x5_devices.o obj-$(CONFIG_ARCH_AT91SAM9N12) += at91sam9n12.o at91sam9n12_devices.o +obj-$(CONFIG_ARCH_SAMA5D3) += sama5d3.o sama5d3_devices.o diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c index 4572705..2dde632 100644 --- a/arch/arm/mach-at91/clock.c +++ b/arch/arm/mach-at91/clock.c @@ -44,7 +44,10 @@ */ #define cpu_has_utmi() ( cpu_is_at91sam9rl() \ || cpu_is_at91sam9g45() \ - || cpu_is_at91sam9x5()) + || cpu_is_at91sam9x5() \ + || cpu_is_sama5d3()) + +#define cpu_has_1056M_plla() (cpu_is_sama5d3()) #define cpu_has_800M_plla()( cpu_is_at91sam9g20() \ || cpu_is_at91sam9g45() \ @@ -65,7 +68,8 @@ || cpu_is_at91sam9n12())) #define cpu_has_upll() (cpu_is_at91sam9g45() \ - || cpu_is_at91sam9x5()) + || cpu_is_at91sam9x5() \ + || cpu_is_sama5d3()) /* USB host HS FS */ #define cpu_has_uhp() (!cpu_is_at91sam9rl()) @@ -73,18 +77,22 @@ /* USB device FS only */ #define cpu_has_udpfs()(!(cpu_is_at91sam9rl() \ || cpu_is_at91sam9g45() \ - || cpu_is_at91sam9x5())) + || cpu_is_at91sam9x5() \ + || cpu_is_sama5d3())) #define cpu_has_plladiv2() (cpu_is_at91sam9g45() \ || cpu_is_at91sam9x5() \ - || cpu_is_at91sam9n12()) + || cpu_is_at91sam9n12() \ + || cpu_is_sama5d3()) #define cpu_has_mdiv3()(cpu_is_at91sam9g45() \ || cpu_is_at91sam9x5() \ - || cpu_is_at91sam9n12()) + || cpu_is_at91sam9n12() \ + || cpu_is_sama5d3()) #define cpu_has_alt_prescaler()(cpu_is_at91sam9x5() \ - || cpu_is_at91sam9n12()) + || cpu_is_at91sam9n12() \ + ||
[PATCH 0/2 v2] at91: add sama5d3 support
HI, v3: update clock periph divider some of the IP require to be down clocked to work perfectly update all of them v2: update clock support drop fec.h this patch serie add the support of the new Cortex-A5 of Atmel the sama5d3x series This patch serie depends on the w1 dual scan and the macb prepare for gmac The following changes since commit 1be4806dcc68d6999a07e93ec83c6b12a213dffa: at91: add clock dump command (2013-01-29 04:16:21 +0800) are available in the git repository at: git://git.jcrosoft.org/barebox.git delivery/sama5 for you to fetch changes up to 8a1a53fd5e7e4d38d064a3b079181bf5d6a462a7: at91: add sama5d3xek board support (2013-01-30 03:17:33 +0800) Jean-Christophe PLAGNIOL-VILLARD (2): at91: add sama5d3 support at91: add sama5d3xek board support arch/arm/Makefile |1 + arch/arm/boards/sama5d3xek/Makefile |2 + arch/arm/boards/sama5d3xek/config.h |6 + arch/arm/boards/sama5d3xek/env/config | 44 +++ arch/arm/boards/sama5d3xek/hw_version.c | 251 arch/arm/boards/sama5d3xek/hw_version.h | 53 arch/arm/boards/sama5d3xek/init.c | 358 ++ arch/arm/configs/sama5d3xek_defconfig | 91 + arch/arm/mach-at91/Kconfig| 31 + arch/arm/mach-at91/Makefile |1 + arch/arm/mach-at91/clock.c| 113 arch/arm/mach-at91/clock.h|2 + arch/arm/mach-at91/include/mach/at91_pmc.h| 14 +- arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h | 37 ++ arch/arm/mach-at91/include/mach/cpu.h | 27 arch/arm/mach-at91/include/mach/hardware.h|8 ++ arch/arm/mach-at91/include/mach/sama5d3.h | 152 ++ arch/arm/mach-at91/include/mach/sama5d3_matrix.h | 15 +++ arch/arm/mach-at91/sama5d3.c | 396 arch/arm/mach-at91/sama5d3_devices.c | 444 +++ arch/arm/mach-at91/setup.c| 27 arch/arm/mach-at91/soc.h |5 + 22 files changed, 2050 insertions(+), 28 deletions(-) create mode 100644 arch/arm/boards/sama5d3xek/Makefile create mode 100644 arch/arm/boards/sama5d3xek/config.h create mode 100644 arch/arm/boards/sama5d3xek/env/config create mode 100644 arch/arm/boards/sama5d3xek/hw_version.c create mode 100644 arch/arm/boards/sama5d3xek/hw_version.h create mode 100644 arch/arm/boards/sama5d3xek/init.c create mode 100644 arch/arm/configs/sama5d3xek_defconfig create mode 100644 arch/arm/mach-at91/include/mach/sama5d3.h create mode 100644 arch/arm/mach-at91/include/mach/sama5d3_matrix.h create mode 100644 arch/arm/mach-at91/sama5d3.c create mode 100644 arch/arm/mach-at91/sama5d3_devices.c Best Regards, J. ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 2/2 v3] at91: add sama5d3xek board support
currently missing the GMAC support Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com --- arch/arm/Makefile |1 + arch/arm/boards/sama5d3xek/Makefile |2 + arch/arm/boards/sama5d3xek/config.h |6 + arch/arm/boards/sama5d3xek/env/config | 44 arch/arm/boards/sama5d3xek/hw_version.c | 251 ++ arch/arm/boards/sama5d3xek/hw_version.h | 53 + arch/arm/boards/sama5d3xek/init.c | 358 +++ arch/arm/configs/sama5d3xek_defconfig | 91 arch/arm/mach-at91/Kconfig | 17 ++ 9 files changed, 823 insertions(+) create mode 100644 arch/arm/boards/sama5d3xek/Makefile create mode 100644 arch/arm/boards/sama5d3xek/config.h create mode 100644 arch/arm/boards/sama5d3xek/env/config create mode 100644 arch/arm/boards/sama5d3xek/hw_version.c create mode 100644 arch/arm/boards/sama5d3xek/hw_version.h create mode 100644 arch/arm/boards/sama5d3xek/init.c create mode 100644 arch/arm/configs/sama5d3xek_defconfig diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 66c9933..81fa64b 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -80,6 +80,7 @@ board-$(CONFIG_MACH_AT91SAM9N12EK):= at91sam9n12ek board-$(CONFIG_MACH_AT91SAM9X5EK) := at91sam9x5ek board-$(CONFIG_MACH_AT91SAM9M10IHD):= at91sam9m10ihd board-$(CONFIG_MACH_AT91SAM9M10G45EK) := at91sam9m10g45ek +board-$(CONFIG_MACH_SAMA5D3XEK):= sama5d3xek board-$(CONFIG_MACH_CLEP7212) := clep7212 board-$(CONFIG_MACH_DSS11) := dss11 board-$(CONFIG_MACH_EDB9301) := edb93xx diff --git a/arch/arm/boards/sama5d3xek/Makefile b/arch/arm/boards/sama5d3xek/Makefile new file mode 100644 index 000..db021ee --- /dev/null +++ b/arch/arm/boards/sama5d3xek/Makefile @@ -0,0 +1,2 @@ +obj-y += init.o +obj-$(CONFIG_W1) += hw_version.o diff --git a/arch/arm/boards/sama5d3xek/config.h b/arch/arm/boards/sama5d3xek/config.h new file mode 100644 index 000..d971810 --- /dev/null +++ b/arch/arm/boards/sama5d3xek/config.h @@ -0,0 +1,6 @@ +#ifndef __CONFIG_H +#define __CONFIG_H + +#define AT91_MAIN_CLOCK1200/* 12 MHz crystal */ + +#endif /* __CONFIG_H */ diff --git a/arch/arm/boards/sama5d3xek/env/config b/arch/arm/boards/sama5d3xek/env/config new file mode 100644 index 000..375e90d --- /dev/null +++ b/arch/arm/boards/sama5d3xek/env/config @@ -0,0 +1,44 @@ +#!/bin/sh + +# use 'dhcp' to do dhcp in barebox and in kernel +# use 'none' if you want to skip kernel ip autoconfiguration +ip=dhcp-barebox +global.dhcp.vendor_id=barebox-sama5d3xek +global.dhcp.client_id=${sama5d3xcm.board}-${sama5d3xcm.vendor} + +# 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', 'nor' or 'nand' +kernel_loc=nfs +# can be either 'net', 'nor', 'nand' or 'initrd' +rootfs_loc=net +# can be either 'nfs', 'tftp', 'nand' or empty +oftree_loc=nfs + +# can be either 'jffs2' or 'ubifs' +rootfs_type=ubifs +rootfsimage=root.$rootfs_type +ubiroot=rootfs + +# The image type of the kernel. Can be uimage, zimage, raw, or raw_lzo +kernelimage=zImage +#kernelimage=uImage +#kernelimage=Image +#kernelimage=Image.lzo + +nand_device=atmel_nand +nand_parts=256k(at91bootstrap),384k(barebox)ro,256k@768k(bareboxenv),256k(bareboxenv2),128k@1536k(oftree),5M@2M(kernel),-@8M(rootfs) +rootfs_mtdblock_nand=7 + +m25p80_parts=64k(bootstrap),384k(barebox),256k(bareboxenv),256k(bareboxenv2),128k(oftree),-(updater) + +autoboot_timeout=3 + +bootargs=console=ttyS0,115200 + +# set a fancy prompt (if support is compiled in) +PS1=\e[1;32mbarebox@\e[1;31m\h:\w\e[0m\n# diff --git a/arch/arm/boards/sama5d3xek/hw_version.c b/arch/arm/boards/sama5d3xek/hw_version.c new file mode 100644 index 000..a9fcf7d --- /dev/null +++ b/arch/arm/boards/sama5d3xek/hw_version.c @@ -0,0 +1,251 @@ +/* + * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * + */ + +#include common.h +#include fs.h +#include fcntl.h +#include libbb.h +#include asm/armlinux.h +#include of.h +#include libfdt.h + +#include hw_version.h + +enum board_type { + BOARD_TYPE_MB, + BOARD_TYPE_DM, + BOARD_TYPE_CPU, +}; + +static struct board_info { + char *name; + enum board_type type; + unsigned char
[PATCH 1/2 v3] at91: add sama5d3 support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com --- arch/arm/mach-at91/Kconfig| 14 + arch/arm/mach-at91/Makefile |1 + arch/arm/mach-at91/clock.c| 113 -- arch/arm/mach-at91/clock.h|2 + arch/arm/mach-at91/include/mach/at91_pmc.h| 14 +- arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h | 37 ++ arch/arm/mach-at91/include/mach/cpu.h | 27 ++ arch/arm/mach-at91/include/mach/hardware.h|8 + arch/arm/mach-at91/include/mach/sama5d3.h | 152 +++ arch/arm/mach-at91/include/mach/sama5d3_matrix.h | 15 + arch/arm/mach-at91/sama5d3.c | 396 ++ arch/arm/mach-at91/sama5d3_devices.c | 444 + arch/arm/mach-at91/setup.c| 27 ++ arch/arm/mach-at91/soc.h |5 + 14 files changed, 1227 insertions(+), 28 deletions(-) create mode 100644 arch/arm/mach-at91/include/mach/sama5d3.h create mode 100644 arch/arm/mach-at91/include/mach/sama5d3_matrix.h create mode 100644 arch/arm/mach-at91/sama5d3.c create mode 100644 arch/arm/mach-at91/sama5d3_devices.c diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index cd25ac8..81718d9 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig @@ -18,6 +18,12 @@ config SOC_AT91SAM9 select AT91SAM9_SMC select AT91SAM9_TIMER +config SOC_SAMA5 + bool + select CPU_V7 + select AT91SAM9_SMC + select AT91SAM9_TIMER + config ARCH_TEXT_BASE hex default 0x73f0 if ARCH_AT91SAM9G45 @@ -168,6 +174,13 @@ config ARCH_AT91SAM9N12 bool AT91SAM9N12 select SOC_AT91SAM9N12 +config ARCH_SAMA5D3 + bool SAMA5D3x + select SOC_SAMA5 + select HAVE_AT91_DBGU1 + select HAS_MACB + select AT91SAM9G45_RESET + endchoice config ARCH_BAREBOX_MAX_BARE_INIT_SIZE @@ -180,6 +193,7 @@ config ARCH_BAREBOX_MAX_BARE_INIT_SIZE default 0xF000 if ARCH_AT91SAM9G45 default 0x6000 if ARCH_AT91SAM9X5 default 0x6000 if ARCH_AT91SAM9N12 + default 0x6000 if ARCH_SAMA5D3 default 0x config SUPPORT_CALAO_DAB_MMX diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index 634b160..3def8b9 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile @@ -24,3 +24,4 @@ obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam9260_devices.o obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam9g45_devices.o obj-$(CONFIG_ARCH_AT91SAM9X5) += at91sam9x5.o at91sam9x5_devices.o obj-$(CONFIG_ARCH_AT91SAM9N12) += at91sam9n12.o at91sam9n12_devices.o +obj-$(CONFIG_ARCH_SAMA5D3) += sama5d3.o sama5d3_devices.o diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c index 4572705..2dde632 100644 --- a/arch/arm/mach-at91/clock.c +++ b/arch/arm/mach-at91/clock.c @@ -44,7 +44,10 @@ */ #define cpu_has_utmi() ( cpu_is_at91sam9rl() \ || cpu_is_at91sam9g45() \ - || cpu_is_at91sam9x5()) + || cpu_is_at91sam9x5() \ + || cpu_is_sama5d3()) + +#define cpu_has_1056M_plla() (cpu_is_sama5d3()) #define cpu_has_800M_plla()( cpu_is_at91sam9g20() \ || cpu_is_at91sam9g45() \ @@ -65,7 +68,8 @@ || cpu_is_at91sam9n12())) #define cpu_has_upll() (cpu_is_at91sam9g45() \ - || cpu_is_at91sam9x5()) + || cpu_is_at91sam9x5() \ + || cpu_is_sama5d3()) /* USB host HS FS */ #define cpu_has_uhp() (!cpu_is_at91sam9rl()) @@ -73,18 +77,22 @@ /* USB device FS only */ #define cpu_has_udpfs()(!(cpu_is_at91sam9rl() \ || cpu_is_at91sam9g45() \ - || cpu_is_at91sam9x5())) + || cpu_is_at91sam9x5() \ + || cpu_is_sama5d3())) #define cpu_has_plladiv2() (cpu_is_at91sam9g45() \ || cpu_is_at91sam9x5() \ - || cpu_is_at91sam9n12()) + || cpu_is_at91sam9n12() \ + || cpu_is_sama5d3()) #define cpu_has_mdiv3()(cpu_is_at91sam9g45() \ || cpu_is_at91sam9x5() \ - || cpu_is_at91sam9n12()) + || cpu_is_at91sam9n12() \ + || cpu_is_sama5d3()) #define cpu_has_alt_prescaler()(cpu_is_at91sam9x5() \ - || cpu_is_at91sam9n12()) + || cpu_is_at91sam9n12() \ + ||
[PATCH v2] pcm049: clean up defconfig
add BAREBOX_MAX_IMAGE_SIZE and rebuild defconfig with savedefconfig Signed-off-by: Jan Weitzel j.weit...@phytec.de --- arch/arm/configs/pcm049_defconfig | 19 +++ arch/arm/configs/pcm049_xload_defconfig |3 ++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/arch/arm/configs/pcm049_defconfig b/arch/arm/configs/pcm049_defconfig index adb600f..19df95a 100644 --- a/arch/arm/configs/pcm049_defconfig +++ b/arch/arm/configs/pcm049_defconfig @@ -1,13 +1,12 @@ CONFIG_ARCH_OMAP=y +CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x8 CONFIG_ARCH_OMAP4=y CONFIG_MACH_PCM049=y CONFIG_AEABI=y -CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y CONFIG_ARM_UNWIND=y CONFIG_MMU=y CONFIG_TEXT_BASE=0x8f00 CONFIG_MALLOC_SIZE=0x200 -CONFIG_MALLOC_TLSF=y CONFIG_KALLSYMS=y CONFIG_PROMPT=barebox CONFIG_LONGHELP=y @@ -21,11 +20,12 @@ CONFIG_DEFAULT_ENVIRONMENT_PATH=arch/arm/boards/pcm049/env CONFIG_CMD_EDIT=y CONFIG_CMD_SLEEP=y CONFIG_CMD_SAVEENV=y -CONFIG_CMD_LOADENV=y CONFIG_CMD_EXPORT=y CONFIG_CMD_PRINTENV=y CONFIG_CMD_READLINE=y CONFIG_CMD_TIME=y +CONFIG_CMD_AUTOMOUNT=y +CONFIG_CMD_TFTP=y CONFIG_CMD_ECHO_E=y CONFIG_CMD_LOADB=y CONFIG_CMD_IOMEM=y @@ -36,7 +36,6 @@ CONFIG_CMD_BOOTM_INITRD=y CONFIG_CMD_BOOTM_OFTREE=y CONFIG_CMD_BOOTM_OFTREE_UIMAGE=y CONFIG_CMD_UIMAGE=y -# CONFIG_CMD_BOOTZ is not set # CONFIG_CMD_BOOTU is not set CONFIG_CMD_RESET=y CONFIG_CMD_GO=y @@ -45,25 +44,29 @@ CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y CONFIG_CMD_GPIO=y -CONFIG_CMD_UNCOMPRESS=y +CONFIG_CMD_I2C=y CONFIG_NET=y CONFIG_NET_DHCP=y CONFIG_NET_NFS=y CONFIG_NET_PING=y -CONFIG_CMD_TFTP=y -CONFIG_FS_TFTP=y CONFIG_DRIVER_SERIAL_NS16550=y CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y +CONFIG_SMSC_PHY=y CONFIG_DRIVER_NET_SMC911X=y # CONFIG_SPI is not set +CONFIG_I2C=y +CONFIG_I2C_OMAP=y CONFIG_MTD=y CONFIG_NAND=y CONFIG_NAND_OMAP_GPMC=y CONFIG_UBI=y +CONFIG_USB=y CONFIG_MCI=y +CONFIG_MCI_STARTUP=y CONFIG_MCI_OMAP_HSMMC=y +CONFIG_I2C_TWL6030=y +CONFIG_FS_TFTP=y CONFIG_FS_FAT=y CONFIG_FS_FAT_WRITE=y CONFIG_FS_FAT_LFN=y -CONFIG_ZLIB=y CONFIG_LZO_DECOMPRESS=y diff --git a/arch/arm/configs/pcm049_xload_defconfig b/arch/arm/configs/pcm049_xload_defconfig index b6d3a7a..189c040 100644 --- a/arch/arm/configs/pcm049_xload_defconfig +++ b/arch/arm/configs/pcm049_xload_defconfig @@ -1,11 +1,12 @@ CONFIG_ARCH_OMAP=y +CONFIG_BAREBOX_MAX_IMAGE_SIZE=0xC000 CONFIG_ARCH_OMAP4=y CONFIG_OMAP_BUILD_IFT=y CONFIG_MACH_PCM049=y -CONFIG_AEABI=y CONFIG_THUMB2_BAREBOX=y # CONFIG_CMD_ARM_CPUINFO is not set # CONFIG_ARM_EXCEPTIONS is not set +# CONFIG_MEMINFO is not set CONFIG_MMU=y CONFIG_TEXT_BASE=0x4030 CONFIG_MEMORY_LAYOUT_FIXED=y -- 1.7.0.4 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox