Re: [PATCH 7/9] poller: allow to restrict the poller frequency
On 11:42 Mon 05 Jan , Sascha Hauer wrote: > On Tue, Dec 23, 2014 at 07:21:56PM +0100, Jean-Christophe PLAGNIOL-VILLARD > wrote: > > so we do not slow down barebox on too much polling > > specialy on USB drivers > > > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > > --- > > common/poller.c | 11 ++- > > include/poller.h | 3 +++ > > 2 files changed, 13 insertions(+), 1 deletion(-) > > Could you repost this along with the first user? I'm finishing to clean the USB HID driver that will use it Best Regards, J. > > > > > diff --git a/common/poller.c b/common/poller.c > > index 496636d..58b105d 100644 > > --- a/common/poller.c > > +++ b/common/poller.c > > @@ -24,6 +24,9 @@ int poller_register(struct poller_struct *poller) > > list_add_tail(&poller->list, &poller_list); > > poller->registered = 1; > > > > + if (poller->frequency) > > + poller->poll_next = get_time_ns(); > > + > > return 0; > > } > > > > @@ -96,8 +99,14 @@ void poller_call(void) > > > > poller_active = 1; > > > > - list_for_each_entry_safe(poller, tmp, &poller_list, list) > > + list_for_each_entry_safe(poller, tmp, &poller_list, list) { > > + > > + if (poller->frequency && get_time_ns() < poller->poll_next) > > + continue; > > poller->func(poller); > > + if (poller->frequency) > > + poller->poll_next += poller->frequency; > > + } > > > > poller_active = 0; > > } > > diff --git a/include/poller.h b/include/poller.h > > index cda5b57..3568a80 100644 > > --- a/include/poller.h > > +++ b/include/poller.h > > @@ -14,6 +14,9 @@ struct poller_struct { > > void (*func)(struct poller_struct *poller); > > int registered; > > struct list_head list; > > + > > + uint64_t frequency; > > + uint64_t poll_next; > > }; > > Could you reorder the fields in struct poller_struct by fields which > should be initialized by users and internal fields? This was not exactly > clear before this patch, but this patch introduces another two fields, > from which one must be initialized by the user and the other one not. > > Sascha > > -- > Pengutronix e.K. | | > Industrial Linux Solutions | http://www.pengutronix.de/ | > Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 9/9] defaultenv-2: create a specific defaultenv for splash
On 11:50 Mon 05 Jan , Sascha Hauer wrote: > On Tue, Dec 23, 2014 at 07:21:58PM +0100, Jean-Christophe PLAGNIOL-VILLARD > wrote: > > This will allow to factorize splash init > > > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > > --- > > common/Kconfig | 5 + > > defaultenv/Makefile| 1 + > > defaultenv/defaultenv-2-splash/bin/splash | 15 +++ > > defaultenv/defaultenv-2-splash/init/splash | 3 +++ > > defaultenv/defaultenv.c| 2 ++ > > 5 files changed, 26 insertions(+) > > create mode 100644 defaultenv/defaultenv-2-splash/bin/splash > > create mode 100644 defaultenv/defaultenv-2-splash/init/splash > > > > diff --git a/common/Kconfig b/common/Kconfig > > index 05f76ae..3f1ef6f 100644 > > --- a/common/Kconfig > > +++ b/common/Kconfig > > @@ -653,6 +653,11 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU > > depends on USB_GADGET_DFU > > default y > > > > +config DEFAULT_ENVIRONMENT_GENERIC_NEW_SPLASH > > + bool > > + depends on CMD_SPLASH > > + default y > > + > > config DEFAULT_ENVIRONMENT_GENERIC > > bool > > depends on !HAVE_DEFAULT_ENVIRONMENT_NEW > > diff --git a/defaultenv/Makefile b/defaultenv/Makefile > > index fc679eb..03d241c 100644 > > --- a/defaultenv/Makefile > > +++ b/defaultenv/Makefile > > @@ -1,6 +1,7 @@ > > bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW) += defaultenv-2-base > > bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_MENU) += defaultenv-2-menu > > bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU) += defaultenv-2-dfu > > +bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_SPLASH) += > > defaultenv-2-splash > > bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-1 > > obj-$(CONFIG_DEFAULT_ENVIRONMENT) += defaultenv.o > > extra-y += barebox_default_env barebox_default_env.h > > barebox_default_env$(DEFAULT_COMPRESSION_SUFFIX) > > diff --git a/defaultenv/defaultenv-2-splash/bin/splash > > b/defaultenv/defaultenv-2-splash/bin/splash > > new file mode 100644 > > index 000..352439d > > --- /dev/null > > +++ b/defaultenv/defaultenv-2-splash/bin/splash > > @@ -0,0 +1,15 @@ > > +#!/bin/sh > > + > > +splash="/env/splash.png" > > + > > +if [ ! -f ${splash} ]; then > > + return > > +fi > > + > > +splash ${splash} > > + > > +if [ $? = 0 ]; then > > + fb0.enable=1 > > +else > > + echo "Cannot show splash image" > > +fi > > diff --git a/defaultenv/defaultenv-2-splash/init/splash > > b/defaultenv/defaultenv-2-splash/init/splash > > new file mode 100644 > > index 000..04fdc8e > > --- /dev/null > > +++ b/defaultenv/defaultenv-2-splash/init/splash > > @@ -0,0 +1,3 @@ > > +#!/bin/sh > > + > > +/env/bin/splash > > Why do you need a separate /env/bin/splash here? Can't you add its > content here directly? > If we keep it, it should have the same name as the 'splash' command. The problem today is that the generic init is not ordered (such as rc.{0-9}) on linux so if we need specific init before the splash we can not ensure it buy adding an init file that will be added to be run before The only way is to overwrite the init or we do introduct a rc.d style buy starting the init with 000-xxx style file name or link Best Regards, J. > > Sascha > > -- > Pengutronix e.K. | | > Industrial Linux Solutions | http://www.pengutronix.de/ | > Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH] mtd: nand: add pxa3xx-nand driver
Ezequiel Garcia writes: > On 01/05/2015 05:32 PM, Robert Jarzmik wrote: >> I have an idea here : as barebox is not performance oriented, and as the >> timings >> are minimum guaranteed times between signal swaps, let me try to hard encode >> all >> timing with their maximum value. > > Sounds a good plan to me. And unfortunately it doesn't work. Too relaxed timings imply "fake" bytes returned by the flash NAND to the NAND controler. So I have to keep a table of timings at least. Cheers. -- Robert ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH v2 1/2] ARM: pxa: add pxa3xx architecture
Sascha Hauer writes: > On Sun, Jan 04, 2015 at 10:41:05AM +0100, Robert Jarzmik wrote: >> +#ifdef CONFIG_ARCH_PXA2XX >> pxa_suspend(PWRMODE_DEEPSLEEP); >> +#endif >> +#ifdef CONFIG_ARCH_PXA3XX >> +pxa3xx_suspend(PXA3xx_PM_S3D4C4); >> +#endif > > if (cpu_is_*()) > > instead of ifdefs? That was my first try, but compilation did fail. Yet your other suggestion (separate by SoC type) could take care of it. > >> unreachable(); >> } >> diff --git a/arch/arm/mach-pxa/mfp.c b/arch/arm/mach-pxa/mfp.c > > Better mfp-pxa3xx.c analog to mfp-pxa2xx.c? Definitely, for v2. > Instead of separating the source files by functionality you could > separate them by SoC type. This would reduce the need for ifdefs. Yes, good idea. I'll create pxa3xx.c and pxa2xx.c, and stuff them with poweroff(), reset_source(), etc ..., each with its own variant. Cheers. -- Robert ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH] mtd: nand: add pxa3xx-nand driver
On 01/05/2015 05:32 PM, Robert Jarzmik wrote: > I have an idea here : as barebox is not performance oriented, and as the > timings > are minimum guaranteed times between signal swaps, let me try to hard encode > all > timing with their maximum value. Sounds a good plan to me. -- Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH] mtd: nand: add pxa3xx-nand driver
Sascha Hauer writes: > Hi Robert, > > Things like mtd->writesize, mtd->erasesize, and mtd->size should be > initialized after calling nand_scan_ident(). These are currently > overwritten by the pxa nand driver, but normally you should be able to > remove this. You're right, the extended id parsing should take care of that. > IIRC barebox can also detect the chip widths automatically. Yup, that's also in the extended id parsing. > I don't know how to get the timings though. I have an idea here : as barebox is not performance oriented, and as the timings are minimum guaranteed times between signal swaps, let me try to hard encode all timing with their maximum value. Of course performance will suffer, but as long it remains usable with a loss of 20% or less in throughput, that will be a cool simplification. Cheers. -- Robert ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH] net: rtl8169: remove unnecessary cache maintenance
Am Montag, den 05.01.2015, 20:19 +0300 schrieb Antony Pavlov: > On Sun, 4 Jan 2015 22:09:05 +0100 > Lucas Stach wrote: > > I suppose that this patch can make problems on MIPS with explicid cache > handling. > How would it? This driver is ARM only for now (as we are using ARM MMU functions to flush buffers) until someone gets around to properly implement generic dma sync ops. But even then MIPS knows about uncached memory types which is exactly what should be returned for a dma coherent memory allocation. Regards, Lucas > > The buffer descriptors are allocated from coherent memory, so there > > is no cache maintenance needed. Only tell the compiler that the descriptors > > can be modified by the hardware. > > > > Signed-off-by: Lucas Stach > > --- > > drivers/net/rtl8169.c | 24 +--- > > 1 file changed, 5 insertions(+), 19 deletions(-) > > > > diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c > > index 5702900..19f5763 100644 > > --- a/drivers/net/rtl8169.c > > +++ b/drivers/net/rtl8169.c > > @@ -50,11 +50,11 @@ struct rtl8169_priv { > > struct pci_dev *pci_dev; > > int chipset; > > > > - struct bufdesc *tx_desc; > > + volatile struct bufdesc *tx_desc; > > void*tx_buf; > > unsigned intcur_tx; > > > > - struct bufdesc *rx_desc; > > + volatile struct bufdesc *rx_desc; > > void*rx_buf; > > unsigned intcur_rx; > > > > @@ -250,10 +250,6 @@ static void rtl8169_init_ring(struct rtl8169_priv > > *priv) > > priv->rx_desc[i].buf_addr = > > virt_to_phys(priv->rx_buf + i * PKT_BUF_SIZE); > > } > > - > > - dma_flush_range((unsigned long)priv->rx_desc, > > - (unsigned long)priv->rx_desc + > > - NUM_RX_DESC * sizeof(struct bufdesc)); > > } > > > > static void rtl8169_hw_start(struct rtl8169_priv *priv) > > @@ -386,14 +382,10 @@ static int rtl8169_eth_send(struct eth_device *edev, > > void *packet, > > ((packet_length > ETH_ZLEN) ? packet_length : ETH_ZLEN); > > } > > > > - dma_flush_range((unsigned long)&priv->tx_desc[entry], > > - (unsigned long)&priv->tx_desc[entry + 1]); > > - > > RTL_W8(priv, TxPoll, 0x40); > > - do { > > - dma_inv_range((unsigned long)&priv->tx_desc[entry], > > - (unsigned long)&priv->tx_desc[entry + 1]); > > - } while (priv->tx_desc[entry].status & BD_STAT_OWN); > > + > > + while (priv->tx_desc[entry].status & BD_STAT_OWN) > > + ; > > > > priv->cur_tx++; > > > > @@ -408,9 +400,6 @@ static int rtl8169_eth_rx(struct eth_device *edev) > > > > entry = priv->cur_rx % NUM_RX_DESC; > > > > - dma_inv_range((unsigned long)&priv->rx_desc[entry], > > - (unsigned long)&priv->rx_desc[entry + 1]); > > - > > if ((priv->rx_desc[entry].status & BD_STAT_OWN) == 0) { > > if (!(priv->rx_desc[entry].status & BD_STAT_RX_RES)) { > > pkt_size = (priv->rx_desc[entry].status & 0x1fff) - 4; > > @@ -441,9 +430,6 @@ static int rtl8169_eth_rx(struct eth_device *edev) > > priv->rx_desc[entry].buf_addr = > > virt_to_phys(priv->rx_buf + > > entry * PKT_BUF_SIZE); > > - > > - dma_flush_range((unsigned long)&priv->rx_desc[entry], > > - (unsigned long)&priv->rx_desc[entry + > > 1]); > > } else { > > dev_err(&edev->dev, "rx error\n"); > > } > > -- > > 2.1.0 > > > > > > ___ > > 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
Re: [PATCH] net: rtl8169: remove unnecessary cache maintenance
On Sun, 4 Jan 2015 22:09:05 +0100 Lucas Stach wrote: I suppose that this patch can make problems on MIPS with explicid cache handling. > The buffer descriptors are allocated from coherent memory, so there > is no cache maintenance needed. Only tell the compiler that the descriptors > can be modified by the hardware. > > Signed-off-by: Lucas Stach > --- > drivers/net/rtl8169.c | 24 +--- > 1 file changed, 5 insertions(+), 19 deletions(-) > > diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c > index 5702900..19f5763 100644 > --- a/drivers/net/rtl8169.c > +++ b/drivers/net/rtl8169.c > @@ -50,11 +50,11 @@ struct rtl8169_priv { > struct pci_dev *pci_dev; > int chipset; > > - struct bufdesc *tx_desc; > + volatile struct bufdesc *tx_desc; > void*tx_buf; > unsigned intcur_tx; > > - struct bufdesc *rx_desc; > + volatile struct bufdesc *rx_desc; > void*rx_buf; > unsigned intcur_rx; > > @@ -250,10 +250,6 @@ static void rtl8169_init_ring(struct rtl8169_priv *priv) > priv->rx_desc[i].buf_addr = > virt_to_phys(priv->rx_buf + i * PKT_BUF_SIZE); > } > - > - dma_flush_range((unsigned long)priv->rx_desc, > - (unsigned long)priv->rx_desc + > - NUM_RX_DESC * sizeof(struct bufdesc)); > } > > static void rtl8169_hw_start(struct rtl8169_priv *priv) > @@ -386,14 +382,10 @@ static int rtl8169_eth_send(struct eth_device *edev, > void *packet, > ((packet_length > ETH_ZLEN) ? packet_length : ETH_ZLEN); > } > > - dma_flush_range((unsigned long)&priv->tx_desc[entry], > - (unsigned long)&priv->tx_desc[entry + 1]); > - > RTL_W8(priv, TxPoll, 0x40); > - do { > - dma_inv_range((unsigned long)&priv->tx_desc[entry], > - (unsigned long)&priv->tx_desc[entry + 1]); > - } while (priv->tx_desc[entry].status & BD_STAT_OWN); > + > + while (priv->tx_desc[entry].status & BD_STAT_OWN) > + ; > > priv->cur_tx++; > > @@ -408,9 +400,6 @@ static int rtl8169_eth_rx(struct eth_device *edev) > > entry = priv->cur_rx % NUM_RX_DESC; > > - dma_inv_range((unsigned long)&priv->rx_desc[entry], > - (unsigned long)&priv->rx_desc[entry + 1]); > - > if ((priv->rx_desc[entry].status & BD_STAT_OWN) == 0) { > if (!(priv->rx_desc[entry].status & BD_STAT_RX_RES)) { > pkt_size = (priv->rx_desc[entry].status & 0x1fff) - 4; > @@ -441,9 +430,6 @@ static int rtl8169_eth_rx(struct eth_device *edev) > priv->rx_desc[entry].buf_addr = > virt_to_phys(priv->rx_buf + >entry * PKT_BUF_SIZE); > - > - dma_flush_range((unsigned long)&priv->rx_desc[entry], > - (unsigned long)&priv->rx_desc[entry + > 1]); > } else { > dev_err(&edev->dev, "rx error\n"); > } > -- > 2.1.0 > > > ___ > barebox mailing list > barebox@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/barebox -- -- Best regards, Antony Pavlov ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH] net: smc1111: fix memory congestions
- Mail original - De: "Sascha Hauer" À: "Robert Jarzmik" Cc: barebox@lists.infradead.org Envoyé: Lundi 5 Janvier 2015 13:11:50 Objet: Re: [PATCH] net: smc: fix memory congestions > I don't know the hardware (not anymore, fortunately ;), but isn't it > possible to dedicate one bucket for transmitting only, so that it will > never be occupied by a received packet? None I'm aware of. I've been through the specification many times, and my understanding is that : - the MMU allocation is symmetric (either from CPU for TX or from NIC for RX) - there is no configurable threshold or limit - first customer is first served from the MMU point of view Cheers. -- Robert ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 1/2] arm: system_info fix CPU_IS_ARM1176
we need to apply the mask Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- arch/arm/include/asm/system_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/include/asm/system_info.h b/arch/arm/include/asm/system_info.h index 6182860..0761848 100644 --- a/arch/arm/include/asm/system_info.h +++ b/arch/arm/include/asm/system_info.h @@ -23,7 +23,7 @@ #define CPU_IS_ARM926 0x41069260 #define CPU_IS_ARM926_MASK 0xff00 -#define CPU_IS_ARM1176 0x410fb767 +#define CPU_IS_ARM1176 0x410fb760 #define CPU_IS_ARM1176_MASK0xff00 #define CPU_IS_CORTEX_A8 0x410fc080 -- 2.1.3 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 2/2] versatilepb: allow to compile it an arm1176
usefull to use it for testing on qemu Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- arch/arm/Kconfig | 1 - arch/arm/boards/versatile/env/nv/hostname | 1 - arch/arm/boards/versatile/versatilepb.c| 15 +++- arch/arm/configs/versatilepb_arm1176_defconfig | 99 ++ arch/arm/mach-versatile/Kconfig| 17 +++-- 5 files changed, 126 insertions(+), 7 deletions(-) delete mode 100644 arch/arm/boards/versatile/env/nv/hostname create mode 100644 arch/arm/configs/versatilepb_arm1176_defconfig diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 4aa6afe..f736349 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -188,7 +188,6 @@ config ARCH_S3C64xx config ARCH_VERSATILE bool "ARM Versatile boards (ARM926EJ-S)" - select CPU_ARM926T select GPIOLIB select HAVE_CLK diff --git a/arch/arm/boards/versatile/env/nv/hostname b/arch/arm/boards/versatile/env/nv/hostname deleted file mode 100644 index 7cdb629..000 --- a/arch/arm/boards/versatile/env/nv/hostname +++ /dev/null @@ -1 +0,0 @@ -versatilepb diff --git a/arch/arm/boards/versatile/versatilepb.c b/arch/arm/boards/versatile/versatilepb.c index f854394..419279f 100644 --- a/arch/arm/boards/versatile/versatilepb.c +++ b/arch/arm/boards/versatile/versatilepb.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -32,7 +33,19 @@ static int vpb_console_init(void) { - barebox_set_hostname("versatilepb"); + char *hostname = "versatilepb-unknown"; + char *model = "ARM Versatile PB"; + + if (cpu_is_arm926()) { + hostname = "versatilepb-arm926"; + model = "ARM Versatile PB (arm926)"; + } else if (cpu_is_arm1176()) { + hostname = "versatilepb-arm1176"; + model = "ARM Versatile PB (arm1176)"; + } + + barebox_set_hostname(hostname); + barebox_set_model(model); versatile_register_uart(0); return 0; diff --git a/arch/arm/configs/versatilepb_arm1176_defconfig b/arch/arm/configs/versatilepb_arm1176_defconfig new file mode 100644 index 000..ca0ab36 --- /dev/null +++ b/arch/arm/configs/versatilepb_arm1176_defconfig @@ -0,0 +1,99 @@ +CONFIG_BUILTIN_DTB=y +CONFIG_BUILTIN_DTB_NAME="versatile-pb" +CONFIG_ARCH_VERSATILE=y +CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x8 +CONFIG_MACH_VERSATILEPB_ARM1176=y +CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y +CONFIG_PBL_IMAGE=y +CONFIG_PBL_RELOCATABLE=y +CONFIG_MALLOC_SIZE=0xa0 +CONFIG_PROMPT="versatilepb> " +CONFIG_HUSH_FANCY_PROMPT=y +CONFIG_CMDLINE_EDITING=y +CONFIG_AUTO_COMPLETE=y +CONFIG_MENU=y +CONFIG_CONSOLE_ACTIVATE_ALL=y +CONFIG_DEFAULT_COMPRESSION_GZIP=y +CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y +CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/versatile/env" +CONFIG_CMD_DMESG=y +CONFIG_LONGHELP=y +CONFIG_CMD_IOMEM=y +CONFIG_CMD_MEMINFO=y +CONFIG_CMD_BOOTM_SHOW_TYPE=y +CONFIG_CMD_BOOTM_VERBOSE=y +CONFIG_CMD_BOOTM_INITRD=y +CONFIG_CMD_BOOTM_OFTREE=y +CONFIG_CMD_BOOTM_OFTREE_UIMAGE=y +CONFIG_CMD_GO=y +CONFIG_CMD_LOADB=y +CONFIG_CMD_RESET=y +CONFIG_CMD_PARTITION=y +CONFIG_CMD_UBIFORMAT=y +CONFIG_CMD_EXPORT=y +CONFIG_CMD_LOADENV=y +CONFIG_CMD_PRINTENV=y +CONFIG_CMD_MAGICVAR=y +CONFIG_CMD_MAGICVAR_HELP=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_FILETYPE=y +CONFIG_CMD_UNCOMPRESS=y +CONFIG_CMD_SLEEP=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_PING=y +CONFIG_CMD_TFTP=y +CONFIG_CMD_ECHO_E=y +CONFIG_CMD_EDIT=y +CONFIG_CMD_LOGIN=y +CONFIG_CMD_MENU=y +CONFIG_CMD_MENU_MANAGEMENT=y +CONFIG_CMD_PASSWD=y +CONFIG_CMD_SPLASH=y +CONFIG_CMD_READLINE=y +CONFIG_CMD_TIMEOUT=y +CONFIG_CMD_CRC=y +CONFIG_CMD_CRC_CMP=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_I2C=y +CONFIG_CMD_OF_NODE=y +CONFIG_CMD_OF_PROPERTY=y +CONFIG_CMD_OFTREE=y +CONFIG_NET=y +CONFIG_NET_NFS=y +CONFIG_NET_NETCONSOLE=y +CONFIG_NET_RESOLV=y +CONFIG_OFDEVICE=y +CONFIG_OF_BAREBOX_DRIVERS=y +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_USB=y +CONFIG_SERIAL_USB_FTDI=y +CONFIG_DRIVER_NET_SMC9=y +CONFIG_I2C=y +CONFIG_I2C_VERSATILE=y +CONFIG_MTD=y +CONFIG_DRIVER_CFI=y +# CONFIG_DRIVER_CFI_AMD is not set +# CONFIG_DRIVER_CFI_BANK_WIDTH_1 is not set +# CONFIG_DRIVER_CFI_BANK_WIDTH_2 is not set +CONFIG_MTD_UBI=y +CONFIG_USB_HOST=y +CONFIG_USB_EHCI=y +CONFIG_USB_STORAGE=y +CONFIG_VIDEO=y +CONFIG_DRIVER_VIDEO_ARMCLCD=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE_SELF_REGISTER=y +CONFIG_FONTS=y +# CONFIG_FONT_8x8 is not set +CONFIG_FONT_ACORN_8x8=y +CONFIG_GPIO_PL061=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_DS1307=y +CONFIG_FS_CRAMFS=y +CONFIG_FS_EXT4=y +CONFIG_FS_TFTP=y +CONFIG_FS_NFS=y +CONFIG_PNG=y +CONFIG_SHA1=y +CONFIG_SHA256=y diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig index f902576..755fdc1 100644 --- a/arch/arm/mach-versatile/Kconfig +++ b/arch/arm/mach-versatile/Kconfig @@ -4,15 +4,24 @@ if ARCH_VERSATILE config ARCH_TEXT_BASE default 0x0200 -choice -
Re: [PATCH v2 1/2] ARM: pxa: add pxa3xx architecture
On Sun, Jan 04, 2015 at 10:41:05AM +0100, Robert Jarzmik wrote: > Add the pxa3xx architecture, for pxa300, pxa310 and pxa320 SoCs. > This includes : > - the registers > - the cpu type > - the reset source handling > - a minimal set of clocks > - pin control definitions >In this last case, the big mfp-pxaxxx.h files were dropped, forcing >board developers to use MFP_LPM_* macros cunningly. > > Signed-off-by: Robert Jarzmik > --- > arch/arm/cpu/Kconfig | 6 + > arch/arm/mach-pxa/Kconfig| 19 ++ > arch/arm/mach-pxa/Makefile | 1 + > arch/arm/mach-pxa/common.c | 12 +- > arch/arm/mach-pxa/include/mach/clock.h | 1 + > arch/arm/mach-pxa/include/mach/hardware.h| 18 +- > arch/arm/mach-pxa/include/mach/mfp-pxa3xx.h | 25 ++ > arch/arm/mach-pxa/include/mach/pxa-regs.h| 4 +- > arch/arm/mach-pxa/include/mach/pxa3xx-regs.h | 224 ++ > arch/arm/mach-pxa/include/plat/mfp.h | 7 +- > arch/arm/mach-pxa/mfp.c | 338 > +++ > arch/arm/mach-pxa/reset_source.c | 36 +++ > arch/arm/mach-pxa/sleep.S| 9 + > arch/arm/mach-pxa/speed-pxa3xx.c | 33 +++ > 14 files changed, 725 insertions(+), 8 deletions(-) > create mode 100644 arch/arm/mach-pxa/include/mach/mfp-pxa3xx.h > create mode 100644 arch/arm/mach-pxa/include/mach/pxa3xx-regs.h > create mode 100644 arch/arm/mach-pxa/mfp.c > create mode 100644 arch/arm/mach-pxa/speed-pxa3xx.c > > - > + pxa_clear_reset_source(); > +#ifdef CONFIG_ARCH_PXA2XX > pxa_suspend(PWRMODE_DEEPSLEEP); > +#endif > +#ifdef CONFIG_ARCH_PXA3XX > + pxa3xx_suspend(PXA3xx_PM_S3D4C4); > +#endif if (cpu_is_*()) instead of ifdefs? > unreachable(); > } > diff --git a/arch/arm/mach-pxa/mfp.c b/arch/arm/mach-pxa/mfp.c Better mfp-pxa3xx.c analog to mfp-pxa2xx.c? > diff --git a/arch/arm/mach-pxa/reset_source.c > b/arch/arm/mach-pxa/reset_source.c > index a90584b..0730e02 100644 > --- a/arch/arm/mach-pxa/reset_source.c > +++ b/arch/arm/mach-pxa/reset_source.c Instead of separating the source files by functionality you could separate them by SoC type. This would reduce the need for ifdefs. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH] net: cpsw: Fix crashes on beaglebone black
Hello Philippe, Am Samstag, den 27.12.2014, 15:39 +0100 schrieb ledphili...@gmail.com: > Hello, > > The current version (2014.12.0-00116-ge91702b) crashes on the beaglebone > black > if the ethernet driver is enabled. Here is the trace: > > barebox 2014.12.0-00116-ge91702b #15 Sat Dec 27 15:30:25 CET 2014 > > > Board: TI AM335x BeagleBone black > detected 'BeagleBone Black' > cpsw 4a10.ethernet: detected phy mask 0x1 > mdio_bus: miibus0: probed > eth0: got preset MAC address: d0:39:72:41:0a:26 > cpsw 4a10.ethernet: probe failed: I/O error > unable to handle paging request at address 0x6e6f62f2 > pc : [<9fe24e4a>]lr : [<9fe0751f>] > sp : 9e60 ip : fp : > r10: 8ff1d8b8 r9 : 8ff12534 r8 : 8ff1d974 > r7 : r6 : 8ff1d8e0 r5 : 9fe55220 r4 : 6e6f62f2 > r3 : r2 : r1 : 8ff1d8e0 r0 : 6e6f62f2 > Flags: nZCV IRQs off FIQs on Mode SVC_32 > [<9fe24e4a>] (strcmp+0xc/0x1a) from [<9fe0751f>] > (get_device_by_name_id+0x1f/0x38) > [<9fe0751f>] (get_device_by_name_id+0x1f/0x38) from [<9fe07837>] > (register_device+0x17/0xc8) > [<9fe07837>] (register_device+0x17/0xc8) from [<9fe1dcb3>] > (of_platform_device_create+0x17b/0x1b0) > [<9fe1dcb3>] (of_platform_device_create+0x17b/0x1b0) from [<9fe1dd13>] > (of_platform_bus_create+0x2b/0x68) > [<9fe1dd13>] (of_platform_bus_create+0x2b/0x68) from [<9fe1dda7>] > (of_platform_populate+0x2f/0x44) > [<9fe1dda7>] (of_platform_populate+0x2f/0x44) from [<9fe07967>] > (platform_probe+0x9/0xa) > [<9fe07967>] (platform_probe+0x9/0xa) from [<9fe07561>] > (device_probe+0x11/0x44) > [<9fe07561>] (device_probe+0x11/0x44) from [<9fe075bb>] > (match.part.2+0x27/0x2e) > [<9fe075bb>] (match.part.2+0x27/0x2e) from [<9fe076d5>] > (register_driver+0x59/0x74) > [<9fe076d5>] (register_driver+0x59/0x74) from [<9fe00827>] > (start_barebox+0x1b/0xb8) > [<9fe00827>] (start_barebox+0x1b/0xb8) from [<9fe3291f>] (__start+0xa3/0xb8) > [<9fe3291f>] (__start+0xa3/0xb8) from [<9fe5>] (__bare_init_start+0x1/0xc) > > [<9fe32349>] (unwind_backtrace+0x1/0x58) from [<9fe258e9>] (panic+0x1d/0x34) > [<9fe258e9>] (panic+0x1d/0x34) from [<9fe327e1>] (do_exception+0xd/0x10) > [<9fe327e1>] (do_exception+0xd/0x10) from [<9fe32849>] > (do_data_abort+0x21/0x2c) > [<9fe32849>] (do_data_abort+0x21/0x2c) from [<9fe32508>] > (data_abort+0x48/0x60) > > I suspect the issue comes from the dummy cpsw_emac1 node which adds a non existing phy in the beaglebone device tree. So the mdiobus_scan fails. This patch will workaround the issue but I'm unsure about right solution here. Regards, Teresa > > The following patch resolves the problem on my board. Please review it and > check if it is fine. > > Regards, > > > Signed-off-by: Philippe Leduc > --- > drivers/net/cpsw.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c > index b6618ad..311cd44 100644 > --- a/drivers/net/cpsw.c > +++ b/drivers/net/cpsw.c > @@ -1202,10 +1202,8 @@ int cpsw_probe(struct device_d *dev) > struct phy_device *phy; > > phy = mdiobus_scan(&priv->miibus, priv->slaves[i].phy_id); > - if (IS_ERR(phy)) { > - ret = PTR_ERR(phy); > - goto out; > - } > + if (IS_ERR(phy)) > + continue; > > phy->dev.device_node = priv->slaves[i].dev.device_node; > ret = phy_register_device(phy); ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH v2] i2c: omap: fix fclk_rate for ti,omap4-i2c
On Thu, Dec 11, 2014 at 10:47:59AM +0100, Jan Weitzel wrote: > The compatible "ti,omap4-i2c" don't help to get fclk_rate. So set it acording > to > cpu compatible: "ti,am33xx" and "ti,omap4" > > Signed-off-by: Jan Weitzel > --- > v2: set i2c_data directly >-9.0.1.i586.deb ping Jan > drivers/i2c/busses/i2c-omap.c | 11 +-- > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c > index 094f591..96c3c2b 100644 > --- a/drivers/i2c/busses/i2c-omap.c > +++ b/drivers/i2c/busses/i2c-omap.c > @@ -271,11 +271,6 @@ static struct omap_i2c_driver_data am33xx_data = { > .fclk_rate =48000, > }; > > -static struct omap_i2c_driver_data omap4_of_data = { > - .flags =OMAP_I2C_FLAG_BUS_SHIFT_NONE, > - .fclk_rate =0, > -}; > - > static inline void omap_i2c_write_reg(struct omap_i2c_struct *i2c_omap, > int reg, u16 val) > { > @@ -1011,6 +1006,11 @@ i2c_omap_probe(struct device_d *pdev) > if (r) > return r; > > + if (of_machine_is_compatible("ti,am33xx")) > + i2c_data = &am33xx_data; > + if (of_machine_is_compatible("ti,omap4")) > + i2c_data = &omap4_data; > + > i2c_omap->data = i2c_data; > i2c_omap->reg_shift = (i2c_data->flags >> > OMAP_I2C_FLAG_BUS_SHIFT__SHIFT) & 3; > @@ -1140,7 +1140,6 @@ static __maybe_unused struct of_device_id > omap_i2c_dt_ids[] = { > .data = (unsigned long)&omap3_data, > }, { > .compatible = "ti,omap4-i2c", > - .data = (unsigned long)&omap4_of_data, > }, { > /* sentinel */ > } > -- > 1.9.1 > > > ___ > 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
Re: [PATCH] net: smc1111: move print_packet function
On Thu, Jan 01, 2015 at 09:04:23PM +0100, Robert Jarzmik wrote: > Fix for a compiler complaint, because print_packet is needed by a > function before it is declared. > > Signed-off-by: Robert Jarzmik Applied, thanks Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH] commands: loady: fix bug with netconsole
On Thu, Jan 01, 2015 at 09:04:21PM +0100, Robert Jarzmik wrote: > Netconsole doesn't have a baudrate. Loady supposes a console has one, > and tries to compute the console's baudrate variable value, regardless > of its existence. > > This triggers a NULL pointer dereference on netconsole. If attempting > loady on a netconsole is a bit useless, barebox should not panic. Fix > this by checking the variable exists before reading its value. > > Signed-off-by: Robert Jarzmik Applied, thanks Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH] net: smc1111: fix memory congestions
On Thu, Jan 01, 2015 at 09:04:22PM +0100, Robert Jarzmik wrote: > As the SMC has a shared pool of 2k memory buckets for both > transmission and reception, and as there are variants which have as few > as 4 buckets in total, the memory pool can be hogged by unclaimed > receptions, and impeed any further transmission. > > This happens on the zylonite pxa board, where 4 packets, most probably > icmp and arp, fill the 4 buckets, preventing any further ethernet > transmission, and stalling the driver. > > The fix is rather rough : whenever all the buckets are filled by > reception packets, and if a transmission is required, the transmission > code path will empty up all received packets. I don't know the hardware (not anymore, fortunately ;), but isn't it possible to dedicate one bucket for transmitting only, so that it will never be occupied by a received packet? Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH] mtd: nand: add pxa3xx-nand driver
Hi Robert, On Mon, Jan 05, 2015 at 11:44:38AM +0100, robert.jarz...@free.fr wrote: > - Mail original - > De: "Ezequiel Garcia" > À: "Robert Jarzmik" , barebox@lists.infradead.org > Envoyé: Dimanche 4 Janvier 2015 19:50:55 > Objet: Re: [PATCH] mtd: nand: add pxa3xx-nand driver > > Hi Robert, > > > If my memory doesn't fail me, the NAND controller is called NFC v1 on > > pxa3xx, and NFC v2 on mvebu SoCs. > > I'm wondering if we can pick a better name for this driver in barebox. > > Maybe something like 'mv_nfc_nand' ? > As all drivers are called "nand_XXX", I'd rather have it nand_mrvl_nfc then. > Does that sound good to you ? > > > Also, I think you can get rid of the 'builtin_flash_types' struct and > > all the device detection routines, which are really duplicating the > > MTD's lower level job. > Well, not really. If I get rid of them, how will I get the following > information : > - page size > - nand timings (tHP, ...) > - controller width to use > - ... Things like mtd->writesize, mtd->erasesize, and mtd->size should be initialized after calling nand_scan_ident(). These are currently overwritten by the pxa nand driver, but normally you should be able to remove this. IIRC barebox can also detect the chip widths automatically. I don't know how to get the timings though. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [REGRESSION BUG] at91 is broken on barebox
Since I also ran into this issue just before the holidays, I thought I'd provide my 0.02$. On 5 January 2015 at 11:23, Sascha Hauer wrote: > On Fri, Dec 26, 2014 at 10:51:43AM +0100, Jean-Christophe PLAGNIOL-VILLARD > wrote: >> HI, >> >> since the switch to ERR_PTR & co >> >> for dev_get_resource_by_name & others the at91 is broken >> >> as on barebox we use a 1:1 mapping and the check of the IS_ERR is >> ((unsigned long)-MAX_ERRNO) >> >> but on at91 the PIT and so on are at 0xfd30 so on always seen as >> an error > > Damn :( > > Since dev_get_resource_by_name returns a struct resource pointer it > shouldn't be broken, right? What's broken should be: > > dev_get_mem_region_by_name > dev_request_mem_region_by_name > dev_request_mem_region > > > Correct, these function returns the 'start' field of the struct resource, which contains the offending address. >> >> so can we revert the commit on >> >> ommit 92cc1b1f9e3363046583962859a3a8c054f4b94d > > Since these commits touch so many files I'm not sure we can simply > revert these commits. All drivers that check for IS_ERR() from the above > functions that were introduced after the commits to revert would have to > be changed aswell. > > The functions should still work, but the error check with IS_ERR() does > not, right? So as a stop gap solution we could drop the error check from > the affected drivers and as the next step change the prototype of the > affected functions to something like: > > int dev_request_mem_region(struct device_d *dev, int num, void __iomem > **base); > Sounds like the only sane way, and that is also the point when I realized that I had to put the fix on my TODO-list and live with the workaround for now, since I have a few show-stopping issues that I have to deal with first :-( > Which drivers are affected anyway? > I've had to remove the IS_ERR() check in: arch/arm/mach-at91/at91sam926x_time.c drivers/pinctrl/at91-pinctrl.c drivers/serial/atmel.c There might be more drivers affected, but the list of drivers to check shouldn't be that long, see the memory map on page 15 in the reference manual[1]. Since it checks the base-address the AIC (0xf000) should be fine, but the rest (PIOA, PIOB, ...) could incorrectly fail. Best, Simon Aittamaa [1]: http://www.atmel.com/Images/doc6221.pdf > Sascha > > -- > Pengutronix e.K. | | > Industrial Linux Solutions | http://www.pengutronix.de/ | > Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | > > ___ > barebox mailing list > barebox@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/barebox ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH] net: rtl8169: remove unnecessary cache maintenance
On Sun, Jan 04, 2015 at 10:09:05PM +0100, Lucas Stach wrote: > The buffer descriptors are allocated from coherent memory, so there > is no cache maintenance needed. Only tell the compiler that the descriptors > can be modified by the hardware. > > Signed-off-by: Lucas Stach Applied, thanks Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 0/6] ARM: introduce debug_ll_pl011.h
On Sat, Dec 27, 2014 at 02:56:23AM +0300, Antony Pavlov wrote: > Antony Pavlov (6): > ARM: introduce debug_ll_pl011.h > ARM: vexpress: debug_ll.h: switch to debug_ll_pl011.h > ARM: highbank: debug_ll.h: switch to debug_ll_pl011.h > ARM: versatile: enable missed HAS_DEBUG_LL > ARM: versatile: debug_ll.h: switch to debug_ll_pl011.h > ARM: bcm2835: add DEBUG_LL support Applied, thanks Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 0/3] kbuild: drop redundant code
Hi Masahiro, On Wed, Dec 24, 2014 at 01:20:59PM +0900, Masahiro Yamada wrote: > > > > Masahiro Yamada (3): > kbuild: remove redundant -include include/generated/autoconf.h > kbuild: do not create symbolic link include/asm > kbuild: do not create include2 directory Very nice stuff. It has some fixes in areas people (including me) normally don't want to touch. Thanks for doing this. Applied all, also the other kbuild patches you sent. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 6/9] console: factorize kfifo input support
On Tue, Dec 23, 2014 at 07:21:55PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > handle input fifo at console framework level instead of driver > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > --- > common/Kconfig | 3 ++ > common/console.c | 8 + > common/console_common.c| 71 > ++ > common/console_simple.c| 4 +++ > drivers/input/Kconfig | 4 +++ > drivers/input/gpio_keys.c | 43 - > drivers/input/imx_keypad.c | 29 ++--- > drivers/input/qt1070.c | 28 ++--- > drivers/input/twl6030_pwrbtn.c | 32 ++- > include/console.h | 22 + > include/gpio_keys.h| 1 - > 11 files changed, 124 insertions(+), 121 deletions(-) Instead of integrating this into the core code can we make this a helper function? Something like: struct console_poller { struct poller poller; struct kfifo fifo; struct console_device *cdev; int (*tstc)(struct console_device *cdev) int (*getc)(struct console_device *cdev) }; int console_init_input_fifo(struct console_poller *copo) { if (!copo->cdev || !copo->getc || !copo->tstc) return -EINVAL; copo->cdev->tstc = console_fifo_tstc; copo->cdev->getc = console_fifo_getc; /* init kfifo / poller */ return 0; } ... struct gpio_keys { ... struct console_poller copo; ... }; static int __init gpio_keys_probe(struct device_d *dev) { ... gk->copo.getc = gpio_keys_getc; gk->copo.tstc = gpio_keys_tstc; console_init_input_fifo(&gk->copo); } That would make the Kconfig option unnecessary and the core wouldn't get more complicated. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 9/9] defaultenv-2: create a specific defaultenv for splash
On Tue, Dec 23, 2014 at 07:21:58PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > This will allow to factorize splash init > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > --- > common/Kconfig | 5 + > defaultenv/Makefile| 1 + > defaultenv/defaultenv-2-splash/bin/splash | 15 +++ > defaultenv/defaultenv-2-splash/init/splash | 3 +++ > defaultenv/defaultenv.c| 2 ++ > 5 files changed, 26 insertions(+) > create mode 100644 defaultenv/defaultenv-2-splash/bin/splash > create mode 100644 defaultenv/defaultenv-2-splash/init/splash > > diff --git a/common/Kconfig b/common/Kconfig > index 05f76ae..3f1ef6f 100644 > --- a/common/Kconfig > +++ b/common/Kconfig > @@ -653,6 +653,11 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU > depends on USB_GADGET_DFU > default y > > +config DEFAULT_ENVIRONMENT_GENERIC_NEW_SPLASH > + bool > + depends on CMD_SPLASH > + default y > + > config DEFAULT_ENVIRONMENT_GENERIC > bool > depends on !HAVE_DEFAULT_ENVIRONMENT_NEW > diff --git a/defaultenv/Makefile b/defaultenv/Makefile > index fc679eb..03d241c 100644 > --- a/defaultenv/Makefile > +++ b/defaultenv/Makefile > @@ -1,6 +1,7 @@ > bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW) += defaultenv-2-base > bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_MENU) += defaultenv-2-menu > bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU) += defaultenv-2-dfu > +bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_SPLASH) += defaultenv-2-splash > bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-1 > obj-$(CONFIG_DEFAULT_ENVIRONMENT) += defaultenv.o > extra-y += barebox_default_env barebox_default_env.h > barebox_default_env$(DEFAULT_COMPRESSION_SUFFIX) > diff --git a/defaultenv/defaultenv-2-splash/bin/splash > b/defaultenv/defaultenv-2-splash/bin/splash > new file mode 100644 > index 000..352439d > --- /dev/null > +++ b/defaultenv/defaultenv-2-splash/bin/splash > @@ -0,0 +1,15 @@ > +#!/bin/sh > + > +splash="/env/splash.png" > + > +if [ ! -f ${splash} ]; then > + return > +fi > + > +splash ${splash} > + > +if [ $? = 0 ]; then > + fb0.enable=1 > +else > + echo "Cannot show splash image" > +fi > diff --git a/defaultenv/defaultenv-2-splash/init/splash > b/defaultenv/defaultenv-2-splash/init/splash > new file mode 100644 > index 000..04fdc8e > --- /dev/null > +++ b/defaultenv/defaultenv-2-splash/init/splash > @@ -0,0 +1,3 @@ > +#!/bin/sh > + > +/env/bin/splash Why do you need a separate /env/bin/splash here? Can't you add its content here directly? If we keep it, it should have the same name as the 'splash' command. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 8/9] console: allow to specify the device id
On Tue, Dec 23, 2014 at 07:21:57PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > so we can use dynamic number id with specific devname > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > --- > common/console.c | 2 +- > drivers/usb/gadget/u_serial.c | 1 + > include/console.h | 1 + > 3 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/common/console.c b/common/console.c > index bba13a5..602ab2e 100644 > --- a/common/console.c > +++ b/common/console.c > @@ -188,7 +188,7 @@ int console_register(struct console_device *newcdev) > console_init_early(); > > if (newcdev->devname) { > - dev->id = DEVICE_ID_SINGLE; > + dev->id = newcdev->devid; > strcpy(dev->name, newcdev->devname); > } else { > dev->id = DEVICE_ID_DYNAMIC; > diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c > index 8c58746..1e5e809 100644 > --- a/drivers/usb/gadget/u_serial.c > +++ b/drivers/usb/gadget/u_serial.c > @@ -530,6 +530,7 @@ int gserial_connect(struct gserial *gser, u8 port_num) > cdev->flush = serial_flush; > cdev->setbrg = serial_setbaudrate; > cdev->devname = "usbserial"; > + cdev->devid = DEVICE_ID_SINGLE; The same is needed in drivers/serial/serial_imx.c Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH] mtd: nand: add pxa3xx-nand driver
- Mail original - De: "Ezequiel Garcia" À: "Robert Jarzmik" , barebox@lists.infradead.org Envoyé: Dimanche 4 Janvier 2015 19:50:55 Objet: Re: [PATCH] mtd: nand: add pxa3xx-nand driver Hi Robert, > If my memory doesn't fail me, the NAND controller is called NFC v1 on > pxa3xx, and NFC v2 on mvebu SoCs. > I'm wondering if we can pick a better name for this driver in barebox. > Maybe something like 'mv_nfc_nand' ? As all drivers are called "nand_XXX", I'd rather have it nand_mrvl_nfc then. Does that sound good to you ? > Also, I think you can get rid of the 'builtin_flash_types' struct and > all the device detection routines, which are really duplicating the > MTD's lower level job. Well, not really. If I get rid of them, how will I get the following information : - page size - nand timings (tHP, ...) - controller width to use - ... > I never removed it from the Linux driver, because I was afraid of > regressions and there are little testers around. However, on Barebox we > can benefit from removing that, and starting with a cleaner driver. If you convince me all the information can be found back, I'll gladly remove them. Cheers. -- Robert -- Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 7/9] poller: allow to restrict the poller frequency
On Tue, Dec 23, 2014 at 07:21:56PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > so we do not slow down barebox on too much polling > specialy on USB drivers > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > --- > common/poller.c | 11 ++- > include/poller.h | 3 +++ > 2 files changed, 13 insertions(+), 1 deletion(-) Could you repost this along with the first user? > > diff --git a/common/poller.c b/common/poller.c > index 496636d..58b105d 100644 > --- a/common/poller.c > +++ b/common/poller.c > @@ -24,6 +24,9 @@ int poller_register(struct poller_struct *poller) > list_add_tail(&poller->list, &poller_list); > poller->registered = 1; > > + if (poller->frequency) > + poller->poll_next = get_time_ns(); > + > return 0; > } > > @@ -96,8 +99,14 @@ void poller_call(void) > > poller_active = 1; > > - list_for_each_entry_safe(poller, tmp, &poller_list, list) > + list_for_each_entry_safe(poller, tmp, &poller_list, list) { > + > + if (poller->frequency && get_time_ns() < poller->poll_next) > + continue; > poller->func(poller); > + if (poller->frequency) > + poller->poll_next += poller->frequency; > + } > > poller_active = 0; > } > diff --git a/include/poller.h b/include/poller.h > index cda5b57..3568a80 100644 > --- a/include/poller.h > +++ b/include/poller.h > @@ -14,6 +14,9 @@ struct poller_struct { > void (*func)(struct poller_struct *poller); > int registered; > struct list_head list; > + > + uint64_t frequency; > + uint64_t poll_next; > }; Could you reorder the fields in struct poller_struct by fields which should be initialized by users and internal fields? This was not exactly clear before this patch, but this patch introduces another two fields, from which one must be initialized by the user and the other one not. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 5/9] versatilepb: switch to defaultenv-2
On Tue, Dec 23, 2014 at 07:21:54PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > - Boot from NOR > - enable UBI > - use PBL > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > --- > arch/arm/boards/versatile/env/boot.d/001-nor | 1 + > .../arm/boards/versatile/env/boot.d/101-nor-update | 1 + > arch/arm/boards/versatile/env/boot/nor | 15 + > arch/arm/boards/versatile/env/boot/nor-update | 14 > arch/arm/boards/versatile/env/config | 38 > -- > arch/arm/boards/versatile/env/init/automount | 11 +++ > arch/arm/boards/versatile/env/init/mtdparts-nor| 11 +++ > arch/arm/boards/versatile/env/init/ps1 | 7 > arch/arm/boards/versatile/env/nv/boot.default | 1 + > arch/arm/boards/versatile/env/nv/hostname | 1 + > .../boards/versatile/env/nv/linux.bootargs.base| 1 + > arch/arm/boards/versatile/versatilepb.c| 4 +-- > arch/arm/configs/versatilepb_defconfig | 31 -- > arch/arm/mach-versatile/Kconfig| 1 + > 14 files changed, 94 insertions(+), 43 deletions(-) > create mode 12 arch/arm/boards/versatile/env/boot.d/001-nor > create mode 12 arch/arm/boards/versatile/env/boot.d/101-nor-update > create mode 100644 arch/arm/boards/versatile/env/boot/nor > create mode 100644 arch/arm/boards/versatile/env/boot/nor-update > delete mode 100644 arch/arm/boards/versatile/env/config > create mode 100644 arch/arm/boards/versatile/env/init/automount > create mode 100644 arch/arm/boards/versatile/env/init/mtdparts-nor > create mode 100644 arch/arm/boards/versatile/env/init/ps1 > create mode 100644 arch/arm/boards/versatile/env/nv/boot.default > create mode 100644 arch/arm/boards/versatile/env/nv/hostname > create mode 100644 arch/arm/boards/versatile/env/nv/linux.bootargs.base Applied, thanks Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 4/9] versatilepb: move barebox to 32 MiB and use zImage
On Tue, Dec 23, 2014 at 07:21:53PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > --- > arch/arm/boards/versatile/env/config | 4 ++-- > arch/arm/mach-versatile/Kconfig | 3 +++ > 2 files changed, 5 insertions(+), 2 deletions(-) Applied, thanks Sascha > > diff --git a/arch/arm/boards/versatile/env/config > b/arch/arm/boards/versatile/env/config > index 667dce3..1bc575b 100644 > --- a/arch/arm/boards/versatile/env/config > +++ b/arch/arm/boards/versatile/env/config > @@ -19,8 +19,8 @@ rootfs_loc=initrd > rootfs_type=ubifs > rootfsimage=root.$rootfs_type > > -#kernelimage=zImage > -kernelimage=uImage > +kernelimage=zImage > +#kernelimage=uImage > #kernelimage=Image > #kernelimage=Image.lzo > > diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig > index 9a1bf95..9ad1869 100644 > --- a/arch/arm/mach-versatile/Kconfig > +++ b/arch/arm/mach-versatile/Kconfig > @@ -1,6 +1,9 @@ > > if ARCH_VERSATILE > > +config ARCH_TEXT_BASE > + default 0x0200 > + > choice > prompt "ARM Board type" > > -- > 2.1.3 > > > ___ > 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 3/9] grapric_utils: set_pixel only write 16bit in 16bit mode
On Tue, Dec 23, 2014 at 07:21:52PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > --- > lib/gui/graphic_utils.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/9] efika-mx-smartbook: enable led hearbeat on mail
On Tue, Dec 23, 2014 at 07:21:51PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > --- > arch/arm/boards/efika-mx-smartbook/board.c | 2 ++ > 1 file changed, 2 insertions(+) Applied, thanks Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 1/2] Documentation: add Raspberry Pi barebox mini-howto
On Thu, Dec 25, 2014 at 01:53:42AM +0300, Antony Pavlov wrote: > Signed-off-by: Antony Pavlov > --- > Documentation/boards/bcm2835.rst | 17 + > 1 file changed, 17 insertions(+) > create mode 100644 Documentation/boards/bcm2835.rst Applied, thanks Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 1/8] fixup! ARM: MXS: Add multiimage support
On Thu, Dec 25, 2014 at 06:08:58PM +0100, Jan Luebbe wrote: > The MX23 needs a different image config, so use separate files for > MX23/MX28. > > Signed-off-by: Jan Luebbe Applied all, thanks Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [REGRESSION BUG] at91 is broken on barebox
On Fri, Dec 26, 2014 at 10:51:43AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > HI, > > since the switch to ERR_PTR & co > > for dev_get_resource_by_name & others the at91 is broken > > as on barebox we use a 1:1 mapping and the check of the IS_ERR is > ((unsigned long)-MAX_ERRNO) > > but on at91 the PIT and so on are at 0xfd30 so on always seen as > an error Damn :( Since dev_get_resource_by_name returns a struct resource pointer it shouldn't be broken, right? What's broken should be: dev_get_mem_region_by_name dev_request_mem_region_by_name dev_request_mem_region > > so can we revert the commit on > > ommit 92cc1b1f9e3363046583962859a3a8c054f4b94d Since these commits touch so many files I'm not sure we can simply revert these commits. All drivers that check for IS_ERR() from the above functions that were introduced after the commits to revert would have to be changed aswell. The functions should still work, but the error check with IS_ERR() does not, right? So as a stop gap solution we could drop the error check from the affected drivers and as the next step change the prototype of the affected functions to something like: int dev_request_mem_region(struct device_d *dev, int num, void __iomem **base); Which drivers are affected anyway? Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: beagle bone black: problem of boot from eMMC
On Wed, Dec 31, 2014 at 02:52:39PM +, manuelcur...@eaton.com wrote: > Hi, > > From the lasted Barebox version (barebox-2014.12.0): > > I generated a MLO and a barebox.bin for the BeagleBone > (am335x_defconfig&am335x_mlo_defconfig config file) with the > modification of : > [PATCH] net: cpsw: Fix crashes on beaglebone black ledphilippe at > gmail.com > that I copied in a SD card. It work fine. > > After, I wanted to boot from the the internal eMMC. > So after boot from sd card, I mounted the eMMC (mount /dev/mmc1.0) and > copied the MLO and barebox.bin in the /mnt/mmc1.0 folder. > > When I try to boot from the internal eMMC ,I have the following error: > -> > barebox 2014.12.0 #2 Wed Dec 31 15:29:16 GMT 2014 > > > Board: TI AM335x BeagleBone > detected 'BeagleBone Black' > omap-hsmmc 4806.mmc: registered as 4806.mmc > booting from MMC > fat fat0: probe failed: error 22 > Unable to mount (-22) > booting failed > <- > > I tried myself to find a 'correction' by added the call of > am33xx_of_register_bootdevice(void) function at the end of the static > int beaglebone_devices_init(void) function. With this modification, > sometime (depending of the last boot: from SD Card or from eMMC) I can > boot, someting not. > So my correction,although improving the situation, is not exactly the > correction to do. Some one can help me ? In your bootlog above mmc@481d8000 (which is the eMMC) is not registered. I had a quick look at the code and didn't find anything obvious. I can have a closer look this evening. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: beagle bone black: problem of boot from eMMC
Hello Manuel, Am Mittwoch, den 31.12.2014, 14:52 + schrieb manuelcur...@eaton.com: > > After, I wanted to boot from the the internal eMMC. > So after boot from sd card, I mounted the eMMC (mount /dev/mmc1.0) and > copied the MLO and barebox.bin in the /mnt/mmc1.0 folder. > > When I try to boot from the internal eMMC ,I have the following error: > -> > barebox 2014.12.0 #2 Wed Dec 31 15:29:16 GMT 2014 > > > Board: TI AM335x BeagleBone > detected 'BeagleBone Black' > omap-hsmmc 4806.mmc: registered as 4806.mmc > booting from MMC > fat fat0: probe failed: error 22 > Unable to mount (-22) > booting failed > <- This issue comes from commit: commit 0d6392de4ad824a6553c0e3e3e18edef689a7c85 Author: Sascha Hauer Date: Thu Jun 5 12:09:07 2014 +0200 ARM: AM335x: Beaglebone: Use stripped down devicetree for MLO For the MLO only the am335x-bone-common.dtsi is used to create the device tree. But this does not have the emmc support included. > > I tried myself to find a 'correction' by added the call of > am33xx_of_register_bootdevice(void) function at the end of the static > int beaglebone_devices_init(void) function. With this modification, > sometime (depending of the last boot: from SD Card or from eMMC) I can > boot, someting not. What you are also missing is a disabled emmc node from the am335x-boneblack.dts in the am335x-bone-common.dtsi. This may help. Regards, Teresa > So my correction,although improving the situation, is not exactly the > correction to do. Some one can help me ? > > Thanks very much ! > > > > - > Eaton Industries (France) S.A.S ~ Siège social: 110 Rue Blaise Pascal, > Immeuble Le Viséo - Bâtiment A Innovallée, 38330, Montbonnot-St.-Martin, > France ~ Lieu d'enregistrement au registre du commerce: Grenoble ~ Numéro > d'enregistrement: 509 653 176 ~ Capital social souscrit et liberé:€ 16215441 > ~ Numéro de TVA: FR47509653176 > > - > > ___ > 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
Re: [PATCH] i.MX: SPI: Respect SPI_LSB_FIRST flag in mode settings
Hi Andrey, On Wed, Dec 31, 2014 at 07:10:55AM -0800, Andrey Smirnov wrote: > Add code to support SPI transfers that have data shifted out least > significant bit first. This is useful in many cases, but specifically > it is needed for drivers/firmware/altera_serial.c to work on i.MX > platform. > > Signed-off-by: Andrey Smirnov > --- > drivers/spi/imx_spi.c | 50 -- > 1 file changed, 44 insertions(+), 6 deletions(-) > > diff --git a/drivers/spi/imx_spi.c b/drivers/spi/imx_spi.c > index 3146339..efbbb08 100644 > --- a/drivers/spi/imx_spi.c > +++ b/drivers/spi/imx_spi.c > @@ -137,6 +137,25 @@ static int imx_spi_setup(struct spi_device *spi) > return 0; > } > > +static unsigned int imx_spi_maybe_reverse_bits(struct spi_device *spi, > unsigned int word) > +{ > + unsigned int result = word; > + > + if (spi->mode & SPI_LSB_FIRST) { > + size_t bits_left = spi->bits_per_word - 1; > + > + for (word >>= 1; word; word >>= 1) { > + result <<= 1; > + result |= word & 1; > + bits_left--; > + } > + > + result <<= bits_left; > + } > + > + return result; > +} > + > static unsigned int cspi_0_0_xchg_single(struct imx_spi *imx, unsigned int > data) > { > void __iomem *base = imx->regs; > @@ -386,6 +405,7 @@ static void imx_spi_do_transfer(struct spi_device *spi, > struct spi_transfer *t) > { > struct imx_spi *imx = container_of(spi->master, struct imx_spi, master); > unsigned i; > + u32 tx_val; > > if (spi->bits_per_word <= 8) { > const u8*tx_buf = t->tx_buf; > @@ -393,9 +413,15 @@ static void imx_spi_do_transfer(struct spi_device *spi, > struct spi_transfer *t) > u8 rx_val; > > for (i = 0; i < t->len; i++) { > - rx_val = imx->xchg_single(imx, tx_buf ? tx_buf[i] : 0); > + if (tx_buf) > + tx_val = imx_spi_maybe_reverse_bits(spi, > tx_buf[i]); > + else > + tx_val = 0; > + > + rx_val = imx->xchg_single(imx, tx_val); > + Better introduce a imx_xchg_single which does the necessary bit reversing and calls imx->xchg_single. This avoids duplicating the code for all three bits_per_word settings. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [RFC, PATCH] i.MX6: phytec: Do not hardcode default environment
Hi Andrey, On Wed, Dec 31, 2014 at 08:49:50AM -0800, Andrey Smirnov wrote: > By default i.MX6 phytec image hardcodes its default environment in > initialization code. Define phytec specific defonfig and use > CONFIG_DEFAULT_ENVIRONMENT_PATH instead. > > Signed-off-by: Andrey Smirnov > --- > > Not sure how much of a faux pas adding a new defconfig file is, but I > couldn't think of a better alternative. What I was trying to achive is > being able to build an image for a custom Phytec SoM based platform > that would have a completely custom envirnoment and would not pull in > default phytec stuff. > > Let me know if this is a right approach. > > Thank you. > > arch/arm/boards/phytec-phyflex-imx6/Makefile | 1 - > arch/arm/boards/phytec-phyflex-imx6/board.c| 2 - > arch/arm/configs/phytec_phyflex_imx6_defconfig | 705 > + > 3 files changed, 705 insertions(+), 3 deletions(-) > create mode 100644 arch/arm/configs/phytec_phyflex_imx6_defconfig > > diff --git a/arch/arm/boards/phytec-phyflex-imx6/Makefile > b/arch/arm/boards/phytec-phyflex-imx6/Makefile > index 11e1c7d..01c7a25 100644 > --- a/arch/arm/boards/phytec-phyflex-imx6/Makefile > +++ b/arch/arm/boards/phytec-phyflex-imx6/Makefile > @@ -1,3 +1,2 @@ > obj-y += board.o > lwl-y += lowlevel.o > -bbenv-y += defaultenv-phyflex-imx6 > diff --git a/arch/arm/boards/phytec-phyflex-imx6/board.c > b/arch/arm/boards/phytec-phyflex-imx6/board.c > index 1551460..3f52680 100644 > --- a/arch/arm/boards/phytec-phyflex-imx6/board.c > +++ b/arch/arm/boards/phytec-phyflex-imx6/board.c > @@ -87,8 +87,6 @@ static int phytec_pfla02_init(void) > break; > } > > - defaultenv_append_directory(defaultenv_phyflex_imx6); > - Looking at it you should rather replace the compatible checks in phytec_pfla02_init with their baseboards, so instead of: if (!of_machine_is_compatible("phytec,imx6q-pfla02") && !of_machine_is_compatible("phytec,imx6dl-pfla02") && !of_machine_is_compatible("phytec,imx6s-pfla02")) return 0; do a: if (!of_machine_is_compatible("phytec,imx6x-pbab01") && !of_machine_is_compatible("phytec,imx6dl-pbab05") && !of_machine_is_compatible("phytec,imx6q-pbab02")) return 0; Then the phytec default env will only be added for the phytec baseboards and not for your custom one. Note phyflex_err006282_workaround() won't be called either then, you may need your own version of this then. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox