Commit Graph

23391 Commits

Author SHA1 Message Date
Simon Glass
f9aa6a1086 dm: Remove old driver model documentation
This documentation pertains to the planned implementation of driver model
in U-Boot for each subsystem, but it has not been superseded. It is
probably better to have this documentation in the source code for each
subsystem where possible, so that docbook will pick it up. Where this does
not make sense, new documentation can be placed in some suitable file in
doc/driver-model.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-03-04 12:15:30 -05:00
Simon Glass
95a260a98c dm: Enable gpio command to support driver model
Now that named GPIO banks are supported, along with a way of obtaining
the status of a GPIO (input or output), we can provide an enhanced
GPIO command for driver model. Where the driver provides its own operation
for obtaining the GPIO state, this is used, otherwise a generic version
is sufficient.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-03-04 12:15:30 -05:00
Simon Glass
e2d8a714a7 sandbox: Convert GPIOs to use driver model
Convert sandbox over to use driver model GPIOs.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-03-04 12:15:30 -05:00
Simon Glass
96495d90fe dm: Add GPIO support and tests
Add driver model support for GPIOs. Since existing GPIO drivers do not use
driver model, this feature must be enabled by CONFIG_DM_GPIO. After all
GPO drivers are converted over we can perhaps remove this config.

Tests are provided for the sandbox implementation, and are a sufficient
sanity check for basic operation.

The GPIO uclass understands the concept of named banks of GPIOs, with each
GPIO device providing a single bank. Within each bank the GPIOs are numbered
using an offset from 0 to n-1. For example a bank named 'b' with 20
offsets will provide GPIOs named b0 to b19.

Anonymous GPIO banks are also supported, and are just numbered without any
prefix.

Each time a GPIO driver is added to the uclass, the GPIOs are renumbered
accordinging, so there is always a global GPIO numbering order.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com>
Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
2014-03-04 12:15:30 -05:00
Simon Glass
39f7611fec dm: Add a demonstration/example driver
As an example of how to write a uclass and a driver, provide a demo version
of each, accessible through the 'demo' command.

To use these with driver model, define CONFIG_CMD_DEMO and CONFIG_DM_DEMO.

The two demo drivers are enabled with CONFIG_DM_DEMO_SIMPLE and
CONFIG_DM_DEMO_SHAPE.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com>
Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
2014-03-04 12:15:29 -05:00
Simon Glass
0681195977 dm: Add a 'dm' command for testing
This command is not required for driver model operation, but can be useful
for testing. It provides simple dumps of internal data structures.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com>
Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
2014-03-04 12:15:29 -05:00
Simon Glass
2e7d35d2a6 dm: Add basic tests
Add some tests of driver model functionality. Coverage includes:

- basic init
- binding of drivers to devices using platform_data
- automatic probing of devices when referenced
- availability of platform data to devices
- lifecycle from bind to probe to remove to unbind
- renumbering within a uclass when devices are probed/removed
- calling driver-defined operations
- deactivation of drivers when removed
- memory leak across creation and destruction of drivers/uclasses
- uclass init/destroy methods
- automatic probe/remove of children/parents when needed

This function is enabled for sandbox, using CONFIG_DM_TEST.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-03-04 12:15:29 -05:00
Simon Glass
1ce6017679 dm: Set up driver model after relocation
Make driver model available after relocation, by setting up data structures
and scanning for devices using compiled-in platform_data and (when available)
the device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-03-04 12:15:29 -05:00
Simon Glass
653ef91cba sandbox: config: Enable driver model
Use driver model in sandbox to permit running of driver model unit test.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-03-04 12:15:29 -05:00
Simon Glass
6494d708bf dm: Add base driver model support
Add driver model functionality for generic board.

This includes data structures and base code for registering devices and
uclasses (groups of devices with the same purpose, e.g. all I2C ports will
be in the same uclass).

The feature is enabled with CONFIG_DM.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com>
Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
2014-03-04 12:15:29 -05:00
Simon Glass
65c70539e5 dm: Add README for driver model
This adds a README to help with understanding of this series.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-03-04 12:15:29 -05:00
Simon Glass
1b451ecc43 yaffs: Remove private list implementation
U-Boot already has a list implementation, and files which include both
that and the yaffs implementation will get errors:

In file included from ydirectenv.h:80:0,
                 from yportenv.h:81,
                 from yaffs_guts.h:19,
                 from yaffs_allocator.h:19,
                 from yaffs_allocator.c:14:
yaffs_list.h:32:8: error: redefinition of ‘struct list_head’
 struct list_head {
        ^

Remove the yaffs implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-03-04 12:15:29 -05:00
Simon Glass
16ff990246 Add cmd_process_error() to report and process errors
U-Boot now uses errors defined in include/errno.h which are negative
integers. Commands which fail need to report the error and return 1
to indicate failure. Add this functionality in cmd_process_error().

For now this merely reports the error number. It would be possible
also to produce a helpful error message by storing the error strings
in U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-03-04 12:15:28 -05:00
Simon Glass
714a5621c2 sandbox: Build a device tree file for sandbox
Add support for building a device tree for sandbox's CONFIG_OF_HOSTFILE
option to make it easier to use device tree with sandbox.

This adjusts the Makefile to build a u-boot.dtb file which can be passed
to sandbox U-Boot with:

   ./u-boot -d u-boot.dtb

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-03-04 12:15:28 -05:00
Alexey Brodkin
1ace402239 sizes.h - consolidate for all architectures
Copied from Linux sources "include/linux/sizes.h" commit
413541dd66d51f791a0b169d9b9014e4f56be13c

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Tom Rini <trini@ti.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Acked-by: Tom Rini <trini@ti.com>
Acked-by: Stefan Roese <sr@denx.de>
[trini: Add bcm Kona platforms to the patch]
Signed-off-by: Tom Rini <trini@ti.com>
2014-03-04 12:15:01 -05:00
Masahiro Yamada
3d5a335cef nand_spl: display warning message to inform the end of nand_spl
Now we have two different frameworks for doing the same thing.
I'd like to propose to drop nand_spl framework.
How about deleting it before v2014.07 release?

In the interim, this commit will display a warning message
when compiling nand_spl board.

Now we have 19 nand_spl boards:

  MPC8315ERDB_NAND
  SIMPC8313_LP
  SIMPC8313_SP
  MPC8536DS_NAND
  MPC8569MDS_NAND
  MPC8572DS_NAND
  P1023RDS_NAND
  P1011RDB_NAND
  P1020RDB_NAND
  P2010RDB_NAND
  P2020RDB_NAND
  acadia_nand
  bamboo_nand
  canyonlands_nand
  glacier_nand
  haleakala_nand
  kilauea_nand
  rainier_nand
  sequoia_nand

They must be ported to SPL before the deadline,
otherwise they will be removed.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Dave Liu <daveliu@freescale.com>
Cc: Ron Madrid <info@sheldoninst.com>
Cc: Roy Zang <tie-fei.zang@freescale.com>
Cc: Stefan Roese <sr@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
2014-03-04 09:27:40 -05:00
Masahiro Yamada
dfe966329e m68k: merge compile flags -ffixed-d7 -sep-data
All arch/m68k/cpu/*/config.mk define the same flags
  PLAGFORM_REFLFLAGS += -ffixed-d7 -msep-data
Move it to arch/m68k/config.mk

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Jason Jin <Jason.jin@freescale.com>
2014-03-04 09:27:40 -05:00
Masahiro Yamada
08f11151c2 sh: merge compiler flag -ffixed-r13
-ffixed-r13 is defined commonly for sh2, sh3, sh4.
Move it to arch/sh/config.mk

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
2014-03-04 09:27:40 -05:00
Masahiro Yamada
aceba5a5cf sh: Do not define -ffreestanding twice
-ffreestanding is defined at the top Makefile for all architectures.
Do not define it twice for SH2A.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
2014-03-04 09:27:40 -05:00
Masahiro Yamada
f694183ba1 x86: Delete redundant compiler flags
-Wstrict-prototypes, -ffreestanding, -fno-stack-protector
are defined at the top Makefile for all architectures.

Do not define them twice for x86.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2014-03-04 09:27:40 -05:00
Masahiro Yamada
9c366881d7 nand_spl: simpc8313: move config.mk used only for nand_spl
board/sheldon/simpc8313/config.mk is used only for nand_spl.
So it should go into nand_spl/board/sheldon/simpc8313/.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-03-04 09:27:39 -05:00
Masahiro Yamada
2d88a6acf8 Makefile: delete unused variable LDSCRIPT_MAKEFILE_DIR
LDSCRIPT_MAKEFILE_DIR is not referenced from anywhere. Remove.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-03-04 09:27:39 -05:00
Masahiro Yamada
5718157327 config.mk: Delete unused variable BCURDIR
This variable was abolished by Kbuild series.
I forgot to delete it.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-03-04 09:27:39 -05:00
Masahiro Yamada
19233d80bc kbuild: post: fix dependency tracking correctly
$(call if_changed,...) must take FORCE as a prerequite.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-03-04 09:27:38 -05:00
Michal Simek
c9416b9292 serial: zynq: Add OF initialization support
Add console selection from DTB which is enough to have
OF driven solution.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2014-03-04 09:27:36 -05:00
Michal Simek
9e0e37accd zynq: Add OF ram initialization support
Read ram size directly from DTB.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2014-03-04 09:27:36 -05:00
Michal Simek
345d3c0f01 mmc: zynq: Add OF initialization support
Enable initialize sdhci from DTB.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2014-03-04 09:27:35 -05:00
Michal Simek
f88a6869a1 net: gem: Add OF initialization support
Gem can be directly initialized from DTB.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2014-03-04 09:27:35 -05:00
Michal Simek
7450a7f730 zynq: Do not use SPL OF initialization
Disable CONFIG_OF_CONTROL for SPL compilation.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2014-03-04 09:27:34 -05:00
Michal Simek
0c9c99a20b net: emaclite: Fix OF initialization
- Add xilinx_emaclite_of_init to netdev.h
- Remove global data pointer from the driver
- Add better handling for error state.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2014-03-04 09:27:32 -05:00
Tom Rini
eeb72e6761 Merge branch 'master' of git://git.denx.de/u-boot-arm
Conflicts:
	arch/arm/cpu/armv7/config.mk
	board/ti/am43xx/mux.c
	include/configs/am43xx_evm.h

Signed-off-by: Tom Rini <trini@ti.com>
2014-02-26 16:49:58 -05:00
Tom Rini
1551df35f2 arm: Switch to -mno-unaligned-access when supported by the compiler
When we tell the compiler to optimize for ARMv7 (and ARMv6 for that
matter) it assumes a default of SCTRL.A being cleared and unaligned
accesses being allowed and fast at the hardware level.  We set this bit
and must pass along -mno-unaligned-access so that the compiler will
still breakdown accesses and not trigger a data abort.

To better help understand the requirements of the project with respect
to unaligned memory access, the
Documentation/unaligned-memory-access.txt file has been added as
doc/README.unaligned-memory-access.txt and is taken from the v3.14-rc1
tag of the kernel.

Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Cc: Mans Rullgard <mans@mansr.com>
Signed-off-by: Tom Rini <trini@ti.com>
2014-02-26 21:19:32 +01:00
Tom Rini
f503cc49a5 checkpatch.pl: Add warning for new __packed additions
While there are valid reasons to use __packed, often the answer is that
you should be doing something else here instead.

Signed-off-by: Tom Rini <trini@ti.com>
2014-02-26 21:19:29 +01:00
Albert ARIBAUD
b60eff31f3 arm: remove unneeded symbol offsets and _TEXT_BASE
Remove the last uses of symbol offsets in ARM U-Boot.
Remove some needless uses of _TEXT_BASE.
Remove all _TEXT_BASE definitions.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2014-02-26 21:18:12 +01:00
Albert ARIBAUD
d0b5d9da5d arm: make _end compiler-generated
This prevents references to _end from generating absolute
relocation records.

This change is binary invariant for ARM targets.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2014-02-26 21:18:09 +01:00
Albert ARIBAUD
62bbc2f25a cm_t335: fix linker file to produce full ELF
Newly added cm_t335 was missed in commit 47ed5dd0 which
made ARM targets produce full ELF files. Fix its linker
script.

This change is binary-invariant when only .dynsym, .dynstr,
.dynamic, .plt, .interp and .gun sections are declared.

Sections .hash, .got.plt, .dynbss and .ARM.exidx are also
declared so that their (unused) content is moved out of the
u-boot binary.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2014-02-26 21:18:04 +01:00
Tom Rini
715b56fe2b Revert "ext4fs: Add ext4 extent cache for read operations"
This reverts commit fc0fc50f38.

The author has asked on the mailing list that we revert this for now as
it breaks write support.

Reported-by: Łukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Tom Rini <trini@ti.com>
2014-02-26 08:18:58 -05:00
Tom Rini
a7e8c15f71 Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
With this, fixup a trivial build error of get_effective_memsize needing
to be updated in the new board/freescale/p1010rdb/spl.c

Signed-off-by: Tom Rini <trini@ti.com>
2014-02-25 13:55:49 -05:00
Masahiro Yamada
4c48cfb58b arm: omap: delete unincluded omap-common/config.mk
arch/arm/cpu/armv7/omap-common/config.mk is never included
because "omap-common" is not SoC name.

If we want to add OMAP-specific compiler flags,
they must be added to omap3/config.mk, omap4/config.mk, omap5/config.mk.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Tom Rini <trini@ti.com>
2014-02-25 11:01:29 -05:00
Masahiro Yamada
4a377552f0 kbuild: Move linker sciript check to prepare1
Same as the previous commit.
Move sanity check to prepare1 target to avoid nasty troubles.

Before this commit, LDSCRIPT existence was not checked
when it was specified by CONFIG_SYS_LDSCRIPT.
Now LDSCRIPT existence is checked for all boards.

$(wildcard $(LDSCRIPT)) must point to the linker scripts
with absolute path.
Otherwise, make will terminate with a false error
on out-of-tree build.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-25 11:01:29 -05:00
Masahiro Yamada
331b45fb70 kbuild: Fix a false error of generic board support
Before this commit, make terminated with an error
where is shouldn't under some condition.

This bug happened when we built a board unsupporting
generic board right after building with generic board.

For example, the following sequence failed.
(harmony uses generic board but microblaze-generic does not
support it)

  $ make harmony_config
  Configuring for harmony board...
  $ make CROSS_COMPILE=arm-linux-gnueabi-
    [ Build succeed ]
  $ make microblaze-generic_config
  Configuring for microblaze-generic board...
  $ make CROSS_COMPILE=microblaze-linux-
  Makefile:488: *** Your architecture does not support generic board.
  Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file.  Stop.

We had to do "make clean" before building the microblaze board.

This commit fixes this unconvenience.

Move generic board sanity check to "prepare1" target,
which is run after generation of include/autoconf.mk.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-25 11:01:29 -05:00
Masahiro Yamada
0d1e8aacb8 kbuild: get back DTB at the top directory
Commit 6ab6b2af deleted ./u-boot.dtb because it was a copy
of dts/dt.dtb.

But Simon suggested to keep u-boot.dtb at the top directory
because it is a build output.

After discussions, we agreed on revival of ./u-boot.dtb.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@ti.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-02-25 11:01:29 -05:00
Masahiro Yamada
ed1ca528aa kbuild: add misc targets, help, ubootrelease, ubootversion
"help" target has been copied from Linux 3.13 and adjusted
for U-Boot.
Unlike Linux, cleaning is done on 4 levels:
clean, clobber, mrproper, distclean.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-25 11:01:29 -05:00
Masahiro Yamada
886d86e87d kbuild: support building signle targets
Import build rules of single targets from Linux 3.13.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-25 11:01:29 -05:00
Masahiro Yamada
630d23455b kbuild: refactor more IMX image rules
This commit avoids generating ./SPL twice.
  - Fist time descending to spl/
  - Second time as a prerequisite of u-boot-with-spl.imx,
    u-boot-with-nand-spl.imx.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-25 11:01:29 -05:00
Masahiro Yamada
4e0c8abcdd kbuild: use shorten logs for IMX images
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-25 11:01:29 -05:00
Masahiro Yamada
04a34c96b1 kbuild: use shorten logs for misc targets
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-25 11:01:29 -05:00
Masahiro Yamada
ad0fed46b9 kbuild: use shorten log for linking u-boot
Move sandbox-specific link rule to arch/sandbox/config.mk.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-25 11:01:29 -05:00
Masahiro Yamada
982a1199c9 kbuild: use shorten logs for combined rules of mkimage, padding and cat
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-25 11:01:29 -05:00
Masahiro Yamada
ee0acfa283 kbuild: use shorten logs for cat rules
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-25 11:01:29 -05:00