Thomas Cort [Fri, 2 Aug 2013 14:10:59 +0000 (10:10 -0400)]
pm: notify readclock of reboot(RBT_POWEROFF)
Some ARM chips handle power-off with RTC alarms. PM notifies
readclock (the driver for RTCs) about the impending power-off.
If the power-off mechanism is an RTC alarm, readclock will
set the alarm. If not, there is no effect.
Thomas Cort [Fri, 2 Aug 2013 14:10:55 +0000 (10:10 -0400)]
kernel: add support for am335x PMIC-base power-off
AM335X SoCs support power-off via a power management
chip (PMIC). An alarm in the real time clock is used
to trigger the PMIC to cut the power.
To ensure the alarm goes off when the system is in
a safe state, the RTC is frozen when the alarm is
set. At the last moment, the kernel unfreezes the RTC
to let the alarm go off.
This patch adds a mini driver for unfreezing the RTC
as well as code to handle RBT_POWEROFF on Minix/arm.
Thomas Cort [Fri, 2 Aug 2013 14:10:30 +0000 (10:10 -0400)]
readclock: add support for am335x RTC
Add support for getting/setting the am335x SoC's internal real
time clock. Also, allow the power off alarm to be set.
Make readclock an "always on" driver. This is needed for setting
power-off alarms whenever the power button is pressed on the BBB.
Replace the readclock.sh script & single run driver with a
readclock program that takes the same arguments and forwards
the requests on to the always up readclock driver.
Thomas Cort [Fri, 26 Jul 2013 23:44:52 +0000 (19:44 -0400)]
i2c: increase BUFLEN/CMDLEN to 128, add page flag.
128 byte reads are much more common than 32 byte reads. The message
passing + setup/teardown for a read is much more expensive, in terms
of time, than the reading itself. A slightly bigger struct is well
worth the time savings. This reduces read times for /dev/eeprom
from 57 seconds per 4KB to 14 seconds.
Additionally, make sending the page address in the eeprom driver
and utility optional. This can save a little time when reading
within the same page and allows support for smaller devices that
don't support pages (example: chips containing EDID).
Kyua/ATF being written in C++, it depends on libstdc++ which is
provided by GCC. As this is not part of the sources, Kyua is only
compiled when the native GCC utils are installed.
To install Kyua do the following:
* In a cross-build enviromnent, add the following to the build.sh
commandline: -V MKBINUTILS=yes -V MKGCCCMDS=yes
WARNING:
At this point the import is still experimental, and not supported
on native builds (a.k.a make build).
Thomas Cort [Mon, 15 Jul 2013 14:29:37 +0000 (10:29 -0400)]
eepromread: simple program to view eeprom contents
This program uses the i2c /dev interface to read the
contents of EEPROMs and display it to the user in
HEX and ASCII. It also has a mode that can display
data in label:value pairs. That mode is used for
board detection in the rc script to start the right
i2c drivers for the board.
Thomas Cort [Mon, 15 Jul 2013 14:28:58 +0000 (10:28 -0400)]
kernel: i2c padconf workaround
The padconf library runs in user mode, but to actually affect the
padconf register contents, the processor has to be in privileged
mode. A full server based solution will be developed, but for now
just set the pinmux in the kernel at boot.
-By adding MKGCC=yes and MKGCCCMDS=yes on the make commandline
it is now possible to compile and install GCC on the system.
Before doing this, if you are not using the build.sh script,
you will need to call the fetch scripts in order to retrieve
the sources of GCC and its dependencies.
-Reduce difference with NetBSD share/mk
Move Minix-specific parameters from bsd.gcc.mk to bsd.own.mk,
which is anyway patched, so that bsd.gcc.mk is now aligned
on the NetBSD version.
-Clean libraries dependencies, compiles stdc++ only if gcc is
also compiled (it is part of the gcc sources)
- Enable installing binutils from the base system.
- Import texinfo which is required for the binutils tools
to be compiled.
- Also adapted the fetch rules to correctly generate the
gitignore files for gcc, and allow the case of multiple
modules in the same directory, as found in gnu/dist.
Xiaoguang Sun [Tue, 25 Jun 2013 12:41:01 +0000 (20:41 +0800)]
Implement getrusage
Implement getrusage.
These fields of struct rusage are not supported and always set to zero at this time
long ru_nswap; /* swaps */
long ru_inblock; /* block input operations */
long ru_oublock; /* block output operations */
long ru_msgsnd; /* messages sent */
long ru_msgrcv; /* messages received */
long ru_nvcsw; /* voluntary context switches */
long ru_nivcsw; /* involuntary context switches */
Ben Gras [Mon, 24 Jun 2013 13:46:20 +0000 (15:46 +0200)]
kernel: high-hz workaround for do_settime
. with hz=1000, clock_t only lasts a few years.
whenever we can't express the desired realtime
in ticks because the distance with boottime is
too high, simply adjust bootime like we do for
otherwise negative values.
. fixes test 2 on ARM
Ben Gras [Sun, 23 Jun 2013 16:37:57 +0000 (18:37 +0200)]
kernel, arm ucontext: ARM DBG=-g run fixes
kernel:
. modules can be as big as the space (8MB) between them
instead of 4MB; memory is slightly bigger with DBG=-g
arm ucontext:
. r4 is clobbered by the restore function, as it's
used as a scratch register, causing problems for the
DBG=-g build
. r1-r3 are safe for scratch registers, as they are
caller-save, so use r3 instead; and don't bother
restoring r1-r3, but preserve r4
Increase driver process priority to prevent starvation. Without
special attribute drivers will have the same priority as other
userland processes this. Posix test 1 was taking so much resources
that it triggered alarms in the MMC driver.
arm:mmc driver refactor and timeout fix for BeagleBoneBlack.
When we send MMC commads that contain data the controller provides no
description of the order of events and we need to be able to send data
from and to the controller "when needed". Changed the code to react
on buffer read and buffer write ready based on interrupts.
Ben Gras [Wed, 19 Jun 2013 09:39:05 +0000 (11:39 +0200)]
arm timer fix
. set 'done' once initialized so 32-bit read frc works,
thanks to keesj
. make sure the software-implemented upper 32 bit of the 64-bit
"tsc" value works OK by adding an assert in one of its calls
Ben Gras [Sun, 16 Jun 2013 22:33:47 +0000 (00:33 +0200)]
kernel, libsys: make it arm-target-independent
. by making the address and frequency of the
free running clock kinfo members, set at runtime
in the kernel, instead of compile time constants
in libsys
Ben Gras [Sat, 15 Jun 2013 23:43:39 +0000 (23:43 +0000)]
a few DBG=-g build fixes, both arches
- setlogin() not available
- softfloat needed in -lminc for arm
- libminc: we have to set LIBCDIR for the included files,
so use that instead of LIBCSRCDIR
Ben Gras [Thu, 13 Jun 2013 13:08:26 +0000 (15:08 +0200)]
some arm uart fixes
. always keep reading data from uart so the interrupt is
not continually asserted if data is sent but no process
reads it
. increase tx & rx fifo trigger levels -> reduces the number
of interrupts necessary
. bigger rx/tx buffers
Ben Gras [Wed, 12 Jun 2013 18:42:41 +0000 (18:42 +0000)]
vfs: patch for unpause()/revive() race condition
. unpause() and revive() can race - revive() can run during
a device i/o unblock, causing two sendnb()s to occur, and the
2nd one to fail
. this can easily happen when a process is blocking on tty and
is then killed by a signal - tty cancels the i/o and then
kills the process by a signal
Ben Gras [Tue, 11 Jun 2013 14:11:57 +0000 (14:11 +0000)]
tty: i386: rs232 fix
. ignore interrupt (stop interrupt check loop) if
interrupt bit not set; limit loop too
. mask off other bits when testing bits in the status register
. this fixes rs232 output that would otherwise never get re-triggered
as too many bits were set in the status byte to match the
possibilities.
Ben Gras [Sat, 16 Mar 2013 03:19:47 +0000 (03:19 +0000)]
ld.elf_so, grep, make: use mmap()
. let the dynamic linker use a real file mmap(), reverting
most of the minix-specific changes
. except for a fallback mode for systems or filesystems that
do not support mmap() on files
. make, grep: let them use mmap() too, with fallback
Ben Gras [Tue, 7 May 2013 12:36:09 +0000 (12:36 +0000)]
vm: mmap support
. test74 for mmap functionality
. vm: add a mem_file memory type that specifies an mmap()ped
memory range, backed by a file
. add fdref, an object that keeps track of FD references within
VM per process and so knows how to de-duplicate the use of FD's
by various mmap()ped ranges; there can be many more than there can
be FD's
. turned off for now, enable with 'filemap=1' as boot option
Ben Gras [Tue, 7 May 2013 12:41:07 +0000 (12:41 +0000)]
vfs: mmap support
. libc: add vfs_mmap, a way for vfs to initiate mmap()s.
This is a good special case to have as vfs is a slightly
different client from regular user processes. It doesn't do it
for itself, and has the dev & inode info already so the callback
to VFS for the lookup isn't necessary. So it has different info
to have to give to VM.
. libc: also add minix_mmap64() that accepts a 64-bit offset, even
though our off_t is still 32 bit now.
. On exec() time, try to mmap() in the executable if available.
(It is not yet available in this commit.)
. To support mmap(), add do_vm_call that allows VM to lookup
(to ino+dev), do i/o from and close FD's on behalf of other
processes.
build:arm allow to store build settings in a .settings file.
If present a file called .settings will be sourced when
calling the arm_sdimage.sh script. This allows to configure
the build setting for arm build without the need to specify
the flags each time arm_sdimage.sh is called.
For example to configure arm_sdimage.sh to target the
beaglebone put the following content in your .settings file.
Thomas Cort [Tue, 28 May 2013 19:07:10 +0000 (15:07 -0400)]
syslog.conf: correct PID file path in comments.
The syslogd.pid file has moved from /usr/run to /var/run. The comments
in syslog.conf direct the user to restart syslogd using the old PID
file location. This patch updates the comment to match the code.