331506 |
24-Mar-2018 |
ian |
MFC r310017, r310229, r312289, r327260, r329539, r329544-r329546, r329620, r329729, r329911, r329999
r310017: [spi] reformat message
This commit corrects print of nomatch (newline was too early)
Submitted by: Hiroki Mori <yamori813@yahoo.co.jp> Reviewed by: ray, loos, mizhka Differential Revision: https://reviews.freebsd.org/D8749
r310229: ofw_spi: Parse property for the SPI mode and CS polarity. As cs is stored in a uint32_t, use the last bit to store the active high flag as it's unlikely that we will have that much CS.
Reviewed by: loos Differential Revision: https://reviews.freebsd.org/D8614
r312289: [spibus] small code refactoring
Merge 3 sequential printf calls into one.
Reported by: rpokala Reviewed by: rpokala, adrian Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D8795
r327260: SPDX: fix wrong license ID tag in dev/spibus.
r329539: Provide public declarations for ofw_spibus_driver and ofw_spibus_devclass so other drivers can refer to them in DRIVER_MODULE() decls.
r329544: Add modules/spi as a gathering point for SPI-related modules, analagous to modules/i2c for i2c/iicbus modules. Build spibus as a module.
r329545: Add ofw_bus_if.h to SRCS.
r329546: Build at45d and mx25l SPI flash drivers as modules.
r329620: Add missing MODULE_DEPENDS().
r329729: Remove some files that snuck in via cut and paste.
Having these compiled into the module causes the kobj method descriptors to be resolved incorrectly (by the compile-time linker instead of the kernel linker), which then leads to hours of frustrating debugging.
r329911: Add a functional detach() routine, to make things kldunload-friendly.
r329999: Add a SPI driver for imx5 and imx6.
It can be compiled into the kernel with "device imx_spi" or loaded as a module, which is also named "imx_spi". |
310158 |
16-Dec-2016 |
manu |
MFC r309935:
Use the spibus accessor when applicable. |
308401 |
07-Nov-2016 |
hselasky |
MFC r307518: Fix device delete child function.
When detaching device trees parent devices must be detached prior to detaching its children. This is because parent devices can have pointers to the child devices in their softcs which are not invalidated by device_delete_child(). This can cause use after free issues and panic().
Device drivers implementing trees, must ensure its detach function detaches or deletes all its children before returning.
While at it remove now redundant device_detach() calls before device_delete_child() and device_delete_children(), mostly in the USB controller drivers.
Tested by: Jan Henrik Sylvester <me@janh.de> Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D8070 |
302408 |
08-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
300659 |
25-May-2016 |
sgalabov |
Build etherswitch support for appropriate Ralink/Mediatek SoCs
Etherswitch support is built by default on all SoCs except RT3662/RT3883 as they have no built-in switch and their configurations with external switches are not yet supported.
Sponsored by: Smartcom - Bulgaria AD
|
300196 |
19-May-2016 |
sgalabov |
Ralink: Add more SoC compatible strings
Add more 'compatible' strings found in various LEDE DTS files.
Reviewed by: adrian Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6432
|
300149 |
18-May-2016 |
andrew |
Return the struct intr_pic pointer from intr_pic_register. This will be needed in later changes where we may not be able to lock the pic list lock to perform a lookup, e.g. from within interrupt context.
Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
|
300014 |
17-May-2016 |
sgalabov |
Add proper PCIe init for MT7628/MT7688 SoCs
PCIe PHY needs different initialization on MT7628/MT7688 SoCs than it does on MT7620. However, LEDE (and OpenWRT) dts files have the PCIe node for MT7628/MT7688 as compatible with mt7620-pci. We already can handle this properly in our driver, so we just need to add compat strings to fbsd-mt7628an.dtsi and the PCIe driver.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6395
|
299928 |
16-May-2016 |
andrew |
Introduce MSI and MSI-X support to intrng. This adds a new msi device interface with 5 methods to mirror the 5 MSI/MSI-X methods in the pcib interface. The pcib driver will need to perform a device specific lookup to find the MSI controller and pass this to intrng as the xref. Intrng will finally find the controller and have it handle the requested operation.
Obtained from: ABT Systems Ltd MFH: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5985
|
299755 |
14-May-2016 |
gonzo |
Use OF_prop_free instead of direct call to free(9)
Reviewed by: sgalabov
|
299155 |
06-May-2016 |
sgalabov |
mtk_spi cleanup commented printfs
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6223
|
299154 |
06-May-2016 |
sgalabov |
mtk_gpio fixes
Allow output pins to be read and input pins to be set. Fix bugs where we were trying to access the gpio softc before doing device_get_softc.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6222
|
299117 |
05-May-2016 |
skra |
INTRNG - redefine struct intr_map_data to avoid headers pollution. Each struct associated with some type defined in enum intr_map_data_type must have struct intr_map_data on the top of its own definition now. When such structs are used, correct type and size must be filled in.
There are three such structs defined in sys/intr.h now. Their definitions should be moved to corresponding headers by follow-up commits.
While this change was propagated to all INTRNG like PICs, pic_map_intr() method implementations were corrected on some places. For this specific method, it's ensured by a caller that the 'data' argument passed to this method is never NULL. Also, the return error values were standardized there.
|
298501 |
23-Apr-2016 |
sgalabov |
Remove uart_dev_mtk_ns8250
The purpose of this file was to simply detect the UART speed before attaching the actual ns8250 driver so that we don't have to specify the UART speed in DTS files.
However, OpenWRT DTS files specify ns16550a as a compatible string in their DTS files and this makes the original ns8250 driver attach to the device. So we would have to edit the DTS files anyway and since this is only the case for MT7621 and MT7628/MT7688 for now, it's better to just add the clock-frequency property to those (UART is always clocked by the same clock in both these SoCs, so that's fine) instead of having a separate driver and still having to change the DTS files.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6044
|
298499 |
23-Apr-2016 |
sgalabov |
Use cpu_establish_hardintr in mtk_intr_gic
This allows us to come closer to OpenWRT vanilla DTS files.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6045
|
298498 |
23-Apr-2016 |
sgalabov |
Introduce palmbus for Mediatek/Ralink SoCs
This allows us to get closer to OpenWRT DTS files and minimize the diffs a little more.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6042
|
298497 |
23-Apr-2016 |
sgalabov |
Minor pinctrl fixes for Mediatek/Ralink
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6041
|
298397 |
21-Apr-2016 |
sgalabov |
Rework Mediatek/Ralink configuration files
Only compile what each SoC needs and get rid of MEDIATEK generic config.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5996
|
298350 |
20-Apr-2016 |
sgalabov |
Add compat strings used by OpenWRT to some Mediatek/Ralink drivers
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5995
|
298349 |
20-Apr-2016 |
sgalabov |
Rework mtk_gpio_v1 driver
This revision makes the mtk_gpio_v1 driver read its register map property from the OpenWRT dts files.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D6029
|
298348 |
20-Apr-2016 |
sgalabov |
Introduce OpenWRT compatible pinctrl driver for Mediatek/Ralink SoCs
The driver can read and parse the OpenWRT pinctrl dts entries.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5999
|
298185 |
18-Apr-2016 |
sgalabov |
Allow RT3350 CPU clock to be detected as part of RT3050/RT3052 detection
OpenWRT's dts files treat RT3050/RT3052/RT3350 within the same SoC dtsi file, so we need to distinguish between the three dynamically, mainly because the bit we use to determine the clock speed on RT3050/RT3052 can actually be floating on RT3350 and RT3350 is always at 320MHz.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5983
|
298127 |
16-Apr-2016 |
sgalabov |
Add support for boot arguments specification via fdt
Add suppport for passing boot arguments via FDT for mediatek/ralink SoCs. This was taken from kan's work on CI20.
Since most OpenWRT dts files have bootargs defined, we use bsdbootargs to specify FreeBSD specific arguments.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5979
|
298059 |
15-Apr-2016 |
sgalabov |
Mediatek/Ralink: Get our drivers closer to OpenWRT dts definitions
This revision gets our Mediatek/Ralink drivers closer to OpenWRT's dts definitions, so we can reuse them with less modifications later in order to bring support for a lot of boards at once.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5961
|
298058 |
15-Apr-2016 |
sgalabov |
Remove unneeded initialization in mtk_xhci.c
This is actually initialized properly within xhci.c, so it's better to not initialize it in mtk_xhci.c
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5935
|
297850 |
12-Apr-2016 |
sgalabov |
Move Mediatek/Ralink PCIe to NEW_PCIB
This revision fixes minor issues and moves the Mediatek/Ralink PCIe support to use NEW_PCIB.
https://svnweb.freebsd.org/changeset/base/297849 is the other part of this changeset.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5908
|
297718 |
08-Apr-2016 |
sgalabov |
Introduce better locking for mtk_gpio_v[12] drivers
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5887
|
297717 |
08-Apr-2016 |
sgalabov |
Introduce Mediatek/Ralink PCIe support
This revision introduces PCIe support for the relevant Mediatek/Ralink SoCs. Currently the PCIe support is not converted to INTRNG, this may be a task for the future.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5886
|
297716 |
08-Apr-2016 |
sgalabov |
Introduce XHCI support for MT7621 SoC
Tested on a MT7621 board, similar to the WiTi board. More testing will be required to confirm everything is fine, but things look good so far.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5885
|
297715 |
08-Apr-2016 |
sgalabov |
Disable USB PHY slew rate calibration for Mediatek SoCs for now
USB on both MT7621 and MT7688 seems to work much better without doing slew rate calibration. These are the only two SoCs, apart from MT7628, which actually make use of the slew rate calibration routines implemented in the mtk_usb_phy driver. Since MT7628 is actually a superset of MT7688 things should be the same for it as well.
We do not remove the code, we simply define it out.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5884
|
297714 |
08-Apr-2016 |
sgalabov |
Fix wrong memory mapping
In mtk_soc.c memory is mapped incorrectly for MT7621. This revision fixes this.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5882
|
297675 |
07-Apr-2016 |
sgalabov |
Initial import of Ralink/Mediatek MIPS SoC support #7
GPIO controller drivers import.
As with other Ralink/Mediatek work, there are 2 versions of the GPIO controller driver, depending on the type of SoC. This revision introduces initial support for these.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5877
|
297671 |
07-Apr-2016 |
sgalabov |
Initial import of Ralink/Mediatek MIPS SoC support #6
SPI drivers for the various Ralink/Mediatek SoCs. There are 2 versions of the SPI controller (so far) present in the supported SoCs, hence v1 and v2 drivers.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5842
|
297670 |
07-Apr-2016 |
sgalabov |
Initial import of Ralink/Mediatek MIPS SoC support #5
USB support
This revision adds USB (EHCI/OHCI/OTG, depending on SoC type) support for various Ralink/Mediatek SoCs. Currently USB is not supported on MT7621, this will be a future addition.
A USB PHY driver is also included, so that we can properly initialize the USB PHY (e.g., clocks, resets, registers where needed), before attempting to initialize EHCI/OHCI/OTG functionality.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5841
|
297669 |
07-Apr-2016 |
sgalabov |
Initial import of Ralink/Mediatek MIPS SoC support #4
UART drivers.
- uart_dev_mtk.[ch] are the old-style Mediatek/Ralink-specific UART driver as also found in sys/mips/rt305x/uart_dev_rt305x.c, with minor improvements and FDT attachment enabled for the appropriate SoCs. - uart_dev_mtk_ns8250.c is the new-style ns16550a-compatible UART driver found in newer Mediatek SoCs. It uses the uart_dev_ns8250.c driver indirectly and is basically just a wrapper around it and only overrides its probe method. The reason I am not using the uart_dev_ns8250.c driver directly is because I have some code that does UART clock detection before initializing the UART, so that we don't need to hard-code the UART clock frequency in the dts files for each board.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5840
|
297668 |
07-Apr-2016 |
sgalabov |
Initial import of Ralink/Mediatek MIPS SoC support #3
Interrupt controllers found in various Mediatek/Ralink SoCs.
mtk_intr_v1 and mtk_intr_v2 are basically the same at the moment, with just different register mappings.
However, v1 interrupt controller has a subset of the functionality of the v2 interrupt controller, so in the future the v2 interrupt controller driver may be enhanced, if needed, with things like level/edge interrupts and soft interrupts. So, for the moment I suggest we keep them as 2 separate files.
mtk_intr_gic provides very basic (similar to v1 and v2) support for MIPS GIC controllers, which currently maps all interrupts to a single core and sets them to type level, active high. In the future this may be developed into a generic GIC controller to support any new MIPS SoCs that include it. The GIC is a standard MTI interrupt controller in their multi-core line-up (e.g., 1004K, 1074K, etc.), rather than a SoC-specific controller.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5839
|
297667 |
07-Apr-2016 |
sgalabov |
Initial import of Ralink/Mediatek MIPS SoC support #2
This revision adds the following to the Mediatek/Ralink support:
- initial support for "clocks" FDT property, currently based on fdt_clock - initial support for "resets" FDT property, currently based on the fdt_reset interface from D5826 - initial support for "pinctrl,bits" functionality via FDT. May be extended in the future to cover a better and fuller pinctrl implementation
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5827
|
297666 |
07-Apr-2016 |
sgalabov |
This revision adds the following parts:
- machine dependent low level init code - SoC clocks detection and some utility functions - Common interface to read/write/modify SoC system control registers, used by some of the other drivers and utility functions - simple FDT resets support, based on the fdt_clock implementation already in the tree. For the moment resets and clocks are managed using these implementations. I am planning to port those to the new extres framework in the future, but currently I simply don't have time to do this part too.
Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5826
|