u-boot/include/linux
Masahiro Yamada b44b30260f printk: collect printk stuff into <linux/printk.h> with loglevel support
When we import code from Linux, with regular re-sync planned, we want
to use printk() and pr_*().  U-Boot does not support them in a clean
way.  So, people end up with local macros, or compat headers here and
there, then we occasionally see build errors of definition conflicts.

We have include/linux/compat.h, but putting all sorts of unrelated
things into a single header is just a temporal workaround.  Hence this
patch, to find the best home for all printk variants.  If you want to
use printk() and friends, please include <linux/printk.h>.  This header
is self-contained, and pulls in only a few headers.

When I was testing this clean-up, I noticed the image size exceeded
its platform limit on some boards.  This is because all pr_*() that
were previously defined as no-op in include/linux/mtd/mtd.h (unless
CONFIG_MTD_DEBUG is set), are now enabled.

To make such boards happy, this commit also implements CONFIG_LOGLEVEL.
The concept is similar to the kernel parameter "loglevel".  (Actually,
the Kconfig help message was taken from kernel-paremeter.txt of Linux)
Messages with a loglevel smaller than console loglevel will be printed.

The difference is the loglevel is build-time determined.  To save the
image size, lower priority pr_*() are compiled out.  I set the default
of CONFIG_LOGLEVEL to 6, i.e. pr_notice and higher priority messages
are compiled in.

I adjusted CONFIG_LOGLEVEL to avoid build error for some boards.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[trini: Add in SPL_LOGLEVEL that is the same as LOGLEVEL]
Signed-off-by: Tom Rini <trini@konsulko.com>
2017-10-04 10:31:17 -04:00
..
byteorder
mtd printk: collect printk stuff into <linux/printk.h> with loglevel support 2017-10-04 10:31:17 -04:00
unaligned
usb usb: xhci: Honor endpoint's interval 2017-10-01 16:32:54 +02:00
apm_bios.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
arm-smccc.h ARM: adjust arm-smccc code for use in U-Boot 2017-04-18 10:29:17 -04:00
bch.h Add more SPDX-License-Identifier tags 2016-01-19 08:31:21 -05:00
bitops.h bitops.h: Include bitsperlong.h as needed for GENMASK_ULL 2017-03-29 07:39:32 +02:00
bitrev.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
bug.h bug.h: move BUILD_BUG_* defines to include/linux/bug.h 2016-01-25 10:39:59 -05:00
compat.h printk: collect printk stuff into <linux/printk.h> with loglevel support 2017-10-04 10:31:17 -04:00
compiler-clang.h compiler*.h: sync include/linux/compiler*.h with Linux 3.16 2014-09-16 12:23:57 -04:00
compiler-gcc.h compiler*.h: sync include/linux/compiler*.h with Linux 4.5-rc6 2016-02-29 11:43:24 -05:00
compiler-intel.h compiler*.h: sync include/linux/compiler*.h with Linux 4.5-rc6 2016-02-29 11:43:24 -05:00
compiler.h compiler*.h: sync include/linux/compiler*.h with Linux 4.5-rc6 2016-02-29 11:43:24 -05:00
crc7.h
crc8.h lib/crc8: Add crc start value 2016-04-11 20:48:26 -04:00
crc32.h
ctype.h
delay.h delay: collect {m, n, u}delay declarations to include/linux/delay.h 2017-01-14 16:46:28 -05:00
dma-direction.h dma: import linux/dma-direction.h to consolidate enum dma_data_direction 2017-09-12 18:02:23 -04:00
drm_dp_helper.h tegra124: video: Add full link training for eDP 2015-05-13 09:24:12 -07:00
edd.h Add more SPDX-License-Identifier tags 2016-01-19 08:31:21 -05:00
err.h sf: Adopt flash table INFO macro from Linux 2016-11-18 13:04:52 +05:30
errno.h errno.h: sync error macros with linux 4.8-rc7 2016-09-23 22:25:43 -04:00
ethtool.h add support for Xilinx 1000BASE-X phy (GTX) 2013-06-24 19:11:13 -05:00
fb.h avr32: Retire AVR32 for good 2017-07-06 16:17:19 -04:00
immap_qe.h armv7: ls1021a: Drop macro CONFIG_LS102XA 2017-04-17 09:03:30 -07:00
input.h Add more SPDX-License-Identifier tags 2016-01-19 08:31:21 -05:00
io.h linux/io.h: import generic ioread* / iowrite* accessors from Linux 2017-09-12 18:02:23 -04:00
ioctl.h
iopoll.h iopoll: import include/linux/iopoll.h from Linux 4.9 2017-01-14 16:46:30 -05:00
ioport.h
kbuild.h clang: workaround for generated constants 2014-09-09 13:51:54 +02:00
kconfig.h spl: dm: use CONFIG_IS_ENABLED to test for the DM option 2017-08-13 17:12:20 +02:00
kernel.h Fix SIZE_MAX compiler warning when using stdint.h 2014-11-25 06:33:58 -07:00
linkage.h Use correct spelling of "U-Boot" 2016-02-06 12:00:59 +01:00
linux_string.h Make linux kernel string funcs available to tools 2012-12-13 11:46:07 -07:00
list.h list: Add list_last_entry() to find the last entry 2016-10-11 11:55:33 +08:00
list_sort.h lib, list_sort: add list_sort from linux 3.14 2014-08-25 17:02:33 -04:00
log2.h include: Add log2 header from the kernel 2015-11-05 10:51:53 -05:00
lzo.h
math64.h lib: div64: sync with Linux 2017-04-13 09:41:10 -04:00
mbus.h arm: mvebu: Add common mbus functions to use on Marvell SoCs 2014-10-23 09:59:20 -04:00
mc146818rtc.h
mdio.h
mii.h net: Add mii_resolve_flowctrl_fdx() 2017-08-14 12:47:32 -05:00
netdevice.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
poison.h
posix_types.h
printk.h printk: collect printk stuff into <linux/printk.h> with loglevel support 2017-10-04 10:31:17 -04:00
psci.h sysreset: psci: support system reset in a generic way with PSCI 2017-04-18 10:29:19 -04:00
rbtree.h kbuild: force to define __UBOOT__ in all the C sources 2014-09-16 12:23:56 -04:00
rbtree_augmented.h lib, rbtree: resync with Linux-3.14 2014-08-25 17:02:33 -04:00
screen_info.h
serial_reg.h arm: debug: replace license blocks with SPDX 2014-10-26 22:22:09 +01:00
sizes.h sizes.h - consolidate for all architectures 2014-03-04 12:15:01 -05:00
stat.h avr32: Retire AVR32 for good 2017-07-06 16:17:19 -04:00
stddef.h
string.h string: Add strcspn() 2017-06-01 07:03:12 -06:00
stringify.h
time.h
typecheck.h typecheck: import include/linux/typecheck.h from Linux 4.9 2017-01-14 16:46:29 -05:00
types.h types.h: move and redefine resource_size_t 2016-07-14 18:22:24 -04:00