* [PATCH 0/9] versatilepb, console, graphichs serie @ 2014-12-23 17:07 Jean-Christophe PLAGNIOL-VILLARD 2014-12-23 18:21 ` [PATCH 1/9] kfifo: allow to pass a null point on kfifo_free Jean-Christophe PLAGNIOL-VILLARD 0 siblings, 1 reply; 22+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 17:07 UTC (permalink / raw) To: barebox Hi, here is a patch series of different stuff To prepare the adding of the USB Keyboard and other GUI related patches Versatilepb: - move to defaultenv-2 Graphics: - fix - defaultenv-2 The following changes since commit 631be8e6cbe003f469a7e6b54046a743b710d989: blspec: print error when devicetree not found (2014-12-16 14:29:23 +0100) are available in the git repository at: git://git.jcrosoft.org/barebox.git delivery/for-next for you to fetch changes up to 3457c1de8201cbe6ca24ddba75df789fad8b6095: defaultenv-2: create a specific defaultenv for splash (2014-12-23 05:51:11 +0800) ---------------------------------------------------------------- Jean-Christophe PLAGNIOL-VILLARD (9): kfifo: allow to pass a null point on kfifo_free efika-mx-smartbook: enable led hearbeat on mail grapric_utils: set_pixel only write 16bit in 16bit mode versatilepb: move barebox to 32 MiB and use zImage versatilepb: switch to defaultenv-2 console: factorize kfifo input support poller: allow to restrict the poller frequency console: allow to specify the device id defaultenv-2: create a specific defaultenv for splash arch/arm/boards/efika-mx-smartbook/board.c | 2 ++ arch/arm/boards/versatile/env/boot.d/001-nor | 1 + arch/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 + arch/arm/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 | 4 ++++ common/Kconfig | 8 ++++++++ common/console.c | 10 +++++++++- common/console_common.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ common/console_simple.c | 4 ++++ common/poller.c | 11 ++++++++++- defaultenv/Makefile | 1 + defaultenv/defaultenv-2-splash/bin/splash | 15 +++++++++++++++ defaultenv/defaultenv-2-splash/init/splash | 3 +++ defaultenv/defaultenv.c | 2 ++ 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 ++------------------------------ drivers/usb/gadget/u_serial.c | 1 + include/console.h | 23 +++++++++++++++++++++++ include/gpio_keys.h | 1 - include/poller.h | 3 +++ lib/gui/graphic_utils.c | 2 +- lib/kfifo.c | 2 ++ 35 files changed, 268 insertions(+), 167 deletions(-) create mode 120000 arch/arm/boards/versatile/env/boot.d/001-nor create mode 120000 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 create mode 100644 defaultenv/defaultenv-2-splash/bin/splash create mode 100644 defaultenv/defaultenv-2-splash/init/splash Best Regards, J. _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 1/9] kfifo: allow to pass a null point on kfifo_free 2014-12-23 17:07 [PATCH 0/9] versatilepb, console, graphichs serie Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 ` Jean-Christophe PLAGNIOL-VILLARD 2014-12-23 18:21 ` [PATCH 2/9] efika-mx-smartbook: enable led hearbeat on mail Jean-Christophe PLAGNIOL-VILLARD ` (7 more replies) 0 siblings, 8 replies; 22+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 UTC (permalink / raw) To: barebox as free allow to pass a NULL pointer Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> --- lib/kfifo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/kfifo.c b/lib/kfifo.c index 307dae1..601202d 100644 --- a/lib/kfifo.c +++ b/lib/kfifo.c @@ -70,6 +70,8 @@ struct kfifo *kfifo_alloc(unsigned int size) */ void kfifo_free(struct kfifo *fifo) { + if (!fifo) + return; free(fifo->buffer); free(fifo); } -- 2.1.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 2/9] efika-mx-smartbook: enable led hearbeat on mail 2014-12-23 18:21 ` [PATCH 1/9] kfifo: allow to pass a null point on kfifo_free Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 ` Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 10:36 ` Sascha Hauer 2014-12-23 18:21 ` [PATCH 3/9] grapric_utils: set_pixel only write 16bit in 16bit mode Jean-Christophe PLAGNIOL-VILLARD ` (6 subsequent siblings) 7 siblings, 1 reply; 22+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 UTC (permalink / raw) To: barebox Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> --- arch/arm/boards/efika-mx-smartbook/board.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boards/efika-mx-smartbook/board.c b/arch/arm/boards/efika-mx-smartbook/board.c index 99efd66..4a38afd 100644 --- a/arch/arm/boards/efika-mx-smartbook/board.c +++ b/arch/arm/boards/efika-mx-smartbook/board.c @@ -246,6 +246,8 @@ static int efikamx_late_init(void) for (i = 0; i < ARRAY_SIZE(leds); i++) led_gpio_register(&leds[i]); + led_set_trigger(LED_TRIGGER_HEARTBEAT, &leds[0].led); + writew(0x0, MX51_WDOG_BASE_ADDR + 0x8); imx51_bbu_internal_mmc_register_handler("mmc", "/dev/mmc1", -- 2.1.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/9] efika-mx-smartbook: enable led hearbeat on mail 2014-12-23 18:21 ` [PATCH 2/9] efika-mx-smartbook: enable led hearbeat on mail Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-05 10:36 ` Sascha Hauer 0 siblings, 0 replies; 22+ messages in thread From: Sascha Hauer @ 2015-01-05 10:36 UTC (permalink / raw) To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox On Tue, Dec 23, 2014 at 07:21:51PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> > --- > 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-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 3/9] grapric_utils: set_pixel only write 16bit in 16bit mode 2014-12-23 18:21 ` [PATCH 1/9] kfifo: allow to pass a null point on kfifo_free Jean-Christophe PLAGNIOL-VILLARD 2014-12-23 18:21 ` [PATCH 2/9] efika-mx-smartbook: enable led hearbeat on mail Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 ` Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 10:37 ` Sascha Hauer 2014-12-23 18:21 ` [PATCH 4/9] versatilepb: move barebox to 32 MiB and use zImage Jean-Christophe PLAGNIOL-VILLARD ` (5 subsequent siblings) 7 siblings, 1 reply; 22+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 UTC (permalink / raw) To: barebox Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> --- lib/gui/graphic_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gui/graphic_utils.c b/lib/gui/graphic_utils.c index 300c525..6465f8e 100644 --- a/lib/gui/graphic_utils.c +++ b/lib/gui/graphic_utils.c @@ -104,7 +104,7 @@ void set_pixel(struct fb_info *info, void *adr, u32 px) case 8: break; case 16: - *(u16 *)adr = px; + *(u16 *)adr = px & 0xffff; break; case 32: *(u32 *)adr = px; -- 2.1.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 3/9] grapric_utils: set_pixel only write 16bit in 16bit mode 2014-12-23 18:21 ` [PATCH 3/9] grapric_utils: set_pixel only write 16bit in 16bit mode Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-05 10:37 ` Sascha Hauer 0 siblings, 0 replies; 22+ messages in thread From: Sascha Hauer @ 2015-01-05 10:37 UTC (permalink / raw) To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox On Tue, Dec 23, 2014 at 07:21:52PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> > --- > 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-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 4/9] versatilepb: move barebox to 32 MiB and use zImage 2014-12-23 18:21 ` [PATCH 1/9] kfifo: allow to pass a null point on kfifo_free Jean-Christophe PLAGNIOL-VILLARD 2014-12-23 18:21 ` [PATCH 2/9] efika-mx-smartbook: enable led hearbeat on mail Jean-Christophe PLAGNIOL-VILLARD 2014-12-23 18:21 ` [PATCH 3/9] grapric_utils: set_pixel only write 16bit in 16bit mode Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 ` Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 10:38 ` Sascha Hauer 2014-12-23 18:21 ` [PATCH 5/9] versatilepb: switch to defaultenv-2 Jean-Christophe PLAGNIOL-VILLARD ` (4 subsequent siblings) 7 siblings, 1 reply; 22+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 UTC (permalink / raw) To: barebox Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> --- arch/arm/boards/versatile/env/config | 4 ++-- arch/arm/mach-versatile/Kconfig | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) 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 0x02000000 + choice prompt "ARM Board type" -- 2.1.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 4/9] versatilepb: move barebox to 32 MiB and use zImage 2014-12-23 18:21 ` [PATCH 4/9] versatilepb: move barebox to 32 MiB and use zImage Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-05 10:38 ` Sascha Hauer 0 siblings, 0 replies; 22+ messages in thread From: Sascha Hauer @ 2015-01-05 10:38 UTC (permalink / raw) To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox On Tue, Dec 23, 2014 at 07:21:53PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> > --- > 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 0x02000000 > + > 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-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 5/9] versatilepb: switch to defaultenv-2 2014-12-23 18:21 ` [PATCH 1/9] kfifo: allow to pass a null point on kfifo_free Jean-Christophe PLAGNIOL-VILLARD ` (2 preceding siblings ...) 2014-12-23 18:21 ` [PATCH 4/9] versatilepb: move barebox to 32 MiB and use zImage Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 ` Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 10:38 ` Sascha Hauer 2014-12-23 18:21 ` [PATCH 6/9] console: factorize kfifo input support Jean-Christophe PLAGNIOL-VILLARD ` (3 subsequent siblings) 7 siblings, 1 reply; 22+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 UTC (permalink / raw) To: barebox - Boot from NOR - enable UBI - use PBL Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> --- 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 120000 arch/arm/boards/versatile/env/boot.d/001-nor create mode 120000 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 diff --git a/arch/arm/boards/versatile/env/boot.d/001-nor b/arch/arm/boards/versatile/env/boot.d/001-nor new file mode 120000 index 0000000..3db66ae --- /dev/null +++ b/arch/arm/boards/versatile/env/boot.d/001-nor @@ -0,0 +1 @@ +../boot/nor \ No newline at end of file diff --git a/arch/arm/boards/versatile/env/boot.d/101-nor-update b/arch/arm/boards/versatile/env/boot.d/101-nor-update new file mode 120000 index 0000000..e4f1952 --- /dev/null +++ b/arch/arm/boards/versatile/env/boot.d/101-nor-update @@ -0,0 +1 @@ +../boot/nor-update \ No newline at end of file diff --git a/arch/arm/boards/versatile/env/boot/nor b/arch/arm/boards/versatile/env/boot/nor new file mode 100644 index 0000000..3f31605 --- /dev/null +++ b/arch/arm/boards/versatile/env/boot/nor @@ -0,0 +1,15 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + boot-menu-add-entry "$0" "nor" + exit +fi + +global.bootm.image="/dev/nor0.kernel" +global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=5 rootfstype=ubifs" + +dtb=/dev/nor0.dtb +filetype -s t ${dtb} +if [ "$t" = dtb ]; then + global.bootm.oftree="${dtb}" +fi diff --git a/arch/arm/boards/versatile/env/boot/nor-update b/arch/arm/boards/versatile/env/boot/nor-update new file mode 100644 index 0000000..728889d --- /dev/null +++ b/arch/arm/boards/versatile/env/boot/nor-update @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + boot-menu-add-entry "$0" "nor update" + exit +fi + +global.bootm.image="/dev/nor0.update" + +dtb=/dev/nor0.dtb +filetype -s t ${dtb} +if [ "$t" = dtb ]; then + global.bootm.oftree="${dtb}" +fi diff --git a/arch/arm/boards/versatile/env/config b/arch/arm/boards/versatile/env/config deleted file mode 100644 index 1bc575b..0000000 --- a/arch/arm/boards/versatile/env/config +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -# use 'dhcp' to do dhcp in barebox and in kernel -# use 'none' if you want to skip kernel ip autoconfiguration -ip=dhcp - -# or set your networking parameters here -#eth0.ipaddr=a.b.c.d -#eth0.netmask=a.b.c.d -#eth0.gateway=a.b.c.d -#eth0.serverip=a.b.c.d - -# can be either 'nfs', 'tftp' or 'nor' -kernel_loc=tftp -# can be either 'net', 'nor' or 'initrd' -rootfs_loc=initrd - -# can be either 'jffs2' or 'ubifs' -rootfs_type=ubifs -rootfsimage=root.$rootfs_type - -kernelimage=zImage -#kernelimage=uImage -#kernelimage=Image -#kernelimage=Image.lzo - -nfsroot="$eth0.serverip:/opt/work/busybox/arm9/rootfs_arm" - -nor_parts="256k(barebox)ro,64k(bareboxenv),1536k(kernel),-(root)" -rootfs_mtdblock_nor=3 - -autoboot_timeout=3 - -bootargs="console=ttyAMA0,115200n8 CONSOLE=/dev/ttyAMA0" - -# set a fancy prompt (if support is compiled in) -PS1="\e[1;31m[barebox@\h]:\w\e[0m\n# " - diff --git a/arch/arm/boards/versatile/env/init/automount b/arch/arm/boards/versatile/env/init/automount new file mode 100644 index 0000000..53f9196 --- /dev/null +++ b/arch/arm/boards/versatile/env/init/automount @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + init-menu-add-entry "$0" "Automountpoints" + exit +fi + +# automount tftp server based on $eth0.serverip + +mkdir -p /mnt/tftp +automount /mnt/tftp 'ifup eth0 && mount -t tftp $eth0.serverip /mnt/tftp' diff --git a/arch/arm/boards/versatile/env/init/mtdparts-nor b/arch/arm/boards/versatile/env/init/mtdparts-nor new file mode 100644 index 0000000..9079d48 --- /dev/null +++ b/arch/arm/boards/versatile/env/init/mtdparts-nor @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + init-menu-add-entry "$0" "NOR partitions" + exit +fi + +mtdparts="512k(nor0.barebox)ro,512k(nor0.bareboxenv),4864k(nor0.kernel),256k(nor0.dtb),3M(nor0.update),-(nor0.root)" +kernelname="physmap-flash.0" + +mtdparts-add -d nor0 -k ${kernelname} -p ${mtdparts} diff --git a/arch/arm/boards/versatile/env/init/ps1 b/arch/arm/boards/versatile/env/init/ps1 new file mode 100644 index 0000000..a1d0754 --- /dev/null +++ b/arch/arm/boards/versatile/env/init/ps1 @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ ${global.allow_color} = "true" ]; then + export PS1="\e[1;32mbarebox@\e[1;36m\h:\w\e[0m\n# " +else + export PS1="barebox@\h:\w\n# " +fi diff --git a/arch/arm/boards/versatile/env/nv/boot.default b/arch/arm/boards/versatile/env/nv/boot.default new file mode 100644 index 0000000..c47e1b2 --- /dev/null +++ b/arch/arm/boards/versatile/env/nv/boot.default @@ -0,0 +1 @@ +/env/boot.d diff --git a/arch/arm/boards/versatile/env/nv/hostname b/arch/arm/boards/versatile/env/nv/hostname new file mode 100644 index 0000000..7cdb629 --- /dev/null +++ b/arch/arm/boards/versatile/env/nv/hostname @@ -0,0 +1 @@ +versatilepb diff --git a/arch/arm/boards/versatile/env/nv/linux.bootargs.base b/arch/arm/boards/versatile/env/nv/linux.bootargs.base new file mode 100644 index 0000000..826debe --- /dev/null +++ b/arch/arm/boards/versatile/env/nv/linux.bootargs.base @@ -0,0 +1 @@ +console=ttyAMA0,115200n8 CONSOLE=/dev/ttyAMA0 diff --git a/arch/arm/boards/versatile/versatilepb.c b/arch/arm/boards/versatile/versatilepb.c index fdd0820..7e2103e 100644 --- a/arch/arm/boards/versatile/versatilepb.c +++ b/arch/arm/boards/versatile/versatilepb.c @@ -46,8 +46,8 @@ static struct smc91c111_pdata net_pdata = { static int vpb_devices_init(void) { add_cfi_flash_device(DEVICE_ID_DYNAMIC, VERSATILE_FLASH_BASE, VERSATILE_FLASH_SIZE, 0); - devfs_add_partition("nor0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self"); - devfs_add_partition("nor0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env0"); + devfs_add_partition("nor0", 0x00000, SZ_512K, DEVFS_PARTITION_FIXED, "self"); + devfs_add_partition("nor0", SZ_512K, SZ_512K, DEVFS_PARTITION_FIXED, "env0"); add_generic_device("smc91c111", DEVICE_ID_DYNAMIC, NULL, VERSATILE_ETH_BASE, 64 * 1024, IORESOURCE_MEM, &net_pdata); diff --git a/arch/arm/configs/versatilepb_defconfig b/arch/arm/configs/versatilepb_defconfig index 9f7e0e5..54a6fec 100644 --- a/arch/arm/configs/versatilepb_defconfig +++ b/arch/arm/configs/versatilepb_defconfig @@ -1,28 +1,41 @@ CONFIG_BUILTIN_DTB=y CONFIG_BUILTIN_DTB_NAME="versatile-pb" CONFIG_ARCH_VERSATILE=y +CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x80000 CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y +CONFIG_PBL_IMAGE=y +CONFIG_PBL_RELOCATABLE=y CONFIG_PROMPT="versatilepb> " -CONFIG_GLOB=y CONFIG_HUSH_FANCY_PROMPT=y CONFIG_CMDLINE_EDITING=y CONFIG_AUTO_COMPLETE=y CONFIG_MENU=y +CONFIG_CONSOLE_ACTIVATE_ALL=y CONFIG_PARTITION=y -CONFIG_DEFAULT_ENVIRONMENT_GENERIC=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 @@ -30,12 +43,16 @@ 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_LOGIN=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 @@ -51,10 +68,18 @@ CONFIG_SERIAL_AMBA_PL011=y CONFIG_DRIVER_NET_SMC91111=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_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_SHA1=y CONFIG_SHA256=y diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig index 9ad1869..f902576 100644 --- a/arch/arm/mach-versatile/Kconfig +++ b/arch/arm/mach-versatile/Kconfig @@ -11,6 +11,7 @@ config MACH_VERSATILEPB bool "ARM Versatile/PB (ARM926EJ-S)" select ARM_AMBA select CLKDEV_LOOKUP + select HAVE_DEFAULT_ENVIRONMENT_NEW endchoice -- 2.1.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 5/9] versatilepb: switch to defaultenv-2 2014-12-23 18:21 ` [PATCH 5/9] versatilepb: switch to defaultenv-2 Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-05 10:38 ` Sascha Hauer 0 siblings, 0 replies; 22+ messages in thread From: Sascha Hauer @ 2015-01-05 10:38 UTC (permalink / raw) To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox 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 <plagnioj@jcrosoft.com> > --- > 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 120000 arch/arm/boards/versatile/env/boot.d/001-nor > create mode 120000 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-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 6/9] console: factorize kfifo input support 2014-12-23 18:21 ` [PATCH 1/9] kfifo: allow to pass a null point on kfifo_free Jean-Christophe PLAGNIOL-VILLARD ` (3 preceding siblings ...) 2014-12-23 18:21 ` [PATCH 5/9] versatilepb: switch to defaultenv-2 Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 ` Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 11:18 ` Sascha Hauer 2014-12-23 18:21 ` [PATCH 7/9] poller: allow to restrict the poller frequency Jean-Christophe PLAGNIOL-VILLARD ` (2 subsequent siblings) 7 siblings, 1 reply; 22+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 UTC (permalink / raw) To: barebox handle input fifo at console framework level instead of driver Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> --- 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(-) diff --git a/common/Kconfig b/common/Kconfig index 4614965..05f76ae 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -507,6 +507,9 @@ config KERNEL_INSTALL_TARGET compiler. The utility for the target will be under scripts/kernel-install-target +config CONSOLE_KFIFO + bool + choice prompt "console support" default CONSOLE_FULL diff --git a/common/console.c b/common/console.c index e5f4267..bba13a5 100644 --- a/common/console.c +++ b/common/console.c @@ -182,6 +182,7 @@ int console_register(struct console_device *newcdev) { struct device_d *dev = &newcdev->class_dev; int activate = 0; + int ret; if (initialized == CONSOLE_UNINITIALIZED) console_init_early(); @@ -196,6 +197,11 @@ int console_register(struct console_device *newcdev) if (newcdev->dev) dev->parent = newcdev->dev; + + ret = console_kfifo_input_init(newcdev); + if (ret) + return ret; + platform_device_register(dev); if (newcdev->setbrg) { @@ -243,6 +249,8 @@ int console_unregister(struct console_device *cdev) if (list_empty(&console_list)) initialized = CONSOLE_UNINITIALIZED; + console_kfifo_input_clean(cdev); + status = unregister_device(dev); if (!status) memset(cdev, 0, sizeof(*cdev)); diff --git a/common/console_common.c b/common/console_common.c index cc25f97..17cd834 100644 --- a/common/console_common.c +++ b/common/console_common.c @@ -326,3 +326,74 @@ struct console_device *console_get_first_active(void) return NULL; } EXPORT_SYMBOL(console_get_first_active); + +#ifdef CONFIG_CONSOLE_KFIFO +void console_kfifo_putc(struct console_device *cdev, int c) +{ + kfifo_put(cdev->recv_fifo, (u_char*)&c, sizeof(int)); +} +EXPORT_SYMBOL(console_kfifo_putc); + +void console_kfifo_puts(struct console_device *cdev,char *s, int len) +{ + int i; + + for (i = 0; i < len; i++) + console_kfifo_putc(cdev, (u_char)s[i]); +} +EXPORT_SYMBOL(console_kfifo_puts); + +static int console_kfifo_getc(struct console_device *cdev) +{ + int code = 0; + + if (kfifo_len(cdev->recv_fifo) > 0) { + kfifo_get(cdev->recv_fifo, (u_char*)&code, sizeof(int)); + + return code; + } + + if (cdev->drv_getc) + return cdev->drv_getc(cdev); + + return -1; +} + +static int console_kfifo_tstc(struct console_device *cdev) +{ + if (kfifo_len(cdev->recv_fifo) > 0) + return 1; + + if (cdev->drv_tstc) + return cdev->drv_tstc(cdev); + + return 0; +} + +int console_kfifo_input_init(struct console_device *cdev) +{ + if (cdev->fifo_input_size <= 0) + return 0; + + cdev->recv_fifo = kfifo_alloc(cdev->fifo_input_size * sizeof(int)); + + if (!cdev->recv_fifo) + return -ENOMEM; + + if (cdev->getc) + cdev->drv_getc = cdev->getc; + + if (cdev->tstc) + cdev->drv_tstc = cdev->tstc; + + cdev->getc = console_kfifo_getc; + cdev->tstc = console_kfifo_tstc; + + return 0; +} + +void console_kfifo_input_clean(struct console_device *cdev) +{ + kfifo_free(cdev->recv_fifo); +} +#endif diff --git a/common/console_simple.c b/common/console_simple.c index 6cb72bb..eda40ac 100644 --- a/common/console_simple.c +++ b/common/console_simple.c @@ -89,6 +89,10 @@ int console_register(struct console_device *newcdev) console_list.prev = console_list.next = &newcdev->list; newcdev->list.prev = newcdev->list.next = &console_list; + ret = console_kfifo_input_init(newcdev); + if (ret) + return ret; + if (newcdev->setbrg) { newcdev->baudrate = CONFIG_BAUDRATE; newcdev->setbrg(newcdev, newcdev->baudrate); diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig index b4e86fd..ceee21c 100644 --- a/drivers/input/Kconfig +++ b/drivers/input/Kconfig @@ -9,6 +9,7 @@ config KEYBOARD_GPIO bool "GPIO Buttons" depends on GENERIC_GPIO select POLLER + select CONSOLE_KFIFO help This driver implements support for buttons connected to GPIO pins of various CPUs (and some other chips). @@ -22,6 +23,7 @@ config KEYBOARD_IMX_KEYPAD bool "IMX Keypad" depends on ARCH_IMX select POLLER + select CONSOLE_KFIFO help This driver implements support for buttons connected to the IMX keypad matrix. @@ -35,6 +37,7 @@ config KEYBOARD_QT1070 tristate "Atmel AT42QT1070 Touch Sensor Chip" depends on I2C && GENERIC_GPIO select POLLER + select CONSOLE_KFIFO help Say Y here if you want to use Atmel AT42QT1070 QTouch Sensor chip as input device. @@ -43,6 +46,7 @@ config KEYBOARD_TWL6030 tristate "TWL6030 power button" depends on MFD_TWL6030 select POLLER + select CONSOLE_KFIFO help Say Y here if you want to use TWL6030 power button as a key. diff --git a/drivers/input/gpio_keys.c b/drivers/input/gpio_keys.c index d017594..27e464f 100644 --- a/drivers/input/gpio_keys.c +++ b/drivers/input/gpio_keys.c @@ -27,14 +27,8 @@ struct gpio_keys { struct gpio_key *buttons; int nbuttons; - /* optional */ - int fifo_size; - - struct kfifo *recv_fifo; struct poller_struct poller; struct console_device cdev; - - int use_keycodes; }; static inline struct gpio_keys * @@ -61,33 +55,13 @@ static void gpio_key_poller(struct poller_struct *poller) val = gpio_get_value(gb->gpio); if (val != gb->previous_state && val != gb->active_low) { - kfifo_put(gk->recv_fifo, (u_char*)&gb->code, sizeof(int)); + console_kfifo_putc(&gk->cdev, gb->code); debug("pressed gpio(%d) as %d\n", gb->gpio, gb->code); } gb->previous_state = val; } } -static int gpio_keys_tstc(struct console_device *cdev) -{ - struct gpio_keys *gk = cdev_to_gk_pdata(cdev); - - return (kfifo_len(gk->recv_fifo) == 0) ? 0 : 1; -} - -static int gpio_keys_getc(struct console_device *cdev) -{ - int code = 0; - struct gpio_keys *gk = cdev_to_gk_pdata(cdev); - - kfifo_get(gk->recv_fifo, (u_char*)&code, sizeof(int)); - - if (IS_ENABLED(CONFIG_OFDEVICE) && gk->use_keycodes) - return keycode_bb_keys[code]; - else - return code; -} - static int gpio_keys_probe_pdata(struct gpio_keys *gk, struct device_d *dev) { struct gpio_keys_platform_data *pdata; @@ -102,7 +76,7 @@ static int gpio_keys_probe_pdata(struct gpio_keys *gk, struct device_d *dev) } if (pdata->fifo_size) - gk->fifo_size = pdata->fifo_size; + gk->cdev.fifo_input_size = pdata->fifo_size; gk->buttons = xzalloc(pdata->nbuttons * sizeof(*gk->buttons)); gk->nbuttons = pdata->nbuttons; @@ -142,13 +116,11 @@ static int gpio_keys_probe_dt(struct gpio_keys *gk, struct device_d *dev) if (ret) return ret; - gk->buttons[i].code = keycode; + gk->buttons[i].code = keycode_bb_keys[keycode]; i++; } - gk->use_keycodes = 1; - return 0; } @@ -159,7 +131,9 @@ static int __init gpio_keys_probe(struct device_d *dev) struct gpio_keys *gk; gk = xzalloc(sizeof(*gk)); - gk->fifo_size = 50; + + cdev = &gk->cdev; + cdev->fifo_input_size = 50; if (dev->device_node) ret = gpio_keys_probe_dt(gk, dev); @@ -169,8 +143,6 @@ static int __init gpio_keys_probe(struct device_d *dev) if (ret) return ret; - gk->recv_fifo = kfifo_alloc(gk->fifo_size); - for (i = 0; i < gk->nbuttons; i++) { gpio = gk->buttons[i].gpio; ret = gpio_request(gpio, "gpio_keys"); @@ -184,11 +156,8 @@ static int __init gpio_keys_probe(struct device_d *dev) gk->poller.func = gpio_key_poller; - cdev = &gk->cdev; dev->type_data = cdev; cdev->dev = dev; - cdev->tstc = gpio_keys_tstc; - cdev->getc = gpio_keys_getc; console_register(&gk->cdev); diff --git a/drivers/input/imx_keypad.c b/drivers/input/imx_keypad.c index 331eadd..4f1b586 100644 --- a/drivers/input/imx_keypad.c +++ b/drivers/input/imx_keypad.c @@ -44,7 +44,6 @@ #include <init.h> #include <io.h> #include <poller.h> -#include <kfifo.h> #include <malloc.h> #include <matrix_keypad.h> #include <linux/err.h> @@ -78,10 +77,6 @@ struct imx_keypad { struct console_device cdev; void __iomem *mmio_base; - /* optional */ - int fifo_size; - - struct kfifo *recv_fifo; struct poller_struct poller; /* @@ -118,22 +113,6 @@ cdev_to_imx_kp_pdata(struct console_device *cdev) return container_of(cdev, struct imx_keypad, cdev); } -static int imx_keypad_tstc(struct console_device *cdev) -{ - struct imx_keypad *kp = cdev_to_imx_kp_pdata(cdev); - - return (kfifo_len(kp->recv_fifo) == 0) ? 0 : 1; -} - -static int imx_keypad_getc(struct console_device *cdev) -{ - int code = 0; - struct imx_keypad *kp = cdev_to_imx_kp_pdata(cdev); - - kfifo_get(kp->recv_fifo, (u_char*)&code, sizeof(int)); - return code; -} - /* Scan the matrix and return the new state in *matrix_volatile_state. */ static void imx_keypad_scan_matrix(struct imx_keypad *keypad, unsigned short *matrix_volatile_state) @@ -226,7 +205,7 @@ static void imx_keypad_fire_events(struct imx_keypad *keypad, code = MATRIX_SCAN_CODE(row, col, MATRIX_ROW_SHIFT); - kfifo_put(keypad->recv_fifo, (u_char*)(&keypad->keycodes[code]), sizeof(int)); + console_kfifo_putc(&keypad->cdev, gb->keypad->keycodes[code]); pr_debug("Event code: %d, val: %d", keypad->keycodes[code], @@ -406,9 +385,7 @@ static int __init imx_keypad_probe(struct device_d *dev) return PTR_ERR(keypad->mmio_base); if(!keypad->fifo_size) - keypad->fifo_size = 50; - - keypad->recv_fifo = kfifo_alloc(keypad->fifo_size); + keypad->cdev.fifo_input_size = 50; /* Search for rows and cols enabled */ for (i = 0; i < keymap_data->keymap_size; i++) { @@ -438,8 +415,6 @@ static int __init imx_keypad_probe(struct device_d *dev) cdev = &keypad->cdev; dev->type_data = cdev; cdev->dev = dev; - cdev->tstc = imx_keypad_tstc; - cdev->getc = imx_keypad_getc; cdev->f_active = CONSOLE_STDIN; console_register(&keypad->cdev); diff --git a/drivers/input/qt1070.c b/drivers/input/qt1070.c index 1ee868d..e023711 100644 --- a/drivers/input/qt1070.c +++ b/drivers/input/qt1070.c @@ -9,7 +9,6 @@ #include <init.h> #include <clock.h> #include <poller.h> -#include <kfifo.h> #include <i2c/i2c.h> #include <malloc.h> #include <readkey.h> @@ -42,14 +41,10 @@ struct qt1070_data { u64 start; - /* optional */ - int fifo_size; - struct i2c_client *client; u8 button_state[QT1070_NB_BUTTONS]; u8 previous_state; - struct kfifo *recv_fifo; struct poller_struct poller; struct console_device cdev; }; @@ -117,7 +112,7 @@ static void qt1070_poller(struct poller_struct *poller) if (!bt && data->button_state[i]) { dev_dbg(data->cdev.dev, "release key(%d) as %d\n", i, data->code[i]); - kfifo_put(data->recv_fifo, (u_char*)&data->code[i], sizeof(int)); + console_kfifo_putc(&data->cdev, data->code[i]); } else if (bt) { dev_dbg(data->cdev.dev, "pressed key(%d) as %d\n", i, data->code[i]); } @@ -163,22 +158,6 @@ static void qt1070_calibrate_poller(struct poller_struct *poller) poller->func = qt1070_reset_poller; } -static int qt1070_tstc(struct console_device *cdev) -{ - struct qt1070_data *data = cdev_to_qt_data(cdev); - - return (kfifo_len(data->recv_fifo) == 0) ? 0 : 1; -} - -static int qt1070_getc(struct console_device *cdev) -{ - int code = 0; - struct qt1070_data *data = cdev_to_qt_data(cdev); - - kfifo_get(data->recv_fifo, (u_char*)&code, sizeof(int)); - return code; -} - static int qt1070_pdata_init(struct device_d *dev, struct qt1070_data *data) { struct qt1070_platform_data *pdata = dev->platform_data; @@ -258,15 +237,12 @@ static int qt1070_probe(struct device_d *dev) data->start = get_time_ns(); - data->fifo_size = 50; - data->recv_fifo = kfifo_alloc(data->fifo_size); + data->cdev.fifo_input_size = 50; data->poller.func = qt1070_calibrate_poller; cdev = &data->cdev; cdev->dev = dev; - cdev->tstc = qt1070_tstc; - cdev->getc = qt1070_getc; console_register(&data->cdev); diff --git a/drivers/input/twl6030_pwrbtn.c b/drivers/input/twl6030_pwrbtn.c index fc4c728..346dff5 100644 --- a/drivers/input/twl6030_pwrbtn.c +++ b/drivers/input/twl6030_pwrbtn.c @@ -14,7 +14,6 @@ #include <init.h> #include <malloc.h> #include <poller.h> -#include <kfifo.h> #include <mfd/twl6030.h> #include <twl6030_pwrbtn.h> @@ -22,7 +21,6 @@ struct twl6030_pwrbtn_internal_data { int code; u8 previous_state; struct twl6030 *twl6030; - struct kfifo *recv_fifo; struct console_device cdev; struct poller_struct poller; }; @@ -41,32 +39,13 @@ static void ic2_key_poller(struct poller_struct *poller) } val = !(val & PWR_PWRON_IRQ); if (val != idata->previous_state && val) { - kfifo_put(idata->recv_fifo, (u_char *)&idata->code, - sizeof(int)); + console_kfifo_putc(&idata->cdev, idata->code); dev_dbg(idata->cdev.dev, "pressed power button as %d\n", idata->code); } idata->previous_state = val; } -static int twl6030_pwrbtn_tstc(struct console_device *cdev) -{ - struct twl6030_pwrbtn_internal_data *idata = container_of( - cdev, struct twl6030_pwrbtn_internal_data, cdev); - - return kfifo_len(idata->recv_fifo) ? 1 : 0; -} - -static int twl6030_pwrbtn_getc(struct console_device *cdev) -{ - int code = 0; - struct twl6030_pwrbtn_internal_data *idata = container_of( - cdev, struct twl6030_pwrbtn_internal_data, cdev); - - kfifo_get(idata->recv_fifo, (u_char *)&code, sizeof(int)); - return code; -} - static int __init twl6030_pwrbtn_probe(struct device_d *dev) { struct twl6030_pwrbtn_internal_data *idata; @@ -80,12 +59,7 @@ static int __init twl6030_pwrbtn_probe(struct device_d *dev) idata = xzalloc(sizeof(struct twl6030_pwrbtn_internal_data)); - idata->recv_fifo = kfifo_alloc(sizeof(int)); - if (!idata->recv_fifo) { - dev_err(dev, "out of memory allocating kfifo\n"); - free(idata); - return -ENOMEM; - } + idata->cdev.fifo_input_size = 1; idata->code = pdata->code; idata->twl6030 = twl6030_get(); @@ -93,8 +67,6 @@ static int __init twl6030_pwrbtn_probe(struct device_d *dev) dev->type_data = &idata->cdev; idata->cdev.dev = dev; - idata->cdev.tstc = twl6030_pwrbtn_tstc; - idata->cdev.getc = twl6030_pwrbtn_getc; console_register(&idata->cdev); return poller_register(&idata->poller); diff --git a/include/console.h b/include/console.h index 97a406d..89514b6 100644 --- a/include/console.h +++ b/include/console.h @@ -23,6 +23,7 @@ #include <param.h> #include <linux/list.h> #include <driver.h> +#include <kfifo.h> #define CONSOLE_STDIN (1 << 0) #define CONSOLE_STDOUT (1 << 1) @@ -49,6 +50,12 @@ struct console_device { struct list_head list; + struct kfifo *recv_fifo; + int (*drv_getc)(struct console_device *cdev); + int (*drv_tstc)(struct console_device *cdev); + + int fifo_input_size; + unsigned char f_active; unsigned int baudrate; @@ -73,4 +80,19 @@ extern int barebox_loglevel; struct console_device *console_get_first_active(void); +#ifdef CONFIG_CONSOLE_KFIFO +void console_kfifo_putc(struct console_device *cdev, int c); +void console_kfifo_puts(struct console_device *cdev,char *s, int len); +int console_kfifo_input_init(struct console_device *cdev); +void console_kfifo_input_clean(struct console_device *cdev); +#else +static inline void console_kfifo_putc(struct console_device *cdev, int c) {} +static inline void console_kfifo_puts(struct console_device *cdev,char *s, int len) {} +static inline int console_kfifo_input_init(struct console_device *cdev) +{ + return 0; +} +static void inline console_kfifo_input_clean(struct console_device *cdev) {} +#endif + #endif diff --git a/include/gpio_keys.h b/include/gpio_keys.h index f4a22e1..02b6933 100644 --- a/include/gpio_keys.h +++ b/include/gpio_keys.h @@ -2,7 +2,6 @@ #define _GPIO_KEYS_H #include <poller.h> -#include <kfifo.h> struct gpio_keys_button { /* Configuration parameters */ -- 2.1.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 6/9] console: factorize kfifo input support 2014-12-23 18:21 ` [PATCH 6/9] console: factorize kfifo input support Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-05 11:18 ` Sascha Hauer 0 siblings, 0 replies; 22+ messages in thread From: Sascha Hauer @ 2015-01-05 11:18 UTC (permalink / raw) To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox 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 <plagnioj@jcrosoft.com> > --- > 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-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 7/9] poller: allow to restrict the poller frequency 2014-12-23 18:21 ` [PATCH 1/9] kfifo: allow to pass a null point on kfifo_free Jean-Christophe PLAGNIOL-VILLARD ` (4 preceding siblings ...) 2014-12-23 18:21 ` [PATCH 6/9] console: factorize kfifo input support Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 ` Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 10:42 ` Sascha Hauer 2014-12-23 18:21 ` [PATCH 8/9] console: allow to specify the device id Jean-Christophe PLAGNIOL-VILLARD 2014-12-23 18:21 ` [PATCH 9/9] defaultenv-2: create a specific defaultenv for splash Jean-Christophe PLAGNIOL-VILLARD 7 siblings, 1 reply; 22+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 UTC (permalink / raw) To: barebox so we do not slow down barebox on too much polling specialy on USB drivers Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> --- common/poller.c | 11 ++++++++++- include/poller.h | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) 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; }; int poller_register(struct poller_struct *poller); -- 2.1.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 7/9] poller: allow to restrict the poller frequency 2014-12-23 18:21 ` [PATCH 7/9] poller: allow to restrict the poller frequency Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-05 10:42 ` Sascha Hauer 2015-01-06 0:46 ` Jean-Christophe PLAGNIOL-VILLARD 0 siblings, 1 reply; 22+ messages in thread From: Sascha Hauer @ 2015-01-05 10:42 UTC (permalink / raw) To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox 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 <plagnioj@jcrosoft.com> > --- > 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-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 7/9] poller: allow to restrict the poller frequency 2015-01-05 10:42 ` Sascha Hauer @ 2015-01-06 0:46 ` Jean-Christophe PLAGNIOL-VILLARD 0 siblings, 0 replies; 22+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-06 0:46 UTC (permalink / raw) To: Sascha Hauer; +Cc: barebox 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 <plagnioj@jcrosoft.com> > > --- > > 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-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 8/9] console: allow to specify the device id 2014-12-23 18:21 ` [PATCH 1/9] kfifo: allow to pass a null point on kfifo_free Jean-Christophe PLAGNIOL-VILLARD ` (5 preceding siblings ...) 2014-12-23 18:21 ` [PATCH 7/9] poller: allow to restrict the poller frequency Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 ` Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 10:46 ` Sascha Hauer 2014-12-23 18:21 ` [PATCH 9/9] defaultenv-2: create a specific defaultenv for splash Jean-Christophe PLAGNIOL-VILLARD 7 siblings, 1 reply; 22+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 UTC (permalink / raw) To: barebox so we can use dynamic number id with specific devname Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> --- 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; status = console_register(cdev); if (status) diff --git a/include/console.h b/include/console.h index 89514b6..32938aa 100644 --- a/include/console.h +++ b/include/console.h @@ -47,6 +47,7 @@ struct console_device { int (*set_mode)(struct console_device *cdev, enum console_mode mode); char *devname; + int devid; struct list_head list; -- 2.1.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 8/9] console: allow to specify the device id 2014-12-23 18:21 ` [PATCH 8/9] console: allow to specify the device id Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-05 10:46 ` Sascha Hauer 0 siblings, 0 replies; 22+ messages in thread From: Sascha Hauer @ 2015-01-05 10:46 UTC (permalink / raw) To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox 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 <plagnioj@jcrosoft.com> > --- > 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-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 9/9] defaultenv-2: create a specific defaultenv for splash 2014-12-23 18:21 ` [PATCH 1/9] kfifo: allow to pass a null point on kfifo_free Jean-Christophe PLAGNIOL-VILLARD ` (6 preceding siblings ...) 2014-12-23 18:21 ` [PATCH 8/9] console: allow to specify the device id Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 ` Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 10:50 ` Sascha Hauer 7 siblings, 1 reply; 22+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2014-12-23 18:21 UTC (permalink / raw) To: barebox This will allow to factorize splash init Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> --- 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 0000000..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 0000000..04fdc8e --- /dev/null +++ b/defaultenv/defaultenv-2-splash/init/splash @@ -0,0 +1,3 @@ +#!/bin/sh + +/env/bin/splash diff --git a/defaultenv/defaultenv.c b/defaultenv/defaultenv.c index 3b4efcf..712502d 100644 --- a/defaultenv/defaultenv.c +++ b/defaultenv/defaultenv.c @@ -48,6 +48,8 @@ static void defaultenv_add_base(void) defaultenv_append_directory(defaultenv_2_menu); if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU)) defaultenv_append_directory(defaultenv_2_dfu); + if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_SPLASH)) + defaultenv_append_directory(defaultenv_2_splash); if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC)) defaultenv_append_directory(defaultenv_1); } -- 2.1.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 9/9] defaultenv-2: create a specific defaultenv for splash 2014-12-23 18:21 ` [PATCH 9/9] defaultenv-2: create a specific defaultenv for splash Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-05 10:50 ` Sascha Hauer 2015-01-06 0:43 ` Jean-Christophe PLAGNIOL-VILLARD 0 siblings, 1 reply; 22+ messages in thread From: Sascha Hauer @ 2015-01-05 10:50 UTC (permalink / raw) To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox 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 <plagnioj@jcrosoft.com> > --- > 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 0000000..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 0000000..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-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 9/9] defaultenv-2: create a specific defaultenv for splash 2015-01-05 10:50 ` Sascha Hauer @ 2015-01-06 0:43 ` Jean-Christophe PLAGNIOL-VILLARD 2015-01-06 12:57 ` Sascha Hauer 0 siblings, 1 reply; 22+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-06 0:43 UTC (permalink / raw) To: Sascha Hauer; +Cc: barebox 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 <plagnioj@jcrosoft.com> > > --- > > 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 0000000..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 0000000..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-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 9/9] defaultenv-2: create a specific defaultenv for splash 2015-01-06 0:43 ` Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-06 12:57 ` Sascha Hauer 2015-01-07 5:49 ` Jean-Christophe PLAGNIOL-VILLARD 0 siblings, 1 reply; 22+ messages in thread From: Sascha Hauer @ 2015-01-06 12:57 UTC (permalink / raw) To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox On Tue, Jan 06, 2015 at 01:43:28AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > diff --git a/defaultenv/defaultenv-2-splash/init/splash b/defaultenv/defaultenv-2-splash/init/splash > > > new file mode 100644 > > > index 0000000..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 Then I'm much more in favor for using 000-xxx style. This makes the intention clear how things should be ordered. Besides, if you need board specific init you can still overwrite /env/init/splash instead of /env/bin/splash. 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-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 9/9] defaultenv-2: create a specific defaultenv for splash 2015-01-06 12:57 ` Sascha Hauer @ 2015-01-07 5:49 ` Jean-Christophe PLAGNIOL-VILLARD 0 siblings, 0 replies; 22+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-07 5:49 UTC (permalink / raw) To: Sascha Hauer; +Cc: barebox > On Jan 6, 2015, at 8:57 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote: > > On Tue, Jan 06, 2015 at 01:43:28AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: >>>> diff --git a/defaultenv/defaultenv-2-splash/init/splash b/defaultenv/defaultenv-2-splash/init/splash >>>> new file mode 100644 >>>> index 0000000..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 > > Then I'm much more in favor for using 000-xxx style. This makes the > intention clear how things should be ordered. > > Besides, if you need board specific init you can still overwrite > /env/init/splash instead of /env/bin/splash. If we do this I propose to move all the default init script in /env/bin or what ever and use symlink in /env/init/ what do you think? Best Regards, J. _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2015-01-07 5:50 UTC | newest] Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-12-23 17:07 [PATCH 0/9] versatilepb, console, graphichs serie Jean-Christophe PLAGNIOL-VILLARD 2014-12-23 18:21 ` [PATCH 1/9] kfifo: allow to pass a null point on kfifo_free Jean-Christophe PLAGNIOL-VILLARD 2014-12-23 18:21 ` [PATCH 2/9] efika-mx-smartbook: enable led hearbeat on mail Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 10:36 ` Sascha Hauer 2014-12-23 18:21 ` [PATCH 3/9] grapric_utils: set_pixel only write 16bit in 16bit mode Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 10:37 ` Sascha Hauer 2014-12-23 18:21 ` [PATCH 4/9] versatilepb: move barebox to 32 MiB and use zImage Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 10:38 ` Sascha Hauer 2014-12-23 18:21 ` [PATCH 5/9] versatilepb: switch to defaultenv-2 Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 10:38 ` Sascha Hauer 2014-12-23 18:21 ` [PATCH 6/9] console: factorize kfifo input support Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 11:18 ` Sascha Hauer 2014-12-23 18:21 ` [PATCH 7/9] poller: allow to restrict the poller frequency Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 10:42 ` Sascha Hauer 2015-01-06 0:46 ` Jean-Christophe PLAGNIOL-VILLARD 2014-12-23 18:21 ` [PATCH 8/9] console: allow to specify the device id Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 10:46 ` Sascha Hauer 2014-12-23 18:21 ` [PATCH 9/9] defaultenv-2: create a specific defaultenv for splash Jean-Christophe PLAGNIOL-VILLARD 2015-01-05 10:50 ` Sascha Hauer 2015-01-06 0:43 ` Jean-Christophe PLAGNIOL-VILLARD 2015-01-06 12:57 ` Sascha Hauer 2015-01-07 5:49 ` Jean-Christophe PLAGNIOL-VILLARD
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox