569 Commits

Author SHA1 Message Date
Kinsey Moore
beb423ba5b freebsd/mmcsd: Disable on-device cache usage
This disables any usage of the on-device R/W cache since all device
cache maintenance functions are compiled out under RTEMS leaving no way
to flush the cache before system reset and making data loss possible.
2024-03-05 08:50:46 -06:00
Stefan Eßer
31808093e1 sys/bitset.h: reduce visibility of BIT_* macros
Add two underscore characters "__" to names of BIT_* and BITSET_*
macros to move them to the implementation name space and to prevent
a name space pollution due to BIT_* macros in 3rd party programs with
conflicting parameter signatures.

These prefixed macro names are used in kernel header files to define
macros in e.g. sched.h, sys/cpuset.h and sys/domainset.h.

If C programs are built with either -D_KERNEL (automatically passed
when building a kernel or kernel modules) or -D_WANT_FREENBSD_BITSET
(or this macros is defined in the source code before including the
bitset macros), then all macros are made visible with their previous
names, too. E.g., both __BIT_SET() and BIT_SET() are visible with
either of _KERNEL or _WANT_FREEBSD_BITSET defined.

The main reason for this change is that some 3rd party sources
including sched.h have been found to contain conflicting BIT_*
macros.

As a work-around, parts of shed.h have been made conditional and
depend on _WITH_CPU_SET_T being set when sched.h is included.
Ports that expect the full functionality provided by sched.h need
to be built with -D_WITH_CPU_SET_T. But this leads to conflicts if
BIT_* macros are defined in that program, too.

This patch set makes all of sched.h visible again without this
parameter being passed and without any name space pollution due
to BIT_* macros becoming visible when sched.h is included.

This patch set will be backported to the STABLE branches, but ports
will need to use -D_WITH_CPU_SET_T as long as there are supported
releases that do not contain these patches.

Reviewed by:	kib, markj
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D33235
2022-09-28 13:20:55 +02:00
Christian Mauderer
f5e9bae508 if_ffec: Allow PHY that is connected to other FFEC
The i.MX6UL (and some others from the i.MX family) have shared MDIO
lines for multiple FFECs. This patch allows to use the MDIO interface
from another Ethernet controller.

Note that you have to make sure that the FFECs are initialized in the
right order. Normally that can be done via FDT.
2022-06-07 09:07:15 +02:00
Christian Mauderer
91afe3a020 if_ffec: Reduce buffer size
Typical embedded systems don't have that much memory. Reduce the buffer
size to something more sensible for the usual type of application.
2022-06-07 09:07:08 +02:00
Kinsey Moore
19d9fde14a Import arm64 in_cksum.h correctly
When this file was brought in, it came from the wrong location or
freebsd-org hash. This corrects the file such that freebsd-to-rtems.py
runs cleanly.
2021-12-16 08:53:26 -06:00
Christian Mauderer
d36d545d16 imx: Remove ccm functions alredy defined in RTEMS
The imx_ccm_*_hz are all defined in RTEMS. So don't duplicate them in
libbsd. Otherwise some applications get linker errors.

Update #3869
2021-09-02 08:45:31 +02:00
Jan Sommer
5b82fcf06a i386: Remove unneeded include header files 2021-06-07 10:39:46 +02:00
Christian Mauderer
8aa3ddfbd7 MMCSD: Use cache aligned alloc for ioctl
Some drivers can't easily work with buffers that are not cache aligned
and have an arbitrary length. Therefore use an aligned malloc instead.
2021-04-19 09:03:37 +02:00
G S Niteesh Babu
3cdf289424 arm/ti/ti_pinmux: Remove TI pinmux driver
The TI driver has been moved to RTEMS so the driver can be removed
from libBSD.

The following files have been removed from libBSD and moved to
RTEMS.
1) ti/am335x/am335x_scm_padconf.c
2) ti/am335x/am335x_scm_padconf.h
3) ti/ti_pinmux.c
4) ti/ti_pinmux.h

Update #3784
2021-03-21 12:35:04 +01:00
Moyano, Gabriel
b16b47774e ehci_pci: Import from freebsd-org
Updates #4264
2021-03-08 17:46:09 +01:00
Christian Mauderer
182aac377d if_ffec: Fix cache handling on tx
With the previous fix, it could happen that the end of the packet hasn't
been flushed. For example assume the following addresses:

ds_addr: 0x81c804A
ds_len: 0x57

In that case the data ends at 0x81c80a1. But due to the rounding the
area from 0x81c8040 to 0x81c80a0 would have been flushed.

This fix now first calculates the start and end address, aligns these
addresses and then recalculates the len that has to be flushed.

Update #4180
2020-11-20 08:56:40 +01:00
Kinsey Moore
9f52a0df17 Update arm64/aarch64 support 2020-11-13 12:34:01 -06:00
Sebastian Huber
6c83023331 dwc_otg: Add support for nexus bus
Update #3910.
2020-10-27 06:33:05 +01:00
Sebastian Huber
2237f4b053 dwc_otg: Update host frame interval
Update the host frame interval after a device connection.  Select also
the FS/LS PHY clock.  It is not clear if this works on all platforms.

Update #3910.
2020-10-27 06:33:04 +01:00
Sebastian Huber
ccd05b29c1 Add moxie support 2020-09-23 08:06:51 +02:00
Sebastian Huber
ae1e0c25d8 Add or1k support 2020-09-23 06:34:19 +02:00
Sebastian Huber
0462837404 ck: Use default implementation < ARMv6 2020-09-23 06:34:19 +02:00
Jan Sommer
66019c3e78 i386: Delete old machine dependent files
- The files in the i386 directory have been moved to common x86 directories by FreeBSD:
  - freebsd/sys/i386/include/machine/bus.h
  - freebsd/sys/x86/include/machine/legacyvar.h
  - freebsd/sys/x86/include/machine/specialreg.h
- Add header files in rtemsbsd directory to direct compiler to new files
2020-09-16 15:52:58 +10:00
Jan Sommer
514ffab353 iflib.c: Deactivate use of ifc_cpus
- cpusets and SMP are currently not supported in libbsd for RTEMS
- Disable the ifc_cpus context variable and replace its usage,
essentially hard-coding for cpu 0
2020-09-16 15:52:58 +10:00
Jan Sommer
5cfbb629b6 Callout: Redefine callout_reset_on for rtems
- callout_reset_on takes a cpu which is ignored by the subsequent call
to callout_reset_sbt_on in RTEMS.
- The macro is redefined to discard the cpu argument directly which
enables uses of it with cpu-dependent variables (disabled in
RETMS) without further changes, e.g. in iflib.c.
2020-09-16 15:52:58 +10:00
Jan Sommer
56fd3765e9 e1000: Add missing files 2020-09-16 15:52:58 +10:00
Christian Mauderer
4a05b2e41c if_ffec: Align send buffers to cache if necessary. 2020-07-29 11:19:24 +02:00
Christian Mauderer
36b588eb8b rtwn_usb: Make sure buffers are cache aligned 2020-07-29 11:19:14 +02:00
Christian Mauderer
4820ccecc9 busdma: Option to round to cache lines on sync
Some targets support only flushing or invalidating complete cache lines.
In this cases misaligned buffers might lead to unexpected results. This
patch adds a flag that allows drivers to signal to the bus dma driver
that it is OK to round a buffer to the next full cache line. That's for
example necessary if a driver wants to send out 14 byte via a USB DMA.
Only the driver knows whether these 14 bytes are located in an otherwise
unused cache line aligned buffer.
2020-07-29 11:19:14 +02:00
Christian Mauderer
7e5d93bb6b imx: Use RTEMS GPIO driver instead of FreeBSD one
Update 3869
2020-07-29 11:19:00 +02:00
Christian Mauderer
469cc8fbb7 gpioregulator: Remove.
There is a bug in the #ifdef regarding FDT so this file hasn't been
compiled. If that bug is solved, the driver doesn't work for some other
reason.

With the FDT-bug the driver hasn't been used by anyone. So just remove
it again.
2020-07-29 11:15:42 +02:00
Christian Mauderer
4fad914cee imx6_usbphy: Fix regulator (vbus-supply)
Update #3869.
2020-04-20 09:18:58 +02:00
Christian Mauderer
a6cf310fb2 regulator: Disable FDT parts for non-FDT targets 2020-04-17 14:43:58 +02:00
Christian Mauderer
db78c8c52f imx: Fix build for all other BSPs. 2020-04-16 10:49:36 +02:00
Christian Mauderer
c0f6606d47 imx6_usbphy: Add regulator (vbus-supply).
Update #3869.
2020-04-15 16:32:34 +02:00
Christian Mauderer
9dfb3bdef2 ehci_imx: Set/clear ENHOSTDISCONNECT in USB PHY.
This is not a nice solution but it should work on all chips. As soon as
FreeBSD has a nice solution via the USB PHY driver, this should be
replaced.

Update #3869.
2020-04-15 16:32:34 +02:00
Christian Mauderer
c9c4d79898 ehci_imx: Port to RTEMS
Update #3869.
2020-04-15 16:32:34 +02:00
Sebastian Huber
7c34c62c42 ehci_imx: Import from FreeBSD
Update #3869.
2020-04-15 16:32:34 +02:00
Christian Mauderer
9d69204a39 regulator: Import from FreeBSD.
Update #3869.
2020-04-15 16:30:33 +02:00
Sebastian Huber
859015f502 imx gpio port
Update #3869.
2020-04-15 16:18:44 +02:00
Sebastian Huber
eb6ff63322 imx6_ccm: Port to RTEMS
Update #3869.
2020-04-15 16:18:44 +02:00
Sebastian Huber
7bafcafd9b imx6_ccm: Import from FreeBSD
Update #3869.
2020-04-15 16:18:43 +02:00
Sebastian Huber
bd7af5fcee usb_busdma: Add USB_NEED_BUSDMA_COHERENT_ALLOC
Some BSPs have a cache-coherent memory area, however, it should not be
used for the USB controller.
2020-04-15 16:18:43 +02:00
Christian Mauderer
fa81c95416 mmcsd: Don't handle multiple hardware partitions.
The rtems_bsd_mmcsd_attach_worker acquired the bus without releasing it.
If a MMC device has multiple hardware partitions (like eMMC which
typically has at least one boot partition) the
rtems_bsd_mmcsd_attach_worker would try to acquire the bus multiple
times. This doesn't work.

Doing it right would mean to acquire and release the bus for each
access which would have an performance impact. Beneath that it would
mean that partition switching has to be supported by the RTEMS code too.

There is currently no known use case where the access would be
necessary. Therefore this patch prefers the performance and just avoids
all further hardware partitions.
2020-04-01 14:12:11 +02:00
Sebastian Huber
792d56bd33 NVME(4): Fix for big endian platforms
Update #3821.
2020-02-18 14:59:31 +01:00
Sebastian Huber
eb5dc4f658 EVENTHANDLER(9): Avoid multiple definition errors 2020-02-10 19:39:27 +01:00
Jan Sommer
af291fa3a0 i386: Port to RTEMS
- Update imported files to compile rtems-libbsd for i386 based BSPs
- Currently does not support the option "dev_nic_e1000 = on"
2020-02-10 10:44:28 +01:00
Jan Sommer
0bd7949124 i386: Add missing files from FreeBSD
- Files needed to make rtems-libbsd build again for i386
2020-02-10 10:42:42 +01:00
Sebastian Huber
7cfd4a5edb NVME(4): Add NVME_GET_NAMESPACE IO control
Update #3821.
2019-11-13 13:04:01 +01:00
Sebastian Huber
1d90e42327 NVME(4): Enable per-CPU IO queues
Update #3821.
2019-11-13 13:03:57 +01:00
Sebastian Huber
ab4be9ec77 NVME(4): Add support for SGL
Update #3821.
2019-11-13 13:03:55 +01:00
Sebastian Huber
bd2bea425e NVME(4): Add SGL descriptor
Update #3821.
2019-11-13 13:03:54 +01:00
Sebastian Huber
4e1cccffc8 NVME(4): Optimize data transfer
Update #3821.
2019-11-13 13:03:52 +01:00
Sebastian Huber
59951a9a9c NVME(4): Big endian support
Update #3821.
2019-11-13 13:03:51 +01:00
Sebastian Huber
53145c7232 NVME(4): Port to RTEMS
Update #3821.
2019-11-13 13:03:49 +01:00