Michal Maka [Tue, 13 Aug 2013 15:01:14 +0000 (17:01 +0200)]
beaglebone ethernet improvements
. added enable interrupts routine at the HW init stage
. remove workaround, obsoleted by libnetdriver change
. change netconf.sh to allow configuring this driver,
changed README.txt to reflect this
Previously, all incoming messages would be blocked before a DL_CONF
message arrives from the TCP/IP stack. This however makes it impossible
for a driver to process interrupts before the DL_CONF initialization.
This patch blocks only datalink messages before the initial DL_CONF,
and lets through all other messages to the driver.
Thomas Cort [Fri, 9 Aug 2013 20:41:13 +0000 (20:41 +0000)]
mined: K&R to ANSI, fix function sigs & warnings
- Re-write function declarations from K&R style to ANSI style.
- Change declaration of write_char(), S(), in_list() to match ptotos.
- Resolve clang warnings about assignments in conditionals.
Thomas Cort [Mon, 12 Aug 2013 17:39:54 +0000 (13:39 -0400)]
i2c: general clean-up
Implement changes based on Kees comments on the code review:
http://gerrit-minix.few.vu.nl/#/c/676/
Changes:
- use spin API instead of micro_delay() for busy-wait loops.
- use read16/write16/set16 from mmio.h to access I2C registers.
- reduce the timeout for soft reset.
- in read/write, don't mix variable declaration and initialization.
- after transfer, wait for access ready instead of blindly delaying.
- rename constants am335x, dm37xx to AM335X_I2C_BUS, DM37XX_I2C_BUS.
- rename ADDRESS_MASK to MAX_I2C_SA_MASK for clairity.
- rename omap_i2c_claim_bus() to omap_i2c_bus_is_free().
Thomas Cort [Sat, 10 Aug 2013 05:22:48 +0000 (05:22 +0000)]
backup: bug fix for improper struct dirent usage
Between Minix 3.1.2 and Minix 3.1.3, the d_name member of struct
dirent was reduced from 61 characters to 1 character. backup(8)
blindly copies the result of readdir() into an array of dirent
structs. As a consequence, the structs in the array only contain
the first letter of the name and the name string was not null
terminated. This caused the backup utility to always fail.
Remedy the situation by adding room for the full d_name.
Thomas Cort [Mon, 29 Jul 2013 16:21:48 +0000 (12:21 -0400)]
Importing sys/dev/videomode
NetBSD provides an in-kernel EDID parser, validator, and printer
along with other useful functions. This code will be re-used by
the Minix fb driver as it is a complete and well tested
implementation.
Thomas Cort [Wed, 7 Aug 2013 01:34:08 +0000 (21:34 -0400)]
readclock.drv: add support for the TPS65950 RTC
On the BeagleBoard-xM, the RTC is located on the Power Management IC
(PMIC). To keep things consistent, access to the PMIC's RTC is done
through the readclock driver. The readclock driver forwards the request
on to the TPS65950 driver which does the work of manipulating the
registers on the chip.
Thomas Cort [Thu, 8 Aug 2013 00:06:47 +0000 (20:06 -0400)]
readclock: code clean-up, add -q, manpage updates
- Simplify the message passing between readclock and the driver.
- Add a -q command line option to suppress warning messages. This
cuts down on the noise when readclock is called early in the boot
sequence and a secondary RTC driver (ex TPS95650) isn't up yet.
- Update the man page to be less i386 centric and add details about
the new -q option.
The VM server now manages its call masks such that all user processes
share the same call mask. As a result, an update for the call mask of
any user process will apply to all user processes. This is similar to
the privilege infrastructure employed by the kernel, and may serve as
a template for similar fine-grained restrictions in other servers.
Concretely, this patch fixes the problem of "service edit init" not
applying the given VM call mask to user processes started from RC
scripts during system startup.
In addition, this patch makes RS set a proper VM call mask for each
recovery script it spawns.
Lukasz Hryniuk [Wed, 7 Aug 2013 10:17:09 +0000 (12:17 +0200)]
Some more 64bit function eradication.
. Replace 64bit funcions with operators in arch_clock.c
. Replace 64bit funcions with operators in proc.c
. Replace 64bit funcions with operators in vbox.c
. Replace 64bit funcions with operators in driver.c
. Eradicates is_zero64, make_zero64, neg64
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.