9
0
Fork 0
Commit Graph

15325 Commits

Author SHA1 Message Date
Jean-Christophe PLAGNIOL-VILLARD f210382b3f video: make enable/disable ops optional
Some framebuffers cannot be enabled/disabled, so make the corresponding
ops optional.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-10 08:12:11 +01:00
Sascha Hauer f8f3f26f8b video: call fb_[en|dis]able instead of fops directly
We have fb_enable and fb_disable which handle enabling of a
framebuffer, so use it instead of calling into the ops directly.
This gets the enable count straight.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-10 08:07:25 +01:00
Bastian Stender 52e9a842e3 video: add support for Solomon SSD1307 OLED controller family
It was ported from linux v4.10. Like the kernel driver only
communication via I2C is supported.

It has only been tested with a SSD1306 and a 96x16 OLED display:

	&i2c0 {
		status = "okay";

		ssd1306: oled@3c {
			compatible = "solomon,ssd1306fb-i2c";
			reg = <0x3c>;
			reset-gpios = <&gpio1 1 0>;
			solomon,height = <16>;
			solomon,width = <96>;
			solomon,page-offset = <0>;
			solomon,com-invdir;
			solomon,com-seq;
		};

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-06 08:10:36 +01:00
Bastian Stender b9cf45f00c fb: introduce flush for virtual framebuffer
Some drivers need an explicit sync method to flush the virtual
framebuffer to the display. It is called fb_flush().

fb_flush() gets called on fbc_putc, on fb_close and in the pattern cycle
in the fbtest command.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-28 15:52:53 +01:00
Bastian Stender b4f55fcf35 console: expose consoles in devfs
This enables displaying text on e.g. a framebuffer console by issueing

	echo -o /dev/fbconsole0 abc123

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-28 15:52:35 +01:00
Bastian Stender 1233570798 console: replace set_active by open/close
Opening and closing consoles should be independent from setting them
active. This way it is possible to open e.g. a framebuffer console and
display text on it without showing stdout/stderr.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-28 15:52:35 +01:00
Bastian Stender 3cade5ec3a fbconsole: implement vt100 cursor shown/hidden
This implements the vt100 show cursor command '[?25h' and the hide
cursor command '[?25l'. It is useful for displaying text on a non-active
(no stdout/stdin/stderr) console with 'echo'.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-28 07:45:38 +01:00
Bastian Stender 1e2f65d72a fbconsole: check cursor position before moving
Moving the cursor to x=2, y=2 with "\e[3;3H" on a 12x2 framebuffer
console lead to a barebox crash while drawing the cursor. If the
cursor position is out of bounds clip the cursor to the corresponding
edge.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-28 07:44:59 +01:00
Bastian Stender 41c3c713c4 lib/fonts: add VGA8x8 font
Ported from Linux v4.10.

This font is ideal for displaying a framebuffer console on a small display.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-24 08:25:44 +01:00
Bastian Stender ab5a26ef14 2d-primitives: check dimensions in __illuminate
gl_draw_circle draws outside of the screen if the resolution is too low.
This lead to memory corruption. Check the dimensions before drawing.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-24 08:24:35 +01:00
Bastian Stender 43f2decf5b graphic_utils: do not allocate info in fb_open
info was errorneously allocated, but it really is a pointer to a fb_info
struct from the framebuffer. This fixes a memory leak.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-24 08:24:35 +01:00
Bastian Stender 11f1728318 graphic_utils: implement 8 bpp color depth in gu_set_pixel
Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-24 08:24:35 +01:00
Alexander Kurz a02e9d5082 ARM: i.MX50: do not pass base address to imx53_boot_save_loc
This is a follow-up on commit cf3dfafff4.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-22 09:14:17 +01:00
Alexander Kurz b225bbf295 i.MX: esdhc: fix imx-esdhc driver for non-OF boards
Commit 39f7a7ee8b ("i.MX: esdhc: Do not rely on CPU type for quirks")
made imx-esdhc dependent on OF and broke probing for all non-OF boards.
Since newer platforms like mx6 and vf610 are restricted to OF, the non-OF
probing only needs to distinguish mx5 vs earlier SoC.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-14 08:48:34 +01:00
Alexander Kurz 45164aadfa i.MX: i2c: fix i2c-fsl for non-OF boards
With commit 4ed5b778a5 ("i.MX: i2c: Add Vybrid support") i2c-fsl probe
returns -EINVAL for all non-OF boards.
Since newer planforms, especially vf610 are restricted OF-only it is safe to
assume "fsl,imx21-i2c" if CONFIG_OFDEVICE is not set.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-14 08:48:25 +01:00
Sascha Hauer 4afb09cc67 Merge branch 'for-next/net' 2017-02-13 09:26:04 +01:00
Sascha Hauer 5a30fae8c7 Merge branch 'for-next/mvebu' 2017-02-13 09:26:04 +01:00
Sascha Hauer 2cd2bad2b7 Merge branch 'for-next/misc' 2017-02-13 09:26:04 +01:00
Sascha Hauer 30139163b7 Merge branch 'for-next/imx' 2017-02-13 09:26:04 +01:00
Sascha Hauer bb1a6a2fd3 Merge branch 'for-next/efi' 2017-02-13 09:26:04 +01:00
Sascha Hauer a06513273f Merge branch 'for-next/dts' 2017-02-13 09:26:03 +01:00
Sascha Hauer a9ba8a1d0d Merge branch 'for-next/arm' 2017-02-13 09:26:03 +01:00
Sascha Hauer 19df384cec ARM: i.MX7: Add PSCI support
This adds the SoC specific PSCI bits for i.MX7. Based on the
corresponding U-Boot code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-13 08:35:42 +01:00
Sascha Hauer cc407b4113 ARM: Add PSCI support
This patch contains the barebox implementation for the ARM
"Power State Coordination Interface" (PSCI).

The interface is aimed at the generalization of code in the following
power management scenarios:
* Core idle management.
* Dynamic addition and removal of cores, and secondary core boot.
* big.LITTLE migration.
* System shutdown and reset.

In practice, all that's currently implemented is a way to enable the
secondary core one some SoCs.

With PSCI the Kernel is either started in nonsecure or in Hypervisor
mode and PSCI is used to apply power to the secondary cores.

The start mode is passed in the global.bootm.secure_state variable. This
enum can contain "secure" (Kernel is started in secure mode, means no
PSCI), "nonsecure" (Kernel is started in nonsecure mode, PSCI available)
or "hyp" (Kernel is started in hyp mode, meaning it can support
virtualization).

We currently only support putting the secure monitor code into SDRAM,
which means we always steal some amount of memory from the Kernel.
To keep things simple for now we simply keep the whole barebox binary in
memory

The PSCI support has been tested on i.MX7 only so far. The only
supported operations are CPU_ON and CPU_OFF.

The PSCI and secure monitor code is based on the corresponding U-Boot
code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-13 08:35:42 +01:00
Wadim Egorov 436fb44220 config: Set UART port 2 as debug port
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-10 13:19:40 +01:00
Wadim Egorov 49b321fb89 serial: ns16550: Set read/write functions depending on reg-io-width
Set proper register read/write functions depending on reg-io-width
device tree property.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-10 13:19:40 +01:00
Wadim Egorov 14c6fc99e1 ARM: phycore-rk3288: Use UART2 as debug output
RK3288's UART2 is the default debug uart interface.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-10 13:19:40 +01:00
Sascha Hauer cbf19c96ef dts: update to v4.10-rc6
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-10 08:51:35 +01:00
Sascha Hauer f4db58d47c dts: update to v4.10-rc5
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-10 08:51:32 +01:00
Sascha Hauer 17c6b31c41 dts: update to v4.10-rc4
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-10 08:51:26 +01:00
Sascha Hauer d01aad9b1c Release v2017.02.0
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-10 08:49:58 +01:00
Sascha Hauer 857f69ba8c ARM: start: Fix image size calculation
In barebox_non_pbl_start() we do not run at the address we are linked
at, so we must read linker variables using ld_var(). Since ld_var()
current is not available on arm64 we create two zero sized arrays,
one at the begin of the image and one at the end. The difference
between both is the image size we are looking for.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-08 12:03:20 +01:00
Sascha Hauer cdf33e6ecf ARM: Add smc call support
Taken from the Kernel: A wrapper to make a smc call from C.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-08 09:18:57 +01:00
Sascha Hauer b94205dc97 ARM: Add UNWIND macro
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-08 09:18:53 +01:00
Andrey Smirnov aefc67826e i.MX: vf610: Add support for ZII VF610 Dev Family
Add support for ZII VF610 Dev based designs such as:

    - VF610 Dev, revision B
    - VF610 Dev, revision C
    - CFU1, revision A
    - SPU3, revision A
    - SCU4 AIB, revision C

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-07 09:46:38 +01:00
Sascha Hauer 1dfe9f050f ARM: i.MX7: Initialize CSU
The CSU needs to be initialized, otherwise we cannot access memory
in non secure mode.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 16:13:10 +01:00
Sascha Hauer 55eed47d85 ARM: i.MX7: Add imx7s.dtsi
Needed for compiling the i.MX7 warp board which already includes this
file.

This file is necessary because the upstream dtsi file currently assigns
MX7D_CLK_DUMMY to the gpt1 clock we use, so we won't get a meaningful
clock rate.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 11:54:50 +01:00
Sascha Hauer ad200f0dc3 pinctrl: i.MX7: Fix LPSR sel_imput setting
The i.MX7 has two pinmux controllers, the regular and the LPSR
controller. The LPSR pinmux controller doesn't have any sel_input
registers, instead they can be found in the regular pinmux controller.
This means whenever we want to apply the the sel_input setting for
the LPSR controller, we have to apply them to the regular controller
instead.
In barebox take the easy way out and just add the difference of the
two base addresses to the register offset. The same issue is present
in the Kernel aswell, but when the bootloader already configured
the pins correctly nobody notices when the Kernel sel_input setup
effectively is a no-op.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 11:51:20 +01:00
Sascha Hauer f7165017f4 ARM: start: Fix boarddata allocation
It's essential that we always pass the same size value to
arm_mem_barebox_image(), otherwise the result will be inconsistent.
Pass arm_barebox_size instead of barebox_image_size as the latter
does not contain the max bss segment size.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 11:49:03 +01:00
Sascha Hauer c82e1f90d2 clk: i.MX7: setup ethernet clocks
Reparent ethernet clocks so that they can be used by the
fec driver. The values are the same as U-Boot uses.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:41:56 +01:00
Sascha Hauer 75cb02078e clk: i.MX7: do not register PLL bypass clocks as separate clocks
In the Kernel the bypass bits in the PLLs are now registered as
separate clocks and are no longer handled in the PLL code. In
barebox we haven't made this step and there currently seems to
be no reason to do so.
This means that the bypass bits are currently modified in both
the PLL driver and in the separate clocks which does not work
properly. Drop all the bypass clocks to let the bypass bits
be handled in the PLL driver exclusively.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:41:10 +01:00
Sascha Hauer 23aa31a6d2 clk: i.MX7: Fix ethernet clocks
The original clock code from Linux registers some gates at
base + 0x44e0, 0x44f0, 0x4500, 0x4510. These are not in the reference
manual and do not seem to have any effect on the hardware. The
reference manual lists clocks at 0x4700 and 0x4710 which Linux
does not control at all. These clocks really do have an effect on
the hardware and are needed for ethernet support. Register the
existing clocks rather than the made up clocks to support
ethernet.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:40:23 +01:00
Sascha Hauer 2225c194ed clk: Add support for shared gates
Sometimes a single software control knob controls multiple gates
in hardware. This patch adds support for shared gates which help
coping this situation. The first gate is registered with the hardware
gate as usual, the others are registered as shared gates which does
not have hardware control itself, but only switches the real hardware
gate.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:34:03 +01:00
Sascha Hauer bce7942877 clk: i.MX7: do clock reparenting when all clocks are initialized
By the time the i.MX7 clock driver probes the fixed clocks which
are the roots of the clock tree are not yet present, so reparenting
especially to one of the fixed clocks does not work. Move the
tree setup to a later initcall when the fixed clocks are there.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:32:22 +01:00
Sascha Hauer f5409645e9 clk: i.MX: Pass CLK_OPS_PARENT_ENABLE where necessary
CLK_OPS_PARENT_ENABLE was missing on some i.MX7 specific clocks.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:31:48 +01:00
Sascha Hauer f573cd5e40 clk: i.MX: clk-gate2: Allow to pass flags
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:31:25 +01:00
Sascha Hauer bea07a6881 clk: implement CLK_OPS_PARENT_ENABLE
Some clocks may only be modified when their parent clocks are enabled.
The kernel has the CLK_OPS_PARENT_ENABLE flag for this purpose.
Implement it for barebox aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:31:12 +01:00
Sascha Hauer c21794d0ee clk: Keep enable count consistent over reparent
When reparenting a clock we have to make sure the new parent is enabled
when the clock was enabled on the old parent. Also we have to decrease
the old parents use counter when the clock was enabled.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-06 07:31:00 +01:00
Alexander Kurz 4cb70c729f ARM i.MX: Add i.MX6SL support
Most i.MX6SL infrastructure is already covered in barebox by general i.MX6
support. Missing infrastructure provided in separate commits are
* SoC type detection
* Clock infrastructure

Add the missing fsl,imx6sl-mmdc, so it will not be catched by fsl,imx6q-mmdc
and the remaining bits and pieces to provide barebox i.MX6SL SoC support.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-02 08:13:07 +01:00
Alexander Kurz cb3a2b7be8 ARM: i.MX6SL: import clock infrastructure from linux
Import i.MX6SL clock infrastructure from linux clk-imx6sl.c

To save space, clocks beeing unlikely usefull for bootloader purposes
(SSI, SPDIF, EXTERN_AUDIO) were not imported.
Further, the fixup code from linux mainline commits
a49e6c4b8204 ("ARM: imx: add common clock support for fixup mux")
cbe7fc8aaeef ("ARM: imx: add common clock support for fixup div")
was ignored for this commit.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-02 08:13:07 +01:00