summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Release v2019.09.0v2019.09.0Sascha Hauer2019-09-091-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* eeprom: at24: Select NVMEM as a dependencyAndrey Smirnov2019-09-091-0/+1
| | | | | | | | NVMEM subsystem is now a mandatory dependecy for EEPROM_AT24. Fixes: 815e7140de ("eeprom: at24: Convert the driver to NVMEM") Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* images/.gitignore: ignore i.MX8MQ HAB filesRouven Czerwinski2019-08-281-0/+4
| | | | | | | | Ignore the new image files with .pimximg and .psimximg extensions and the sha256 sum files. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: nxp-imx8mq-evk: Update commentsSascha Hauer2019-08-231-5/+4
| | | | | | | | The comments mention contents of register r0, this is outdated. We base our decisions on the current EL. Update the comments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
* ARM: i.MX8: Fix piggydata loadingSascha Hauer2019-08-231-8/+13
| | | | | | | | | | We are running at MX8MQ_ATF_BL33_BASE_ADDR now, so we can't use this as a temporary buffer. Add 32MiB to that address and use this instead. Also copy the piggydata to the place where we expect it later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
* ARM: nxp-imx8mq-evk: Replace trampolineSascha Hauer2019-08-233-33/+6
| | | | | | | | | | | | | | When the TF-A finishes it jumps to a hardcoded address in DRAM. We used to put a trampoline there which brings us back to our image in SRAM. Instead of putting a trampoline into DRAM just copy the image there which simplifies things a bit. Note that currently imx8_esdhc_load_piggy() uses that very same address as a temporary buffer. This is changed in the next patch. Currently the board is broken anyway, so we don't break bisectability. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
* ARM: nxp-imx8mq-evk: Remove duplicate call to imx8mq_cpu_lowlevel_init()Sascha Hauer2019-08-231-2/+0
| | | | | | | imx8mq_cpu_lowlevel_init() is called twice. Remove the second call. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
* ARM: i.MX: imx8-ddrc: Remove debug codeSascha Hauer2019-08-231-18/+2
| | | | | | | | | various puthex_ll() printed values without any context are not helpful when debugging unrelated stuff, so remove them. When they are really needed they should be added with proper pr_debug() statements. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
* pbl: Move piggy verification into pbl_barebox_uncompress()Sascha Hauer2019-08-233-27/+27
| | | | | | | | piggy verification is a direct prerequisite of uncompressing the piggydata, so move the verification there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
* ARM: aarch64: Fix get_runtime_offset after relocationSascha Hauer2019-08-231-15/+9
| | | | | | | | | | | | | | | | | | | | | | | get_runtime_offset shall return the offset between the address we are running at and the address we are linked at. This value obviously changes when we relocate the binary. cf3b09737b tried to avoid using R_AARCH64_RELATIVE relocations, but in fact this is exactly what the function needs to work. Consider barebox starting at 0x10000000 when we are linked at 0x0 then get_runtime_offset() should return 0x10000000 before relocate_to_current_adr(), but afterwards it should return 0x0. This patch brings back the previously removed "a" flag. Since gcc5 doesn't put the values of R_AARCH64_RELATIVE fixup'd relocations into the binary but zeroes instead, we help ourselves by basing get_runtime_offset on an address which actually is zero. With CONFIG_RELOCATABLE=y the binary is always linked to 0x0, so _text is initially zero. Tested with gcc-5.4.0 (which was "fixed" by cf3b09737b) and gcc-8.2.1. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
* ARM: aarch64: Fixup relocation table for the second relocationSascha Hauer2019-08-231-0/+2
| | | | | | | | In case we want to relocate the binary multiple times we have to adjust the relocation table itself for any further relocations. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
* startup: Register autoboot variables earlierLadislav Michl2019-08-231-7/+11
| | | | | | | | | | | Autoboot is controlled by autoboot_timeout and autoboot_abort_key variables which might be altered by init scripts, so we need to register them before those scripts are run. Otherwise they are set back to defaultenv values upon registration. Fixes: 35266d7e583f ("startup: Factor out the autoboot counter...") Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Makefile: we are on 2019.08Sascha Hauer2019-08-211-1/+1
| | | | | | | I forgot to increase the version in the Makefile for the last release. Increase the version now. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/stm32'Sascha Hauer2019-08-1514-6/+506
|\
| * Documentation: boards: add initial STM32MP documentationAhmad Fatoum2019-08-051-0/+71
| | | | | | | | | | | | | | | | Support for the SoC is still in progress, but lets document what we have now. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: stm32mp: generate STM32 imagesAhmad Fatoum2019-07-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Both STM32MP BootROM and TF-A first stage expect subsequent bootloader stages to feature a specific STM32 file header. Generate this image type by default. If for some reason, the image without stm32 header is required, the start_stm32mp157c_dk2.pblb can be used. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * filetype: add STM32 image typeAhmad Fatoum2019-07-152-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Both STM32MP BootROM and TF-A first stage expect subsequent bootloader stages to feature a specific 256-byte long STM32 file header. Add detection of the header to file_detect_type(). While there's only one version of the header so far, identify the new header as v1 anyway, so new versions can be unambiguously added. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * images: add support for generating STM32MP imagesMarco Felsch2019-07-154-0/+293
| | | | | | | | | | | | | | | | | | | | Both STM32MP BootROM and TF-A first stage expect subsequent bootloader stages to feature a specific STM32 file header. Add a stm32image utility to address this. Signed-off-by: Marco Felsch <marco.felsch@gmail.com> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: stm32mp: fix some misnomers/typosAhmad Fatoum2019-07-153-4/+4
| | | | | | | | | | | | | | | | | | The arch was renamed to stm32mp, so it doesn't look out of place when the stm32mp2 is released. Fix spotted comments/labels with the old name. While at it, fix a typo about the SoC name on the DK2 board. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * reset: add reset controller driver for STM32 RCCAhmad Fatoum2019-07-153-0/+115
| | | | | | | | | | | | | | | | | | On the STM32MP, reset of the I2C, SPI and USB IPs occurs over the RCC. This driver adds support for the controller, so it may be reused by other drivers. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: dts: stm32mp157c: correct gpioz idAhmad Fatoum2019-07-151-1/+1
| | | | | | | | | | | | | | | | | | The pinctrl-stm32 driver uses the alias id to infer the index of the first GPIO supported by a controller. Because gpioz' identifiers start at ('Z' - 'A') * 0x10, change the id to 25. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: stm32mp: set CONFIG_ARCH_NR_GPIO = (26 * 16)Ahmad Fatoum2019-07-151-0/+4
| | | | | | | | | | | | | | | | | | The STM32MP1 GPIO bindings uses the range [400; 415] for the gpioz controller, which exceeds the barebox-wide ARCH_NR_GPIOS of 256. Therefore have the stm32mp define a subarch-specific max of 416. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * gpio: allow for arch-specific ARCH_NR_GPIOS > 256Ahmad Fatoum2019-07-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some architectures have non-contiguous GPIO ranges where some GPIOs can have identifiers exceeding the hardcoded ARCH_NR_GPIOs of 256. One such example is the STM32MP, whose gpioz controller has identifiers that go up to ('Z' - 'A' + 1) * 0x10 - 1 = 415. Instead of increasing the array size for all architectures or doing some sort of packing, allow architecture to define their own overriding CONFIG_ARCH_NR_GPIO like the kernel does. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mtd-gpmi-nand'Sascha Hauer2019-08-155-128/+196
|\ \
| * | mtd: nand-mxs: Make ecc strength configurable via device treeSascha Hauer2019-08-061-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the binding doc the mxs NAND driver supports the "nand-ecc-strength" and "nand-ecc-step-size" options. This adds support for these options to the driver. The "nand-ecc-step-size" is not really configurable, the only accepted value is 512 so this is merely to sanity check that there's nothing specified that we can't yet support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: Add function to parse device tree propertiesSascha Hauer2019-08-062-0/+29
| | | | | | | | | | | | | | | | | | | | | This adds nand_of_parse_node() which can be used to parse generic NAND device properties. Not very complete yet, but it's a start. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand-mxs: inline only once used functionSascha Hauer2019-08-061-6/+1
| | | | | | | | | | | | | | | | | | | | | mxs_nand_ecc_size_in_bits() is used only once and is simple enough to be inlined. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand-mxs: pass mtd_info to mxs_nand_get_mark_offset()Sascha Hauer2019-08-061-6/+5
| | | | | | | | | | | | | | | | | | | | | struct mtd_info * contains everything mxs_nand_get_mark_offset() needs, so pass this pointer rather than several integer arguments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand-mxs: change API between NAND driver and fcb codeSascha Hauer2019-08-063-39/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The imx-bbu-nand-fcb update handler code calls into the NAND driver to get the ecc strength and bad block marker position. Change the API so that only a single function is necessary and not three functions. Also in future the ecc strength will be configurable via device tree. This means static parameters like page size / oob size are no longer enough to calculate the ecc strength and so we store a pointer to our mtd_info struct in a static global variable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand-mxs: Make locally used variable staticSascha Hauer2019-08-061-3/+1
| | | | | | | | | | | | | | | | | | | | | fake_ecc_layout is only used in the mxs nand driver, so make it static. Also it's not necessary to zero the structure. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand-mxs: calculate ecc_strength only onceSascha Hauer2019-08-061-12/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of calculating the ecc strength multiple times with each page read just do it once and store the result in chip->ecc.strength. While at it also store the correct value in chip->ecc.bytes instead of writing a bogus value into it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand-mxs: consistently rename struct nand_chip * to "chip"Sascha Hauer2019-08-061-74/+74
| | | | | | | | | | | | | | | | | | | | | The struct nand_chip * is sometimes named "nand" and sometimes "chip". For consistency name it "chip" throughout the driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/mtd'Sascha Hauer2019-08-1511-30/+91
|\ \ \
| * | | mtd: spi-nor: fix page offset/remains calculation in spi_nor_writeBastian Krause2019-08-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nor->write() simply adds the number of written bytes to the pointer given. Thus retval is incremented in each loop cycle for each spi_nor_write() call without ever resetting it. This leads to wrong page offset/remains calculations and an incorrect number of bytes written to retlen. This becomes apparant only if the calling function actually compares len and retlen (e.g. mtd_peb_write() ). Otherwise wrong data is written: $ memcpy -s /dev/prng -d prng_data 0 0 10k $ erase /dev/mtd0.mypart $ cp prng_data /dev/mtd0.mypart $ memcmp -s prng_data -d /dev/mtd0.mypart 0 0 memcmp returned "files differ" before, with this patch it returns "OK". Fixes: c8516869c4 ("spi: Extend the core to ease integration of SPI memory controllers") Signed-off-by: Bastian Krause <bst@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: nand: Add ecc parameters as device parametersSascha Hauer2019-07-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The ecc strength/bytes/size values are useful informations sometimes, add them as device parameters. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | UBI: silence erroneous GCC warning about uninitialized readAhmad Fatoum2019-07-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC reports following use of an uninitialized variable: ./drivers/mtd/ubi/eba.c: In function 'try_write_vid_and_data': ./drivers/mtd/ubi/eba.c:904:9: warning: 'opnum' may be used uninitialized in this function [-Wmaybe-uninitialized] err = ubi_wl_put_peb(ubi, vol_id, lnum, opnum, 0); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is incorrect, because it's only called when err == 0 and opnum is always initialized if err == 0. Silence the warning by initializing a variable. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ubiformat: Fix wrong error testsSascha Hauer2019-07-161-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several tests in ubiformat test for a positive error code where a negative error code is returned from the called functions. This is because the original code used tested against errno which is a positive value. One place still tests against errno, but the test should be against the return value from the last function call. Fix that aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ubiformat: handle write errors correctlySascha Hauer2019-07-161-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a barebox adoption of mtd-utils commit d9cbf6a ("ubiformat: handle write errors correctly"): | ubiformat: handle write errors correctly | | This issue was reported and analyzed by | Anton Olofsson <anol.martinsson@gmail.com>: | | when ubiformat encounters a write error while flashing the UBI image (which may | come from a file of from stdout), it correctly marks the faulty eraseblock as | bad and skips it. However, it also incorrectly drops the data buffer which was | supposed to be written, and reads next block of data. | | This patch fixes this issue - in case of a write error, we preserve the current | data and write it to the next eraseblock, instead of dropping it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: peb: Do not mark as bad in mtd_peb_torture()Sascha Hauer2019-07-164-12/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both the Kernel and mtd-utils have peb torture functions and both do not mark the block as bad automatically. Instead, the caller must mark the block as bad when -EIO is returned from the torture function. Do the same in barebox. This is necessary as the UBI code otherwise may mark a block as bad twice: Once indirectly in mtd_peb_torture() and then directly afterwards. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: ubi: mark PEBs as bad on erase failureSascha Hauer2019-07-153-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 70542a9c65 converted UBI to use mtd_peb_torture(). It was assumed that a block was marked as bad when it didn't pass the torture test. However, not all possibly bad blocks went through the torture test, so it could happen that a block that could not be erased was still kept as good block. This patch fixes this and explicitly calls ubi_io_mark_bad() when a block cannot be erased. Fixes: 70542a9c65 ("mtd: ubi: Use mtd_peb_torture") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ubiformat: improve generation of UBI image sequenceSascha Hauer2019-07-152-3/+4
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The UBI ec_hdr has an image_seq field. During attaching UBI expects that its value is the same for all eraseblocks. The value should be changed with every ubiformat and is used to detect half written images. In barebox we use a pseudo random number generated with rand() for this value. The ubiformat command calls srand(get_time_ns()) to initialize the pseudo random numbber generator. This is done in the option parser, so when ubiformat() is called directly (from fastboot for example) the pseudo random number generator is not initialized and we get the same values after every barebox restart. This patch moves the pseudo random number generator initialization to the place where the numbers are generated. Also use random32() rather than rand() to generate 32bit values rather than 15bit values (0 - RAND_MAX). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2019-08-1521-131/+109
|\ \ \
| * | | eeprom: at24: Convert the driver to NVMEMAndrey Smirnov2019-08-141-21/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert AT24 driver to use NVMEM subsystem instead of explicitly creating a dedicated cdev. This way it becomes possible to access the contenst of EEPROM via NVMEM API, which could be usefull for things like MAC-addresses and such. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | eeprom: at24: Drop at24_cdev_protect()Andrey Smirnov2019-08-141-20/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of exposing a dedictaed .protect() callback, mimic the behaviour of corresponding driver in Linux and adjust the value of WP pin in .write() callback as necessary. This is done in order to convert this driver to NVMEM subsytem. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | nvmem: Parse partitions informationAndrey Smirnov2019-08-141-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add code to parse partition information that might be specified as a part of the DT config. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | nvmem: Use already existing dev pointer in nvmem_register_cdev()Andrey Smirnov2019-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There's already a struct device_d * pointer variable. Use it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | nvmem: Use helper variable in nvmem_register_cdev()Andrey Smirnov2019-08-141-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add struct cdev * helper variable to nvmem_register_cdev() in order to avoid repeating &nvmem->cdev a bunch of times Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | kbuild: use -fmacro-prefix-map to make __FILE__ a relative pathMasahiro Yamada2019-08-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux commit a73619a845d5625079cc1b3b820f44c899618388 The __FILE__ macro is used everywhere in the kernel to locate the file printing the log message, such as WARN_ON(), etc. If the kernel is built out of tree, this can be a long absolute path, like this: WARNING: CPU: 1 PID: 1 at /path/to/build/directory/arch/arm64/kernel/foo.c:... This is because Kbuild runs in the objtree instead of the srctree, then __FILE__ is expanded to a file path prefixed with $(srctree)/. Commit 9da0763bdd82 ("kbuild: Use relative path when building in a subdir of the source tree") improved this to some extent; $(srctree) becomes ".." if the objtree is a child of the srctree. For other cases of out-of-tree build, __FILE__ is still the absolute path. It also means the kernel image depends on where it was built. A brand-new option from GCC, -fmacro-prefix-map, solves this problem. If your compiler supports it, __FILE__ is the relative path from the srctree regardless of O= option. This provides more readable log and more reproducible builds. Please note __FILE__ is always an absolute path for external modules. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mips: use generic bitsperlong.hMasahiro Yamada2019-08-121-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux highly depends on the fact that the 'long' and the pointer have the same width, and so does barebox. So, we can always use include/asm-generic/bitsperlong.h, which determines BITS_PER_LONG depending on CONFIG_64BIT. This is what Linux does (at least in the kernel-space), and barebox can follow it. It is true that MIPS Linux references _MIPS_SZLONG (arch/mips/include/uaspi/asm/bitsperlong.h), but this is bacause the user-space cannot reference CONFIG options. For the kernel-space, it uses the generic definition from include/asm-generic/bitsperlong.h. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | riscv: use generic bitsperlong.hMasahiro Yamada2019-08-121-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux highly depends on the fact that the 'long' and the pointer have the same width, and so does barebox. So, we can always use include/asm-generic/bitsperlong.h, which determines BITS_PER_LONG depending on CONFIG_64BIT. This is what Linux does (at least in the kernel-space), and barebox can follow it. Currently, barebox only supports 32-bit riscv, but this should work when it supports 64-bit by adding CONFIG_64BIT to arch/riscv/Kconfig. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>