It adds support of reading chipname via sysfs, so that user space can
distinguish WiFi module among AP5256, AP5256V and 1MW.
- AP5256
reMarkable: ~/ cat /sys/class/ieee80211/phy*/chipname
BCM4345/9
- AP5256V
reMarkable: ~/ cat /sys/class/ieee80211/phy*/chipname
BCM43012/2
- 1MW
reMarkable: ~/ cat /sys/class/ieee80211/phy*/chipname
BCM4345/6
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
From linux-3.8 kernel, wowlan packet filter is mandated to avoid
the disconnection of connected network before suspend in commit
8125696991 ("cfg80211/mac80211: disconnect on suspend").
So as a dummy wowlan filter is configured for kernels linux-3.8
and above. Later all private command implementation of packet
filters can be moved to wowlan based filters.
Signed-off-by: Double Lo <dblo@cypress.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
The vfat fs is required for mounting u-boot env partition which is
actually used by reMarkable post install script.
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
5b29f6e removed disabling of the mu node. Although the imx-mailbox
driver is not enabled in the zero-sugar_defconfig we want to keep
the mu node disabled for correctness.
Signed-off-by: Morten Schade Flå <morten.schade.fla@remarkable.no>
Suspend routine disables wdog clk. Nevertheless, the watchdog subsystem
is not aware of that and can still try to ping wdog through
watchdog_ping_work. In order to prevent such condition and therefore
prevent from system hang (caused by the wdog register access issued
while the wdog clock is disabled) take advantage of
watchdog_dev_suspend/resume routines which will take care of watchdog
ping worker cancel and restore.
Additionally remove hw ping from suspend/resume since it will be
issued by watchdog_dev_suspend/resume routines.
Signed-off-by: Michal Koziel <michal.koziel@emlogic.no>
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
The watchdog drivers often disable wdog clock during suspend and then
enable it again during resume. Nevertheless the ping worker is still
running and can issue low-level ping while the wdog clock is disabled
causing the system hang. To prevent such condition introduce
watchdog_dev_suspend/resume which can be used by any wdog driver and
actually cancel ping worker during suspend and restore it back, if
needed, during resume.
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
The watchdog IP block is reset to its POR state after resuming
from deep sleep or LPSR sleep. Make sure that the watchdog is
restarted after resuming.
Signed-off-by: Michal Koziel <michal.koziel@emlogic.no>
Commit 4e028df4e3 enabled rpmsg on imx legacy platform.
In order to disable the Mailbox MU driver we must disable the mu_lp node.
Signed-off-by: Morten Schade Flå <morten.schade.fla@remarkable.no>
i.MX7 has a completely different bit field layout for IOMUXC_SW_PAD_CTL
register comparing to i.MX6. The current setting for GPIO1_IO14 and
GPIO1_IO13 look like the values for i.MX6, while i.MX7 has only the
following bit fields.
[6:5] PS (Pull Select)
[4] PE (Pull Enable)
[3] HYS (Hyst. Enable)
[2] SRE (Slew Rate Enable)
[1:0] DSE (Drive Strength Enable)
Use 47k pull-up for TOUCH_INT input, disable pull for TOUCH_RESET
output, and keep other bits as the default.
While at it, update the comment for these two pins to use the name from
board schematics.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
The VCOM value is 9 bits and is composed from VCOM Adjustment Control 1
(Address 0x01h) and VCOM Adjustment Control 2 (address 0x02h). The msb
(9) is bit 7 in VCOM Adjustment Control 2.
The USB charger type and status was already propagated to userspace
through kobject_uevent_env during charger notify work. Nevertheless the
uevent could be lost e.g. because it could be fired at an early kernel
boot stage, way before udev daemon or any other user-space app was able
to catch it. Registering uevent hook for introduced usb_phy_dev_type
will allow to query sysfs 'uevent' file to restore that information at
any time.
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
This commit disables:
- Initial RAM filesystem and RAM disk (initramfs/initrd) support
- RAM block device support
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
This commit disables some not used by rM1 features and drivers:
- Memory Technology Device (MTD) support
- SPI support
- EEPROM support
- MOUSE support
- LED support
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
This commit disables:
- SLUB debugging support
- Miscellaneous debug code
- MMC host test driver (used during developing or testing host driver).
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Quoting CONFIG_TRIM_UNUSED_KSYMS Kconfig description:
"This option allows for unused exported symbols to be dropped from the
build. In turn, this provides the compiler more opportunities
(especially when using LTO) for optimizing the code and reducing binary
size. This might have some security advantages as well."
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Since the available RAM for rM1 is only 512M the HIGHMEM can be disabled
which should result in a slightly faster kernel.
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Converting CYTTSP5 to loadable kernel module will allow to take
advantage of potential rootfs fw (/lib/firmware/cyttsp5_fw_pid00.bin).
Nevertheless it is worth noting that the cyttsp5_loader.ko is not
automatically probed but firmware upgrade was only used during
production stage once and is not performed at daily basis.
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Currently imx6sl uses IMX SDMA together with: UART, SPI, SSI and SPDIF
peripherals which are not used in rM1.
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
The zero-gravitas-dev.config converts CFG80211 and MAC80211 to builtin while
disabling loadable module support. Additionally MEMTEST is enabled and
access to .config through /proc/config.gz is provided.
This Kconfig fragment was built by selecting differences between
zero-gravitas_defconfig and zero-gravitas-dev_defconfig found in
https://github.com/reMarkable/linux/commits/lars/zero-gravitas_4.9
cid: 1774e2a6a0
To take advantage of additional zero-gravitas-dev.config and generate
desirable development .config use following command:
$ make zero-gravitas_defconfig zero-gravitas-dev.config
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Disabling busfreq through busfreq phandle is a leftover from a v4.9
custom approach of disabling busfreq for zero-gravitas-factory.dts. This
was done by exposing busfreq through phandle from
arch/arm/boot/dts/imx6sl.dtsi. This is not needed since the busfreq is
already disabled through kernel config.
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
The CMA description was present in Linux v4.9 but seems to get somehow
lost. Restore it since the cma area is needed e.g. by E-Ink Panel
Framebuffer used in reMarkable1.
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
This patch fixes below warnings:
arch/arm/boot/dts/zero-gravitas-factory.dts:164.20-262.4: Warning (i2c_bus_reg):
/soc/aips-bus@2100000/i2c@21a0000/pfuze100@08: I2C bus unit address
format error, expected "8"
arch/arm/boot/dts/zero-gravitas-factory.dts:345.26-351.4: Warning (i2c_bus_reg):
/soc/aips-bus@2100000/i2c@21a4000/wacom-i2c@09: I2C bus unit address
format error, expected "9"
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
This patch adds DT description for reMarkable 1.0 device.
DT taken as is from reMarkable v4.9 kernel [1]
[1] 1774e2a6a0
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
This commit quiets two type of warnings:
- warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
- warning: passing argument 1 of ‘PTR_ERR’ makes pointer from integer
without a cast [-Wint-conversion]
introduced by "video: mxc epdc: Add QOS handling in driver" commit.
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Since with v5.4 the bq27xxx I2C write and bulk write helpers were
already implemented in different way, rework bq27441_battery.c
appropriately.
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Used to be an out-of-tree module
[Grzegorz: cherry-picked from
63a0829def
- solve multiple conflicts:
drivers/power/supply/Kconfig
drivers/power/supply/Makefile
drivers/power/supply/bq27xxx_battery.c
drivers/power/supply/bq27xxx_battery_i2c.c
include/linux/power/bq27xxx_battery.h
- move: bq27441_exit to bq27xxx_battery_i2c_remove due to driver
differences between v4.9 and v5.4. Additionally include proper header
for bq27xxx_battery_i2c.c
- the di->bus.write was already assigned by bq27xxx_battery_i2c_write
so drop custom implementation which comes with original patch.
- drop defconfig changes since they are provided in separate patch.]
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Add ugly hack because the factory needs to be able to disable the SWBST
regulator to reset the charging circuit during tests.
[Grzegorz: Cherry-picked from lars/zero-gravitas_4.9 branch and
cid: 368f855f3c, align to v5.4 baseline and introduce minor
formatting improvements]
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
epdc: Turn on regulators unconditionally
Add hack to EPDC driver to unconditionally turn on the regulators
during initialization for Kaifa testing
epdc: Set pir display configuration
First attempt at setting our display configuration, based on info sheet from E-Ink
epdc: Add waveform for our display
epdc: Move waveform to correct folder
epdc: Update EPDC driver to use correct pixels per SDCLK and data bus width
epdc: Update panel timing information based on NXP EPD calculator values
epdc: Update waveform after attempting to fix NXP's waveform converter
epdc: Bring up our panel by default
epdc: Update panel timing values based on independent calculations
epdc: Add 4bit waveform for ES103CS1
epdc: Add support for ES103CS1 display with 4bit waveforms
epdc: Add patch from NXP to use the correct mutex when panning display
epdc: Remove all traces of the 5bit waveforms
epdc: Remove EPDC powerup hack
epdc: update parameters for 85hz
epdc: undo some custom unnecessary changes
epdc: don't do a normal grayscale update just for init
epdc: fix some printing of errors
epdc: use synchronous firmware loading so users know that the EPDC is inited and can do stuff
mxc_epdc_fb: restore powerdown delay after suspend
mxc_epdc_fb: fix inverted conditional leading to endless collisions
mxc_epdc_fb: epdc driver wants pixclock in hz, not ps
mxc_epdc_fb: add support for automatically getting updated temperature from pmic
[Grzegorz: cherry-picked from
416a27e421
Additionally the firmware/Makeflie change and
firmware/imx/epdc/epdc_ES103CS1.fw.ihex were dropped since the Linux
kernel v5.4 firmware infrastructure has changed. To correctly load
firmware with v5.4 the epdc_ES103CS1.fw should be placed in
/lib/firmware/imx/epdc/ rootfs]
max17135: Add some extra output for Kaifa
max17135: Make the MAX17135 driver check the PWRGOOD pin
max17135: Set the default pass number for MAX17135 to 2
max17135: specify chip version in devicetree
max17135: print ret when failing to write to device
max17135: use sysfs for programming vcom
max17135: add thermistor regulator to read temperature
max17135: get_voltage parameter
The MAX17135 relies on MFD_CORE, without this patch kenel didn't link
properly:
arm-remarkable-linux-gnueabi-ld: drivers/mfd/max17135-core.o: in function `max17135_remove':
drivers/mfd/max17135-core.c:187: undefined reference to `mfd_remove_devices'
arm-remarkable-linux-gnueabi-ld: drivers/mfd/max17135-core.o: in function `max17135_probe':
drivers/mfd/max17135-core.c:155: undefined reference to `mfd_add_devices'
arm-remarkable-linux-gnueabi-ld: drivers/mfd/max17135-core.c:173:
undefined reference to `mfd_remove_devices'
[Grzegorz: commit msg update]
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
This commit fixes multiple redefinitions which prevents kernel from
compiling when CONFIG_HAVE_IMX_BUSFREQ is not enabled. This is observed
since include/linux/busfreq-imx.h provides empty stubs when
CONFIG_HAVE_IMX_BUSFREQ is not enabled, which redefined ones defined in
busfreq-imx.c.
Before this patch built failed with below:
arch/arm/mach-imx/busfreq-imx.c:183:5: error: redefinition of ‘register_busfreq_notifier’
183 | int register_busfreq_notifier(struct notifier_block *nb)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from arch/arm/mach-imx/busfreq-imx.c:23:
./include/linux/busfreq-imx.h:64:19: note: previous definition of ‘register_busfreq_notifier’ was here
64 | static inline int register_busfreq_notifier(struct notifier_block *nb)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm/mach-imx/busfreq-imx.c:189:5: error: redefinition of ‘unregister_busfreq_notifier’
189 | int unregister_busfreq_notifier(struct notifier_block *nb)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from arch/arm/mach-imx/busfreq-imx.c:23:
./include/linux/busfreq-imx.h:68:19: note: previous definition of ‘unregister_busfreq_notifier’ was here
68 | static inline int unregister_busfreq_notifier(struct notifier_block *nb)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm/mach-imx/busfreq-imx.c:821:6: error: redefinition of ‘request_bus_freq’
821 | void request_bus_freq(enum bus_freq_mode mode)
| ^~~~~~~~~~~~~~~~
In file included from arch/arm/mach-imx/busfreq-imx.c:23:
./include/linux/busfreq-imx.h:58:20: note: previous definition of ‘request_bus_freq’ was here
58 | static inline void request_bus_freq(enum bus_freq_mode mode)
| ^~~~~~~~~~~~~~~~
arch/arm/mach-imx/busfreq-imx.c:870:6: error: redefinition of ‘release_bus_freq’
870 | void release_bus_freq(enum bus_freq_mode mode)
| ^~~~~~~~~~~~~~~~
In file included from arch/arm/mach-imx/busfreq-imx.c:23:
./include/linux/busfreq-imx.h:61:20: note: previous definition of ‘release_bus_freq’ was here
61 | static inline void release_bus_freq(enum bus_freq_mode mode)
| ^~~~~~~~~~~~~~~~
arch/arm/mach-imx/busfreq-imx.c:946:5: error: redefinition of ‘get_bus_freq_mode’
946 | int get_bus_freq_mode(void)
| ^~~~~~~~~~~~~~~~~
In file included from arch/arm/mach-imx/busfreq-imx.c:23:
./include/linux/busfreq-imx.h:72:19: note: previous definition of ‘get_bus_freq_mode’ was here
72 | static inline int get_bus_freq_mode(void)
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
This change was generated with 'make zero-gravitas_defconfig',
'savedefconfig' and finally arch/arm/configs/zero-gravitas_defconfig was
overwritten by just generated defconfig.
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
This patch adds default defconfig for reMarkable 1.0 device. Defconfig
taken as is from reMarkable v4.9 kernel [1].
[1] 1774e2a6a0
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Although upstream accepts the solution of coding country code map in DT,
it will require different DTB between AP5256 (BCM4345/9) and AP5256V
(BCM43012/2). To support both chipsets with single kernel image and
DTB, let's hard code country code map table of AP5256 in driver, and use
it over the one from DT if any.
The map table of AP5256 comes from bcmdhd driver, ccode_43456c5[] in
drivers/net/wireless/bcmdhd/dhd_ccode.c.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
With any regulatory domain requests coming from either user space or
802.11 IE (Information Element), the country is coded in ISO3166
standard. It needs to be translated to firmware country code and
revision with the mapping info in settings->country_codes table.
Support populate country_codes table by parsing the mapping from DT.
The BRCMF_BUSTYPE_SDIO bus_type check gets separated from general DT
validation, so that country code can be handled as general part rather
than SDIO bus specific one.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Instead of aborting country code setup in firmware, use ISO3166 country
code and 0 rev as fallback, when country_codes mapping table is not
configured. This fallback saves the country_codes table setup for recent
brcmfmac chipsets/firmwares, which just use ISO3166 code and require no
revision number.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>