summaryrefslogtreecommitdiff
path: root/board/BuR/common/common.c
AgeCommit message (Collapse)AuthorFilesLines
2021-02-02common: Drop asm/global_data.h from common headerSimon Glass1-0/+1
Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-01-12video: omap: move drivers to 'ti' directoryDario Binacchi1-1/+1
Add drivers/video/ti/ folder and move all TI's code in this folder for better maintenance. Signed-off-by: Dario Binacchi <dariobin@libero.it>
2020-07-17treewide: convert bd_t to struct bd_info by coccinelleMasahiro Yamada1-1/+1
The Linux coding style guide (Documentation/process/coding-style.rst) clearly says: It's a **mistake** to use typedef for structures and pointers. Besides, using typedef for structures is annoying when you try to make headers self-contained. Let's say you have the following function declaration in a header: void foo(bd_t *bd); This is not self-contained since bd_t is not defined. To tell the compiler what 'bd_t' is, you need to include <asm/u-boot.h> #include <asm/u-boot.h> void foo(bd_t *bd); Then, the include direcective pulls in more bloat needlessly. If you use 'struct bd_info' instead, it is enough to put a forward declaration as follows: struct bd_info; void foo(struct bd_info *bd); Right, typedef'ing bd_t is a mistake. I used coccinelle to generate this commit. The semantic patch that makes this change is as follows: <smpl> @@ typedef bd_t; @@ -bd_t +struct bd_info </smpl> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-19common: Drop linux/delay.h from common headerSimon Glass1-0/+1
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19common: Drop log.h from common headerSimon Glass1-0/+1
Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-03-03board: brxre1: fix building errorsDario Binacchi1-1/+1
Fix building errors if CONFIG_DM_VIDEO is enabled. This is the only u-boot board that enables CONFIG_AM335X_LCD and from which I started to develop the version of the frame buffer driver that supports the driver model. Signed-off-by: Dario Binacchi <dariobin@libero.it>
2019-08-11env: Move env_set_hex() to env.hSimon Glass1-0/+1
Move env_set_hex() over to the new header file along with env_set_addr() which uses it. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-04-27board/BuR/common: add 'brdefaulip_setup' functionHannes Schmelzer1-0/+34
Many B&R boards are equipped with an I2C-EEPROM where various information can be stored. Today there is only a single byte for 'board_id' used. We write this 'board_id' into environment for later use during boot. If the value != 0xFF, meaning the byte is programmed, we modify the "brdefaultip" environment variable for setting an IP-Address based on board_id. Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
2019-04-27board/BuR/common: cosmetic: move 'overwrite_console' up to more related stuffHannes Schmelzer1-4/+5
Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
2019-04-27board/BuR/common: prepare for compiling common into non AM33XX boardsHannes Schmelzer1-16/+14
Today the BuR common stuff is only used on AM33XX boards. In future we plan to have many other platforms than AM33XX so we have to move arch- specific #include(s) to responsible #ifdef sections. By the way we drop unneeded #include(s). Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
2019-02-19board/BuR/brxre1: convert do DMHannes Schmelzer1-0/+7
This commit converts the brxre1 board to DM, for this we have todo following things: - add a devicetree-file for this board - drop all obsolete settings from board header-file - use dm_i2c_xxx calls for read/write to the resetcontroller - request gpios before operate them Serues-cc: trini@konsulko.com Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
2019-02-09board/BuR/brppt1: drop DM_I2C_COMPATHannes Schmelzer1-3/+4
The TPS62517 PMIC driver has been partially converted to DM, so the legacy I2C access layer isn't needed anymore. Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
2018-07-20board/BuR/brppt1: convert brppt1 boards to driver modelHannes Schmelzer1-98/+3
- add a devicetree for each variant (mmc, spi, nand) - drop unneeded code from board and bur/common - drop unneeded stuff from config header files - minor adaptions to be compliant with driver model (requesting gpio,..) - harmonize the commandset over all brppt1 targets Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
2018-07-20board/BuR/common: refactor ft_board_setup(...)Hannes Schmelzer1-5/+10
On other OS, not one provided by B&R, it is not guaranteed that there are factory-settings within a devicetree. So we must not treat the absence of them as error. Further we've the fact that on different version of the device-tree files there are different namings of the factory-settings, we consider this with searching for an alternative name. changing things as following: - don't treat as error if the bootloader version cannot written into devicetree. - since the naming of the factory-settings are different in different versions of the provided device-tree we search for the alternate name "/fset" Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
2018-07-20board/BuR/common: fix PMIC mpu-pll setupHannes Schmelzer1-1/+1
If a board-code calls the pmicsetup(u32 mpupll) with a mpupll value != 0 it wants to force some frequency with the value provided by mpupll. Setting up 1 GHz is wrong here. Nobody did take notice about that yet, since every board calls this function with zero. Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
2018-07-20board/BuR/common: remove interface Label from summary screenHannes Schmelzer1-2/+2
This interface names may vary over different products, to consider this fact we replace the interface label "IF1" and "IF2" on the summary screen with some more generic wording "MAC1" and "MAC2". Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
2018-07-20board/BuR/common: make CONFIG_LCD optionalHannes Schmelzer1-21/+18
Since we're going to drop LCD-support on brppt1 boards, we have to make this stuff here optional and remove the #error path. We also move out the ft_board_setup(...) from this #ifdef because there's no relationship with the LCD-code and on the other hand this is still needed in future even with LCD-support off. Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
2018-07-20board/BuR/common: drop simple-framebuffer setupHannes Schmelzer1-26/+0
The linux systems running on the brppt1 targets are using modern DRM drivers since long time ago. Further we are going to drop the LCD support completely on this board, so the simple-framebuffer setup becomes obsolete. Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
2018-07-20board/BuR: drop devicetree loading and lcd setup for linux-targetsHannes Schmelzer1-224/+6
This patch drops the lcd-screen setup, the summary screen and getting mac-addresses based on a previous loaded device-tree for linux targets. Selecting those linux target is simple, since we have only the brppt1. In detail we do: - drop the common lcd-setup code which relys on a fdt_blob - drop the common dtb loading mechanism - drop the now obsolete CONFIG_USE_FDT from board header and whitelist. Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini1-2/+1
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-09net: Move enetaddr env access code to env config instead of net configAlex Kiernan1-0/+1
In order that we can use eth_env_* even when CONFIG_NET isn't set, move these functions to environment code from net code. This fixes failures such as: board/ti/am335x/built-in.o: In function `board_late_init': board/ti/am335x/board.c:752: undefined reference to `eth_env_set_enetaddr' u-boot/board/ti/am335x/board.c:766: undefined reference to `eth_env_set_enetaddr' which caters for use cases such as: commit f411b5cca48f ("board: am335x: Always set eth/eth1addr environment variable") when Ethernet is required in Linux, but not U-Boot. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-01-11board/BuR: provide real clock-frequency instead a dividerHannes Schmelzer1-10/+4
Actual am335x-fb implementation takes now a real clock frequency instead a divider. So this component doesn't need to know anymore some base frequency of the LCDC, we simply provide the pixel-clock frequency. Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2017-08-16env: Rename getenv_hex(), getenv_yesno(), getenv_ulong()Simon Glass1-20/+20
We are now using an env_ prefix for environment functions. Rename these for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename getenv/_f() to env_get()Simon Glass1-6/+6
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename eth_setenv_enetaddr() to eth_env_set_enetaddr()Simon Glass1-1/+1
Rename this function for consistency with env_set(). Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename setenv() to env_set()Simon Glass1-1/+1
We are now using an env_ prefix for environment functions. Rename setenv() for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-12board: BuR: use get_nand_dev_by_index()Grygorii Strashko1-1/+2
As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Reviewed-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-06-16board/BuR/brxre1: fix MMC bootHannes Schmelzer1-1/+6
since commit 'd5abcf94c7123167725fc22ace342f0d455093c1' - ti: boot: Register the MMC controllers in SPL in the same way as in u-boot MMC boot on brxre1 board is broken, with this commit we make our board working again. Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2017-05-15mmc: replace CONFIG_GENERIC_MMC with CONFIG_MMCMasahiro Yamada1-1/+1
Now CONFIG_GENERIC_MMC and CONFIG_MMC match for all defconfig. We do not need two options for the same feature. Deprecate the former. This commit was generated with the sed script 's/GENERIC_MMC/MMC/' and manual fixup of drivers/mmc/Kconfig. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-05-05board/BuR/common: incorrect check of dtbxypron.glpk@gmx.de1-3/+3
The logical expression to check the dtb is incorrect in load_devicetree. The problem was indicated by cppcheck. The inconsistent variable name dtppart is changed to dtbpart. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Hannes Schmelzer <oe5hpm@oevsv.at> Acked-by: Hannes Schmelzer <oe5hpm@oevsv.at>
2017-03-20ti: boot: Register the MMC controllers in SPL in the same way as in u-bootJean-Jacques Hiblot1-1/+1
To keep a consistent MMC device mapping in SPL and in u-boot, let's register the MMC controllers the same way in u-boot and in the SPL. In terms of boot time, it doesn't hurt to register more controllers than needed because the MMC device is initialized only prior being accessed for the first time. Having the same device mapping in SPL and u-boot allows us to use the environment in SPL whatever the MMC boot device. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2016-06-04nand: Embed mtd_info in struct nand_chipScott Wood1-1/+1
nand_info[] is now an array of pointers, with the actual mtd_info instance embedded in struct nand_chip. This is in preparation for syncing the NAND code with Linux 4.6, which makes the same change to struct nand_chip. It's in a separate commit due to the large amount of changes required to accommodate the change to nand_info[]. Signed-off-by: Scott Wood <oss@buserror.net>
2016-02-25board/BuR: drop ETH-support in SPL-StageHannes Schmelzer1-7/+2
During very early prototype-phase we did boot the AM335x boards initially from CPSW-EMAC. Now we don't need this feature anymore. So we drop it to save MLO-space and having therefore a more quickly boot. Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at> Reviewed-by: Tom Rini <trini@konsulko.com>
2015-06-18board/BuR/common: support timer5 for pwm-backlightHannes Petermaier1-3/+11
in future we support yet another b&r am335x based board, where Timer 5 is wired to backlight-driver. So we introduce a new driver-type '2' to setup timer5 instead timer6. Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-05-28cosmetic: change Author/MAINTAINER Name from Petermaier to SchmelzerHannes Schmelzer1-1/+1
Since i've been married, i also have a new surname. Mr. Petermaier moved to Mr. Schmelzer. In this patch i update all files in which my (old) name is present. Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com> Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
2015-05-09board/BuR/tseries: Add simplefb supportHannes Petermaier1-48/+86
Since the used AM3352 SoC doesn't have GPU it isn't allways necessary to build in complete drm-stuff into linux kernel. In very small applications only we use the simple-framebuffer. So we have 2 use-cases: - device operating on drm-driver (let simplefb node disabled) - device operating on simplefb-driver (activate simplefb node and reserve mem) The decision is made by means of "simplefb" environment variable. simplefb = 0 we don't enable the (maybe) existing simplefb node and all the rest around display is up to the linux-kernel. We just disable the backlight, beceause we do not want see the flicker during take over of drm-driver. simplefb = 1 we enable the (maybe) existing simplefb node and reserve framebuffers size in memory. Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
2015-05-09board/BuR/tseries: take usage of CONFIG_LCD_ROTATIONHannes Petermaier1-0/+23
We take use of the new LCD_ROTATION feature. The information about how the display is rotated is taken from B&R specific (/factory-settings/rotation) information in the devicetree. The information there is stored as string (cw, ud, ccw, none) since starting support of this devices and cannot be changed, so we have to convert it into none = 0 cw = 1 ud = 2 ccw = 3 Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
2015-04-23board/BuR/tseries: reactivate NAND-boardHannes Petermaier1-4/+11
The NAND-version has been become a bit orphan. Now we need to reactivate it, so bring necessary things: - loading devicetree - switch control signal to correct pins - setup pinmux - default-environment up to date. Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
2015-04-23board/BuR/common: simplify access to devicetreeHannes Petermaier1-59/+55
instead of polling everytime the environment, we take usage of the global gd->fdt_blob variable and check it only against NULL. Variable "dtbaddr" from environment is needed only one time on loading the devicetree within "load_devicetree()" Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
2015-04-18net: cosmetic: Name ethaddr variables consistentlyJoe Hershberger1-2/+2
Use "_ethaddr" at the end of variables and drop CamelCase. Make constant values actually 'const'. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-03-28board/BuR/common: remove unused function 'blink'Hannes Petermaier1-14/+0
since we have possibility to write out on lcd whats going on, we don't need the gpio blink functionality anymore. Signed-off-by: Hannes Petermaier <hannes.petermaier@br-automation.com> Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
2015-03-28board/BuR/common: move I2C initialization from common part to board-specificHannes Petermaier1-4/+0
At this time I2C and responsible pin-mux is setup during PMIC initialziation within common.c, this is possible because today PMIC is always connected on I2C0. In Future this will be changed, PMIC isn't anymore connected to bus0 in call cases. So we do following: - rename enable_i2c_pin_mux0 to enable_i2c_pin_mux to be generic for enabling pin-mux on different or more busses. - move the call to i2c_pin_mux and i2c_init from common.c to the specific board.c Signed-off-by: Hannes Petermaier <hannes.petermaier@br-automation.com> Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
2015-03-17board/BuR/common: use SYS_CONSOLE_OVERWRITEHannes Petermaier1-0/+4
We don't want that CONSOLE is redirected to LCD upon init, we rather prefer that console is still on the serial line. Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
2015-03-06board/BuR/common: try to setup cpsw mac-address from the devicetreeHannes Petermaier1-10/+15
since we have a dtb blob programmed on the board we try to setup the cpsw interface with the programmed mac. If this method fails, we fall back to the device-fuses. Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
2015-03-06board/BuR/common: Take usage of am335x LCD-DisplayHannes Petermaier1-1/+416
a summary screen to the lcd. Values are taken from environment and or devicetree blob. Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
2014-05-23Add board_mmc_init(...) function for init mmc1 onlyHannes Petermaier1-0/+7
Since B&R boards uses only MMC-Controller #1, it only wastes time if we initialize #0 first to see that there is nothing. Cc: <trini@ti.com> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
2014-03-06board/BuR/common: fix phy addressesHannes Petermaier1-2/+2
B&R boards are using Phy Addresses 'one' and 'two', prior this was defined through #define PHYADDR 1 within a header file. Now this is addresses are given with device-driver structure. Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
2014-03-04drivers: net: cpsw: add support to have phy address from cpsw platform dataMugunthan V N1-2/+2
Some platforms like AM437x have different EVMs with different phy addresses, so this patch adds support for passing phy address via cpsw plaform data. Also renamed phy_id to phy_addr so better understanding of the code. Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> [trini: Update BuR am335x_igep0033 pcm051_rev3 pcm051_rev1 cm_t335 pengwyn boards] Signed-off-by: Tom Rini <trini@ti.com>
2014-02-21board: Add support for B&R T-Series MotherboardHannes Petermaier1-0/+216
Adds support for Bernecker & Rainer Industrieelektronik GmbH T-Series Motherboard, using TI's AM3352 SoC. Most of code is derived from TI's AM335x_EVM Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>