Commit Graph

35984 Commits

Author SHA1 Message Date
Kinsey Moore
caffdc4dab bsps/zynqmp: Add JFFS2 NAND adapter
This adds the glue code necessary to allow JFFS2 to operate on top of
NAND memory hosted by the XNandPsu peripheral/driver.
2023-03-15 13:29:12 -05:00
Kinsey Moore
5db68a5859 cpukit/jffs2: Add support for NAND under JFFS2
This adds write buffer and bad block support required for JFFS2
operation on NAND devices. This also adds the minor modifications
necessary for RTEMS support in the Linux header stubs and in wbuf.c.
Memory and NOR backed applications should experience no difference in
operation since they do not expose the callbacks required for write
buffer support.
2023-03-15 13:29:12 -05:00
Kinsey Moore
5635ec3362 cpukit/jffs2: Import wbuf.c from upstream
This pulls in wbuf.c from the upstream Linux repository at the state
specified in VERSION.
2023-03-15 13:29:12 -05:00
Kinsey Moore
8eb666fa96 cpukit/jffs2: Initialize and lock mutexes
Mutexes must be locked before they can be unlocked. JFFS2 doesn't
currently see this as an issue because all mutex operations are no-ops.
2023-03-15 13:29:12 -05:00
Kinsey Moore
10ff982834 bsps/xnandpsu: Allow use of both chip selects
By default, the Xilinx NAND driver does not probe the second chip
select. This alteration allows the second half of chips to be
detected when present.
2023-03-15 13:29:12 -05:00
Sebastian Huber
d0dd98cca0 sparc: Add header files to Doxygen group 2023-03-15 16:01:06 +01:00
Sebastian Huber
3a6efa2e7f score: Fix Doxygen group identifier 2023-03-15 16:01:06 +01:00
Sebastian Huber
09ddbde257 score: Add file to Doxygen group 2023-03-15 16:01:06 +01:00
Sebastian Huber
a0bb541d42 build: Use standard format 2023-03-15 16:01:06 +01:00
Sebastian Huber
03159bd837 build: Remove obsolete default-by-variant 2023-03-15 09:47:20 +01:00
Alex White
725e5ce27f bsps/microblaze: Add AXI GPIO driver 2023-03-14 09:29:16 -05:00
Sebastian Huber
e81701bc6c validation: Fix typo 2023-03-14 08:27:33 +01:00
Sebastian Huber
9bb2f59efe doxygen: Add groups for related test suites 2023-03-14 08:07:25 +01:00
Sebastian Huber
377eae4165 spsysinit01: Fix sem_open() call
The O_CREAT flag requires a mode and initial value as third and fourth
argument.

Close #4878.
2023-03-14 08:00:21 +01:00
Sebastian Huber
2859e422b3 Provide kernel space items only if needed
The kernel space parts of standard system header files were protected
against misuse by a preprocessor error directive.  This approach does
not work well with tools such as Doxygen.  Provide the kernel space
items only if the required defines are present.
2023-03-14 08:00:11 +01:00
Sebastian Huber
9bfe5f599d validation: Derive names from item UIDs
Use the item UID converted to CamelCase for Doxygen group names and
testsuite names.

Update #3716.
2023-03-13 14:00:59 +01:00
Karel Gardas
1a4e78b3a0 bsps/stm32h7: fix propagation of configured HSE freq. value into the code
Sponsored-By:	Precidata
2023-03-10 16:18:32 +01:00
Sebastian Huber
d5c386ff99 pps: Round to closest integer in pps_event()
The comment above bintime2timespec() says:

  When converting between timestamps on parallel timescales of differing
  resolutions it is historical and scientific practice to round down.

However, the delta_nsec value is a time difference and not a timestamp.  Also
the rounding errors accumulate in the frequency accumulator, see hardpps().
So, rounding to the closest integer is probably slightly better.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604
2023-03-07 07:30:44 +01:00
Sebastian Huber
d9f5345df6 pps: Simplify the nsec calculation in pps_event()
Let A be the current calculation of the frequency accumulator (pps_fcount)
update in pps_event()

  scale = (uint64_t)1 << 63;
  scale /= captc->tc_frequency;
  scale *= 2;
  bt.sec = 0;
  bt.frac = 0;
  bintime_addx(&bt, scale * tcount);
  bintime2timespec(&bt, &ts);
  hardpps(tsp, ts.tv_nsec + 1000000000 * ts.tv_sec);

and hardpps(..., delta_nsec):

  u_nsec = delta_nsec;
  if (u_nsec > (NANOSECOND >> 1))
          u_nsec -= NANOSECOND;
  else if (u_nsec < -(NANOSECOND >> 1))
          u_nsec += NANOSECOND;
  pps_fcount += u_nsec;

This change introduces a new calculation which is slightly simpler and more
straight forward.  Name it B.

Consider the following sample values with a tcount of 2000000100 and a
tc_frequency of 2000000000 (2GHz).

For A, the scale is 9223372036.  Then scale * tcount is 18446744994337203600
which is larger than UINT64_MAX (= 18446744073709551615).  The result is
920627651984 == 18446744994337203600 % UINT64_MAX.  Since all operands are
unsigned the result is well defined through modulo arithmetic.  The result of
bintime2timespec(&bt, &ts) is 49.  This is equal to the correct result
1000000049 % NANOSECOND.

In hardpps(), both conditional statements are not executed and pps_fcount is
incremented by 49.

For the new calculation B, we have 1000000000 * tcount is 2000000100000000000
which is less than UINT64_MAX. This yields after the division with tc_frequency
the correct result of 1000000050 for delta_nsec.

In hardpps(), the first conditional statement is executed and pps_fcount is
incremented by 50.

This shows that both methods yield roughly the same results.  However, method B
is easier to understand and requires fewer conditional statements.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604
2023-03-07 07:30:44 +01:00
Sebastian Huber
3cda5ad953 pps: Directly assign the timestamps in pps_event()
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604
2023-03-07 07:30:44 +01:00
Sebastian Huber
6730543457 pps: Move pcount assignment in pps_event()
Move the pseq increment.  This makes it possible to reuse registers earlier.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604
2023-03-07 07:30:44 +01:00
Sebastian Huber
2a30bbf852 pps: Simplify capture and event processing
Use local variables for the captured timehand and timecounter in pps_event().
This fixes a potential issue in the nsec preparation for hardpps().  Here the
timecounter was accessed through the captured timehand after the generation was
checked.

Make a snapshot of the relevent timehand values early in pps_event().  Check
the timehand generation only once during the capture and event processing.  Use
atomic_thread_fence_acq() similar to the other readers.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604
2023-03-07 07:30:44 +01:00
Sebastian Huber
069275f5fa pps: Load timecounter once in pps_capture()
This ensures that the timecounter and the tc_get_timecount handler belong
together.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/604
2023-03-07 07:30:44 +01:00
Mateusz Guzik
bb06cdab42 ntptime: ansify
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-03-07 07:30:44 +01:00
Sebastian Huber
aff6af106d Clarify hardpps() parameter name and comment
Since 32c203577a5e by phk in 1999 (Make even more of the PPSAPI
implementations generic), the "nsec" parameter of hardpps() is a time
difference and no longer a time point.  Change the name to "delta_nsec"
and adjust the comment.

Remove comment about a clock tick adjustment which is no longer in the code.

Pull Request: https://github.com/freebsd/freebsd-src/pull/640
Reviewed by: imp
2023-03-07 07:30:44 +01:00
Mitchell Horne
2bac3364d2 set_cputicker: use a bool
The third argument to this function indicates whether the supplied
ticker is fixed or variable, i.e. requiring calibration. Give this
argument a type and name that better conveys this purpose.

Reviewed by:	kib, markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35459
2023-03-07 07:30:44 +01:00
firk
0c36cb6101 kern_tc.c/cputick2usec()
(which is used to calculate cputime from cpu ticks) has some imprecision and,
worse, huge timestep (about 20 minutes on 4GHz CPU) near 53.4 days of elapsed
time.

kern_time.c/cputick2timespec() (it is used for clock_gettime() for
querying process or thread consumed cpu time) Uses cputick2usec()
and then needlessly converting usec to nsec, obviously losing
precision even with fixed cputick2usec().

kern_time.c/kern_clock_getres() uses some weird (anyway wrong)
formula for getting cputick resolution.

PR:		262215
Reviewed by:	gnn
Differential Revision:	https://reviews.freebsd.org/D34558
2023-03-07 07:29:58 +01:00
Sebastian Huber
3612dc7d61 build: Print item UID in case of errors
This helps to identify issues in build items.
2023-03-06 16:37:06 +01:00
Sebastian Huber
269562cfd2 bsps/riscv: Use medany cmodel for 64-bit variants
Updates #4775.
2023-03-02 15:08:23 +01:00
Kinsey Moore
d08dfc3d63 bsps/aarch64: Disable interrupts during MMU remap
Interrupts must be disabled during MMU remapping since the majority of
RTEMS including interrupts expects normal memory mapping semantics such
as unaligned accesses.
2023-02-27 12:31:48 -06:00
Joel Sherrill
9b4aed1fd1 waf: Update to waf 2.0.25
Updates #4860
2023-02-20 10:01:45 -06:00
Karel Gardas
673d7861e3 bsps/beagle: fix warning on possibly uninitialized clock control in pwmss. 2023-02-18 23:00:05 +01:00
Karel Gardas
4600dd1d2f bsps/beagle: fix warning on missing cast 2023-02-18 23:00:05 +01:00
Karel Gardas
14026f6b10 bsps/beagle: do not set values already set by spec file(s).
The patch fixes few symbol already defined warnings here.
2023-02-18 23:00:05 +01:00
Sebastian Huber
bb465c8548 doxygen: Add Doxygen files to a group
Update #3707.
2023-02-16 08:27:09 +01:00
zack
809e34e527 libmisc/shell/main_edit.c: User cannot cut using ctrl e and x
Closes #4557
2023-02-15 15:16:37 -06:00
Kinsey Moore
2a6aaf87bd bsps/aarch64: Fix off-by-one cache bug
The whole cache invalidation and flushing functions only ended up
flusing the first N-1 levels of cache due to an off by one error. This
resovles that issue and makes consistent the usage of levels as they
relate to caching.
2023-02-14 08:33:53 -06:00
Kinsey Moore
b44e26baa7 bsps/aarch64: Flush cache before disabling MMU
To ensure data consistency, the cache much be flushed before disabling
the MMU. When the MMU is disabled, all accesses are treated as
non-cachced and thus will bypass the cache.
2023-02-14 08:33:52 -06:00
Sebastian Huber
7629760e49 build: Remove superfluous attribute 2023-02-14 15:21:44 +01:00
Sebastian Huber
c2756c1476 doxygen: Document CONFIGURE_INIT 2023-02-14 15:16:04 +01:00
Sebastian Huber
bfc823dd83 doxygen: Fix header file path 2023-02-14 15:16:04 +01:00
Sebastian Huber
fa77ad1494 doxygen: Harmonize header file references 2023-02-14 15:16:04 +01:00
Sebastian Huber
1f8b26a809 doxygen: Use @anchor for appl config options
The application configuration options are documented in
"cpukit/doxygen/appl-config.h".  Since the application configuration
option defines are also present in multiple test program sources, the
"#OPTION" references cannot be mapped to a unique definition.  Add an
anchor for each option and reference it to avoid the issues with the
multiple definitions.

Update #3994.
2023-02-14 07:42:14 +01:00
Sebastian Huber
c508a3329e doxygen: Generalize appl config constraints
Rename the constaints section of application configuration options from
"Value Constraints" in "Constraints.  Adjust the constraint wording
accordingly.  This is in line with the RTEMS Classic API Guide.

Update #3994.
2023-02-14 07:42:14 +01:00
Sebastian Huber
bcdcdd01ac doxygen: Clarify CONFIGURE_DISABLE_BSP_SETTINGS
Each BSP may optionally provide default values for some application
configuration options.  Remove the documentation of these items, since
the BSP provided defines are not application configuration options, they
are optional default values.  Clarify CONFIGURE_DISABLE_BSP_SETTINGS
accordingly and move it into the "General System Configuration" group.

Update #3994.
2023-02-14 07:42:14 +01:00
Sebastian Huber
02f5c5c660 doxygen: Use quotes for href URLs
Update #3994.
2023-02-14 07:42:14 +01:00
Sebastian Huber
c68cfbd55b libtest: Fix Doxygen group identifier 2023-02-13 10:06:20 +01:00
Karel Gardas
0328a82c62 bsps/stm32h7: fix compilation failure of stm32h757i-eval-m4 BSP 2023-02-12 20:13:18 +01:00
Sebastian Huber
b993111594 bsp/leon3: Move SMP data to start.S
The LEON3_Boot_Cpu global object is only used by start.S.  Move the definition
of this object to start.S and use a local symbol .Lbootcpuindex for it.

Use a compare-and-swap instruction to assign the boot CPU.  This allows a
concurrent initialization.

Close #4845.
2023-02-10 16:15:52 +01:00
Sebastian Huber
519e288a96 bsps/irq: Clarify interrupt vector operations
Clarify that the presence of error conditions is
implementation-defined.

Close #4843.
2023-02-10 16:14:11 +01:00