Skip to contentSkip to conversation

ARM: add support for Canon DIGIC chips and Canon PowerShot A1100 IS

PATCH Superseded Antony Pavlov 2 participants 14 messages Jul 27, 2014 – Jul 28, 2014

Subsystems (7)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover ARM: add support for Canon DIGIC chips and Canon PowerShot A1100 IS

DIGIC is Canon Inc.'s name for a family of SoC for digital cameras and camcorders.

See http://en.wikipedia.org/wiki/DIGIC for details.

There is no publicly available specification for DIGIC chips. All information about DIGIC chip internals is based on reverse engineering efforts made by CHDK (http://chdk.wikia.com) and Magic Lantern (http://www.magiclantern.fm) projects contributors.

Also this patch series adds initial support for Canon PowerShot A1100 IS compact camera (it is my only camera with connected UART interface). As the DIGIC-based cameras differences mostly are unsignificant (e.g. RAM-size, ROM type and size, GPIO usage) the other compact and DSLR cameras support can be easely added.

One can easely run barebox for Canon A1100 using QEMU version 2.0 or newer.

This patchseries uses some patches already submitted to maillist:

* clean barebox.zynq
* treewide: drop Doxygen stuff

Antony Pavlov (9):
ARM: add ARM946E-S CPU type
ARM: add very initial support for Canon DIGIC chips
clocksource: add driver for Canon DIGIC timer
serial: add driver for Canon DIGIC UART
gpio: add driver for Canon DIGIC
ARM: DIGIC: add Canon PowerShot A1100 IS support
ARM: add Canon A1100 ROM image generation
ARM: DIGIC: add canon-a1100_defconfig
Documentation: add QEMU Canon A1100 barebox mini-howto

 .gitignore                                  |   1 +
 Documentation/boards/digic.rst              |  16 +++
 Makefile                                    |   2 +-
 arch/arm/Kconfig                            |  10 ++
 arch/arm/Makefile                           |  11 ++
 arch/arm/boards/Makefile                    |   1 +
 arch/arm/boards/canon-a1100/Makefile        |   1 +
 arch/arm/boards/canon-a1100/lowlevel.c      |  23 ++++
 arch/arm/configs/canon-a1100_defconfig      |  56 +++++++++
 arch/arm/cpu/Kconfig                        |  13 ++
 arch/arm/dts/canon-a1100.dts                |  35 ++++++
 arch/arm/dts/digic4.dtsi                    |  42 +++++++
 arch/arm/mach-digic/Kconfig                 |  15 +++
 arch/arm/mach-digic/Makefile                |   1 +
 arch/arm/mach-digic/core.c                  |  24 ++++
 arch/arm/mach-digic/include/mach/debug_ll.h |  40 +++++++
 arch/arm/mach-digic/include/mach/digic4.h   |  23 ++++
 arch/arm/mach-digic/include/mach/uart.h     |  28 +++++
 drivers/clocksource/Kconfig                 |   4 +
 drivers/clocksource/Makefile                |   1 +
 drivers/clocksource/digic.c                 |  93 ++++++++++++++
 drivers/gpio/Kconfig                        |   4 +
 drivers/gpio/Makefile                       |   1 +
 drivers/gpio/gpio-digic.c                   | 180 ++++++++++++++++++++++++++++
 drivers/serial/Kconfig                      |   4 +
 drivers/serial/Makefile                     |   1 +
 drivers/serial/serial_digic.c               | 132 ++++++++++++++++++++
 scripts/canon-a1100-image                   |  10 ++
 28 files changed, 771 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/boards/digic.rst
 create mode 100644 arch/arm/boards/canon-a1100/Makefile
 create mode 100644 arch/arm/boards/canon-a1100/lowlevel.c
 create mode 100644 arch/arm/configs/canon-a1100_defconfig
 create mode 100644 arch/arm/dts/canon-a1100.dts
 create mode 100644 arch/arm/dts/digic4.dtsi
 create mode 100644 arch/arm/mach-digic/Kconfig
 create mode 100644 arch/arm/mach-digic/Makefile
 create mode 100644 arch/arm/mach-digic/core.c
 create mode 100644 arch/arm/mach-digic/include/mach/debug_ll.h
 create mode 100644 arch/arm/mach-digic/include/mach/digic4.h
 create mode 100644 arch/arm/mach-digic/include/mach/uart.h
 create mode 100644 drivers/clocksource/digic.c
 create mode 100644 drivers/gpio/gpio-digic.c
 create mode 100644 drivers/serial/serial_digic.c
 create mode 100755 scripts/canon-a1100-image
Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 1/9 ARM: add ARM946E-S CPU type

ARM946E-S is used in the DIGIC family SoCs.

ARM946E-S core supports ARMv5TE and has Cache & MPU. Linux kernel uses ARMv4 MPU cache routines for ARM946E-S core. E.g. see linux.git/boot/compressed/head.S:

    .word   0x41009400              @ ARM94x
    .word   0xff00ff00
    W(b)    __armv4_mpu_cache_on
    W(b)    __armv4_mpu_cache_off
    W(b)    __armv4_mpu_cache_flush

So select CPU_32v4T for ARM946E-S despite of ARMv5TE support.

---
 arch/arm/cpu/Kconfig | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/cpu/Kconfig +13 -0
index aed4cb7..fb1a999 100644
@@ -39,6 +39,19 @@ config CPU_ARM926T
 	  Say Y if you want support for the ARM926T processor.
 	  Otherwise, say N.
 
+# ARM946E-S
+config CPU_ARM946E
+	bool
+	depends on !MMU
+	select CPU_32v4T
+	help
+	  ARM946E-S is a member of the ARM9E-S family of high-
+	  performance, 32-bit system-on-chip processor solutions.
+	  The TCM and ARMv5TE 32-bit instruction set is supported.
+
+	  Say Y if you want support for the ARM946E-S processor.
+	  Otherwise, say N.
+
 # Feroceon
 config CPU_FEROCEON
 	bool
Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 2/9 ARM: add very initial support for Canon DIGIC chips

In reply to Antony Pavlov
---
 arch/arm/Kconfig                            | 10 +++++++
 arch/arm/Makefile                           |  1 +
 arch/arm/dts/digic4.dtsi                    | 42 +++++++++++++++++++++++++++++
 arch/arm/mach-digic/Kconfig                 |  8 ++++++
 arch/arm/mach-digic/Makefile                |  1 +
 arch/arm/mach-digic/core.c                  | 24 +++++++++++++++++
 arch/arm/mach-digic/include/mach/debug_ll.h | 40 +++++++++++++++++++++++++++
 arch/arm/mach-digic/include/mach/digic4.h   | 23 ++++++++++++++++
 arch/arm/mach-digic/include/mach/uart.h     | 28 +++++++++++++++++++
 9 files changed, 177 insertions(+)
arch/arm/Kconfig +10 -0
index 3af0197..ea0abcd 100644
@@ -62,6 +62,15 @@ config ARCH_DAVINCI
 	select HAS_DEBUG_LL
 	select GPIOLIB
 
+config ARCH_DIGIC
+	bool "Canon DIGIC-based cameras"
+	select CPU_ARM946E
+	select HAS_DEBUG_LL
+	select CLOCKSOURCE_DIGIC
+	select GPIOLIB
+	help
+	  Support for Canon's digital cameras that use the DIGIC4 chip.
+
 config ARCH_EP93XX
 	bool "Cirrus Logic EP93xx"
 	select CPU_ARM920T
@@ -220,6 +229,7 @@ source arch/arm/mach-at91/Kconfig
 source arch/arm/mach-bcm2835/Kconfig
 source arch/arm/mach-clps711x/Kconfig
 source arch/arm/mach-davinci/Kconfig
+source arch/arm/mach-digic/Kconfig
 source arch/arm/mach-ep93xx/Kconfig
 source arch/arm/mach-highbank/Kconfig
 source arch/arm/mach-imx/Kconfig
arch/arm/Makefile +1 -0
index 983f7f5..1b0d7fe 100644
@@ -55,6 +55,7 @@ machine-$(CONFIG_ARCH_AT91)		:= at91
 machine-$(CONFIG_ARCH_BCM2835)		:= bcm2835
 machine-$(CONFIG_ARCH_CLPS711X)		:= clps711x
 machine-$(CONFIG_ARCH_DAVINCI)		:= davinci
+machine-$(CONFIG_ARCH_DIGIC)		:= digic
 machine-$(CONFIG_ARCH_EP93XX)		:= ep93xx
 machine-$(CONFIG_ARCH_HIGHBANK)		:= highbank
 machine-$(CONFIG_ARCH_IMX)		:= imx
arch/arm/dts/digic4.dtsi new file +42 -0

42 lines not on this page · raw message

arch/arm/mach-digic/Kconfig new file +8 -0
new file mode 100644
index 0000000..49ce44a
@@ -0,0 +1,8 @@
+if ARCH_DIGIC
+
+choice
+	prompt "camera type"
+
+endchoice
+
+endif
arch/arm/mach-digic/Makefile new file +1 -0
new file mode 100644
index 0000000..820eb10
@@ -0,0 +1 @@
+obj-y += core.o
arch/arm/mach-digic/core.c new file +24 -0
new file mode 100644
index 0000000..a442633
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2013 Antony Pavlov <[email protected]>
+ *
+ * This file is part of barebox.
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <common.h>
+
+void __noreturn reset_cpu(unsigned long ignored)
+{
+	unreachable();
+}
+EXPORT_SYMBOL(reset_cpu);
arch/arm/mach-digic/include/mach/debug_ll.h new file +40 -0
new file mode 100644
index 0000000..721fd44
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2013, 2014 Antony Pavlov <[email protected]>
+ *
+ * This file is part of barebox.
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef __MACH_DEBUG_LL_H__
+#define __MACH_DEBUG_LL_H__
+
+#include <io.h>
+#include <mach/digic4.h>
+#include <mach/uart.h>
+
+#define DEBUG_LL_UART         DIGIC4_UART
+
+/* Serial interface registers */
+#define DEBUG_LL_UART_TX         (DEBUG_LL_UART + DIGIC_UART_TX)
+#define DEBUG_LL_UART_ST         (DEBUG_LL_UART + DIGIC_UART_ST)
+
+static inline void PUTC_LL(char ch)
+{
+	while (!(readl(DEBUG_LL_UART_ST) & DIGIC_UART_ST_TX_RDY))
+		; /* noop */
+
+	writel(0x06, DEBUG_LL_UART_ST);
+	writel(ch, DEBUG_LL_UART_TX);
+}
+
+#endif /* __MACH_DEBUG_LL_H__ */
arch/arm/mach-digic/include/mach/digic4.h new file +23 -0
new file mode 100644
index 0000000..ffc7979
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2013 Antony Pavlov <[email protected]>
+ *
+ * This file is part of barebox.
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef __DIGIC4_H__
+#define __DIGIC4_H__
+
+#define DIGIC4_UART	0xc0800000
+
+#endif /* __DIGIC4_H__ */
arch/arm/mach-digic/include/mach/uart.h new file +28 -0
new file mode 100644
index 0000000..043f7cd
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2013 Antony Pavlov <[email protected]>
+ *
+ * This file is part of barebox.
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef __DIGIC_UART_H__
+#define __DIGIC_UART_H__
+
+/* Serial interface registers offsets */
+#define DIGIC_UART_TX	0x0
+#define DIGIC_UART_RX	0x4
+#define DIGIC_UART_ST	0x14
+# define DIGIC_UART_ST_RX_RDY	1
+# define DIGIC_UART_ST_TX_RDY	2
+
+#endif /* __DIGIC_UART_H__ */
Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

Re: [PATCH 2/9] ARM: add very initial support for Canon DIGIC chips

Quoted 17 lines · Antony Pavlov

+++ b/arch/arm/mach-digic/core.c

arch/arm/mach-digic/core.c new file +14 -0
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2013 Antony Pavlov <[email protected]>
+ *
+ * This file is part of barebox.
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.

arch/arm/mach-digic/core.c line 24

Quoted 10 lines
arch/arm/mach-digic/core.c new file +10 -0
+ *
+ */
+
+#include <common.h>
+
+void __noreturn reset_cpu(unsigned long ignored)
+{
+	unreachable();
+}
+EXPORT_SYMBOL(reset_cpu);

You shouldn't use unreachable here. unreachable is to suppress control flow warnings when a code path is not reachable. The code above is indeed reachable. A plain printf("%s: not implemented\n", __func__); while(1); should do.

Sascha

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH 3/9 clocksource: add driver for Canon DIGIC timer

In reply to Antony Pavlov
---
 drivers/clocksource/Kconfig  |  4 ++
 drivers/clocksource/Makefile |  1 +
 drivers/clocksource/digic.c  | 93 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 98 insertions(+)
drivers/clocksource/Kconfig +4 -0
index c1480ce..fc5a389 100644
@@ -14,6 +14,10 @@ config CLOCKSOURCE_CLPS711X
 	bool
 	depends on ARCH_CLPS711X
 
+config CLOCKSOURCE_DIGIC
+	bool
+	depends on ARCH_DIGIC
+
 config CLOCKSOURCE_DUMMY
 	bool "Enable dummy software-only clocksource"
 	help
drivers/clocksource/Makefile +1 -0
index 97c0288..b80df6b 100644
@@ -2,6 +2,7 @@ obj-$(CONFIG_AMBA_SP804) += amba-sp804.o
 obj-$(CONFIG_ARM_SMP_TWD) += arm_smp_twd.o
 obj-$(CONFIG_CLOCKSOURCE_BCM2835) += bcm2835.o
 obj-$(CONFIG_CLOCKSOURCE_CLPS711X) += clps711x.o
+obj-$(CONFIG_CLOCKSOURCE_DIGIC)   += digic.o
 obj-$(CONFIG_CLOCKSOURCE_DUMMY)   += dummy.o
 obj-$(CONFIG_CLOCKSOURCE_MVEBU)   += mvebu.o
 obj-$(CONFIG_CLOCKSOURCE_NOMADIK) += nomadik.o
drivers/clocksource/digic.c new file +93 -0

93 lines not on this page · raw message

Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

PATCH 4/9 serial: add driver for Canon DIGIC UART

In reply to Antony Pavlov
---
 drivers/serial/Kconfig        |   4 ++
 drivers/serial/Makefile       |   1 +
 drivers/serial/serial_digic.c | 132 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 137 insertions(+)
drivers/serial/Kconfig +4 -0
index 5698c2f..146bf1e 100644
@@ -133,4 +133,8 @@ config DRIVER_SERIAL_CADENCE
 	help
 	  Say Y here if you have a Cadence serial IP core.
 
+config DRIVER_SERIAL_DIGIC
+	bool "Canon DIGIC serial driver"
+	depends on ARCH_DIGIC
+
 endmenu
drivers/serial/Makefile +1 -0
index 2c0176d..189e777 100644
@@ -19,3 +19,4 @@ obj-$(CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT)	+= serial_omap4_usbboot.o
 obj-$(CONFIG_DRIVER_SERIAL_AUART)		+= serial_auart.o
 obj-$(CONFIG_DRIVER_SERIAL_CADENCE)		+= serial_cadence.o
 obj-$(CONFIG_DRIVER_SERIAL_EFI_STDIO)		+= efi-stdio.o
+obj-$(CONFIG_DRIVER_SERIAL_DIGIC)		+= serial_digic.o
drivers/serial/serial_digic.c new file +132 -0

132 lines not on this page · raw message

Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw

PATCH 5/9 gpio: add driver for Canon DIGIC

In reply to Antony Pavlov
---
 drivers/gpio/Kconfig      |   4 ++
 drivers/gpio/Makefile     |   1 +
 drivers/gpio/gpio-digic.c | 180 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 185 insertions(+)
drivers/gpio/Kconfig +4 -0
index 6928fcb..0ca7df4 100644
@@ -9,6 +9,10 @@ menu "GPIO"
 config GPIO_GENERIC
 	bool
 
+config GPIO_DIGIC
+	bool "GPIO support for Canon DIGIC"
+	depends on ARCH_DIGIC
+
 config GPIO_BCM2835
 	bool "GPIO support for BCM2835"
 	depends on ARCH_BCM2835
drivers/gpio/Makefile +1 -0
index ece5efd..510d146 100644
@@ -3,6 +3,7 @@ obj-$(CONFIG_GPIOLIB)		+= gpiolib.o
 obj-$(CONFIG_GPIO_BCM2835)	+= gpio-bcm2835.o
 obj-$(CONFIG_GPIO_DAVINCI)	+= gpio-davinci.o
 obj-$(CONFIG_GPIO_CLPS711X)	+= gpio-clps711x.o
+obj-$(CONFIG_GPIO_DIGIC)	+= gpio-digic.o
 obj-$(CONFIG_GPIO_GENERIC)	+= gpio-generic.o
 obj-$(CONFIG_GPIO_IMX)		+= gpio-imx.o
 obj-$(CONFIG_GPIO_JZ4740)	+= gpio-jz4740.o
drivers/gpio/gpio-digic.c new file +180 -0

180 lines not on this page · raw message

Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#7 lore raw

PATCH 6/9 ARM: DIGIC: add Canon PowerShot A1100 IS support

In reply to Antony Pavlov
---
 arch/arm/boards/Makefile               |  1 +
 arch/arm/boards/canon-a1100/Makefile   |  1 +
 arch/arm/boards/canon-a1100/lowlevel.c | 23 ++++++++++++++++++++++
 arch/arm/dts/canon-a1100.dts           | 35 ++++++++++++++++++++++++++++++++++
 arch/arm/mach-digic/Kconfig            |  7 +++++++
 5 files changed, 67 insertions(+)
arch/arm/boards/Makefile +1 -0
index 2ed3730..c60da81 100644
@@ -12,6 +12,7 @@ obj-$(CONFIG_MACH_AT91SAM9N12EK)		+= at91sam9n12ek/
 obj-$(CONFIG_MACH_AT91SAM9X5EK)			+= at91sam9x5ek/
 obj-$(CONFIG_MACH_BEAGLE)			+= beagle/
 obj-$(CONFIG_MACH_BEAGLEBONE)			+= beaglebone/
+obj-$(CONFIG_MACH_CANON_A1100)			+= canon-a1100/
 obj-$(CONFIG_MACH_NITROGEN6X)			+= boundarydevices-nitrogen6x/
 obj-$(CONFIG_MACH_CCMX51)			+= ccxmx51/
 obj-$(CONFIG_MACH_CFA10036)			+= crystalfontz-cfa10036/
arch/arm/boards/canon-a1100/Makefile new file +1 -0
new file mode 100644
index 0000000..b08c4a9
@@ -0,0 +1 @@
+lwl-y += lowlevel.o
arch/arm/boards/canon-a1100/lowlevel.c new file +23 -0
new file mode 100644
index 0000000..bbae825
@@ -0,0 +1,23 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+void __naked barebox_arm_reset_vector(void)
+{
+	arm_cpu_lowlevel_init();
+
+	/* FIXME: can we determine RAM size using CP15 register?
+	 *
+	 * see http://chdk.setepontos.com/index.php?topic=5980.90
+	 *
+	 * http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0363e/Bgbcdeca.html
+	 * 4.2.19. c6, MPU memory region programming registers
+	 *
+	 * But the 'cpuinfo' command says that the Protection
+	 * unit is disabled.
+	 * The Control Register value (mrc    p15, 0, %0, c0, c1, 4)
+	 * is 0x00051078.
+	 */
+	barebox_arm_entry(0x0, SZ_64M, 0);
+}
arch/arm/dts/canon-a1100.dts new file +35 -0
new file mode 100644
index 0000000..a88eacf
@@ -0,0 +1,35 @@
+/dts-v1/;
+
+/include/ "digic4.dtsi"
+
+/ {
+	model = "Canon PowerShot A1100 IS";
+	compatible = "canon,a1100";
+
+	memory {
+		reg = <0x00000000 0x04000000>;
+	};
+
+	flash@f8000000 {
+		compatible = "cfi-flash";
+		reg = <0xf8000000 0x08000000>;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		direct_print {
+			label = "direct-print (blue)";
+			gpios = <&gpio 51 0>;
+		};
+
+		auto_focus {
+			label = "auto-focus (red)";
+			gpios = <&gpio 55 0>;
+		};
+	};
+};
+
+&timer2 {
+        status = "okay";
+};
arch/arm/mach-digic/Kconfig +7 -0
index 49ce44a..d25c3b3 100644
@@ -3,6 +3,13 @@ if ARCH_DIGIC
 choice
 	prompt "camera type"
 
+config MACH_CANON_A1100
+	bool "Canon PowerShot A1100 IS"
+
 endchoice
 
+config ARCH_TEXT_BASE
+	hex
+	default 0x00001900 if MACH_CANON_A1100
+
 endif
Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw

PATCH 7/9 ARM: add Canon A1100 ROM image generation

In reply to Antony Pavlov
---
 .gitignore                |  1 +
 Makefile                  |  2 +-
 arch/arm/Makefile         | 10 ++++++++++
 scripts/canon-a1100-image | 10 ++++++++++
 4 files changed, 22 insertions(+), 1 deletion(-)
.gitignore +1 -0
index ddeb7b1..a62e08c 100644
@@ -47,6 +47,7 @@ barebox.map
 barebox.kwb
 barebox.kwbuart
 barebox.efi
+barebox.canon-a1100.bin
 barebox-flash-image
 System.map
 Module.symvers
Makefile +1 -1
index 3d08818..1ec0bfd 100644
@@ -994,7 +994,7 @@ CLEAN_FILES +=	barebox System.map include/generated/barebox_default_env.h \
 		scripts/bareboxenv-target barebox-flash-image \
 		barebox.srec barebox.s5p barebox.ubl barebox.zynq \
 		barebox.uimage barebox.spi barebox.kwb barebox.kwbuart \
-		barebox.efi
+		barebox.efi barebox.canon-a1100.bin
 
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include2 usr/include
arch/arm/Makefile +10 -0
index 1b0d7fe..337aef1 100644
@@ -185,6 +185,16 @@ ifeq ($(machine-y),zynq)
 KBUILD_IMAGE := barebox.zynq
 endif
 
+quiet_cmd_canon_a1100_image = DD      $@
+      cmd_canon_a1100_image = scripts/canon-a1100-image $< $@ || \
+	echo "WARNING: Couldn't create Canon A1100 image due to previous errors."
+barebox.canon-a1100.bin: $(KBUILD_BINARY) FORCE
+	$(call if_changed,canon_a1100_image)
+
+ifeq ($(CONFIG_MACH_CANON_A1100),y)
+KBUILD_IMAGE := barebox.canon-a1100.bin
+endif
+
 KWBIMAGE_OPTS = \
 	-c -i $(srctree)/$(BOARD)/kwbimage.cfg -d $(TEXT_BASE) -e $(TEXT_BASE)
 
scripts/canon-a1100-image new file +10 -0
new file mode 100755
index 0000000..6c08d74
@@ -0,0 +1,10 @@
+#!/bin/bash -e
+
+IFILE=$1
+OFILE=$2
+
+dd if=/dev/zero bs=4M count=1 of=$OFILE 2>/dev/null
+dd if=$IFILE of=$OFILE conv=notrunc 2>/dev/null
+
+# 0xffff0000:  fe 3f f0 ea     b       0xffc00000
+echo -n -e "\xfe\x3f\xf0\xea" | dd of=$OFILE bs=64K seek=63 conv=notrunc 2>/dev/null
Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#9 lore raw

PATCH 8/9 ARM: DIGIC: add canon-a1100_defconfig

In reply to Antony Pavlov
---
 arch/arm/configs/canon-a1100_defconfig | 56 ++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
arch/arm/configs/canon-a1100_defconfig new file +56 -0
new file mode 100644
index 0000000..5c1e195
@@ -0,0 +1,56 @@
+CONFIG_BUILTIN_DTB=y
+CONFIG_BUILTIN_DTB_NAME="canon-a1100"
+CONFIG_ARCH_DIGIC=y
+CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
+CONFIG_PBL_IMAGE=y
+CONFIG_IMAGE_COMPRESSION_LZ4=y
+CONFIG_TEXT_BASE=0x00300000
+CONFIG_MALLOC_SIZE=0x200000
+CONFIG_PROMPT="canon-a1100 > "
+CONFIG_GLOB=y
+CONFIG_HUSH_FANCY_PROMPT=y
+CONFIG_CMDLINE_EDITING=y
+CONFIG_AUTO_COMPLETE=y
+# CONFIG_DEFAULT_ENVIRONMENT is not set
+CONFIG_DEBUG_LL=y
+CONFIG_LONGHELP=y
+CONFIG_CMD_IOMEM=y
+CONFIG_CMD_MEMINFO=y
+# CONFIG_CMD_BOOTM is not set
+# CONFIG_CMD_BOOTU is not set
+CONFIG_CMD_GO=y
+CONFIG_CMD_LOADY=y
+# CONFIG_CMD_MOUNT is not set
+# CONFIG_CMD_UMOUNT is not set
+CONFIG_CMD_EXPORT=y
+CONFIG_CMD_GLOBAL=y
+CONFIG_CMD_MD5SUM=y
+# CONFIG_CMD_PWD is not set
+CONFIG_CMD_SHA1SUM=y
+CONFIG_CMD_LET=y
+CONFIG_CMD_MSLEEP=y
+CONFIG_CMD_SLEEP=y
+# CONFIG_CMD_CLEAR is not set
+CONFIG_CMD_ECHO_E=y
+CONFIG_CMD_EDIT=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_MM=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_LED=y
+CONFIG_CMD_OF_NODE=y
+CONFIG_CMD_OF_PROPERTY=y
+CONFIG_CMD_OFTREE=y
+CONFIG_OFDEVICE=y
+CONFIG_DRIVER_SERIAL_DIGIC=y
+# CONFIG_SPI is not set
+CONFIG_MTD=y
+# CONFIG_MTD_WRITE is not set
+CONFIG_DRIVER_CFI=y
+# CONFIG_DRIVER_CFI_BANK_WIDTH_1 is not set
+CONFIG_CLOCKSOURCE_DUMMY=y
+CONFIG_CLOCKSOURCE_DUMMY_RATE=2000
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
+CONFIG_LED_GPIO_OF=y
+CONFIG_GPIO_DIGIC=y
+CONFIG_ZLIB=y
Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#10 lore raw

PATCH 9/9 Documentation: add QEMU Canon A1100 barebox mini-howto

In reply to Antony Pavlov
---
 Documentation/boards/digic.rst | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
Documentation/boards/digic.rst new file +16 -0
new file mode 100644
index 0000000..e2c49b6
@@ -0,0 +1,16 @@
+Canon DIGIC
+===========
+
+Canon PowerShot A1100 IS
+------------------------
+
+Running barebox on QEMU
+^^^^^^^^^^^^^^^^^^^^^^^
+
+QEMU supports Canon A1100 camera emulation since version 2.0.
+
+Usage::
+
+  $ qemu-system-arm -M canon-a1100 \
+      -nographic -monitor null -serial stdio \
+      -bios barebox.canon-a1100.bin
Signature · 7 lines
2.0.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#11 lore raw

Re: [PATCH 9/9] Documentation: add QEMU Canon A1100 barebox mini-howto

Quoted 17 lines · Antony Pavlov
---
 Documentation/boards/digic.rst | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
Documentation/boards/digic.rst new file +6 -0
new file mode 100644
index 0000000..e2c49b6
@@ -0,0 +1,16 @@
+Canon DIGIC
+===========
+
+Canon PowerShot A1100 IS
+------------------------
+

Documentation/boards/digic.rst line 16

Quoted 10 lines
Documentation/boards/digic.rst new file +10 -0
+Running barebox on QEMU
+^^^^^^^^^^^^^^^^^^^^^^^
+
+QEMU supports Canon A1100 camera emulation since version 2.0.
+
+Usage::
+
+  $ qemu-system-arm -M canon-a1100 \
+      -nographic -monitor null -serial stdio \
+      -bios barebox.canon-a1100.bin

Is it possible to run it on a real camera? How?

Sascha

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#12 lore raw

Re: [PATCH 9/9] Documentation: add QEMU Canon A1100 barebox mini-howto

Quoted 22 lines · On Mon, 28 Jul 2014 08:16:04 +0200 Sascha Hauer <[email protected]> wrote:
Quoted 21 lines · Antony Pavlov
---
 Documentation/boards/digic.rst | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
Documentation/boards/digic.rst new file +10 -0
new file mode 100644
index 0000000..e2c49b6
@@ -0,0 +1,16 @@
+Canon DIGIC
+===========
+
+Canon PowerShot A1100 IS
+------------------------
+
+Running barebox on QEMU
+^^^^^^^^^^^^^^^^^^^^^^^
+
+QEMU supports Canon A1100 camera emulation since version 2.0.
Quoted 8 lines

Documentation/boards/digic.rst line 16

Quoted 6 lines
Documentation/boards/digic.rst new file +6 -0
+
+Usage::
+
+  $ qemu-system-arm -M canon-a1100 \
+      -nographic -monitor null -serial stdio \
+      -bios barebox.canon-a1100.bin

Is it possible to run it on a real camera? How?

I have run it several months ago.

Running it on a real camera need some additional utility and non-trivial intructions.

I prefer to add a real camera run instruction in separate patch.

--
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#13 lore raw

Re: [PATCH 9/9] Documentation: add QEMU Canon A1100 barebox mini-howto

In reply to Sascha Hauer
Quoted 22 lines · On Mon, 28 Jul 2014 08:16:04 +0200 Sascha Hauer <[email protected]> wrote:
Quoted 21 lines · Antony Pavlov
---
 Documentation/boards/digic.rst | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
Documentation/boards/digic.rst new file +10 -0
new file mode 100644
index 0000000..e2c49b6
@@ -0,0 +1,16 @@
+Canon DIGIC
+===========
+
+Canon PowerShot A1100 IS
+------------------------
+
+Running barebox on QEMU
+^^^^^^^^^^^^^^^^^^^^^^^
+
+QEMU supports Canon A1100 camera emulation since version 2.0.
Quoted 8 lines

Documentation/boards/digic.rst line 16

Quoted 6 lines
Documentation/boards/digic.rst new file +6 -0
+
+Usage::
+
+  $ qemu-system-arm -M canon-a1100 \
+      -nographic -monitor null -serial stdio \
+      -bios barebox.canon-a1100.bin

Is it possible to run it on a real camera? How?

We need the dancingbits utility from CHDK project for generation binary image for real camera (see https://github.com/c10ud/CHDK/blob/master/tools/dancingbits.c).

This utility is licensed GPLv3+.

Can I put it into barebox.git/scripts?

--
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox