Commit Graph

385 Commits

Author SHA1 Message Date
Stanislav Galabov
f506fee29c 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
2016-04-21 07:40:03 +00:00
Stanislav Galabov
302b3e7dc4 Change MIPS_INTRNG to INTRNG in MEDIATEK_BASE config
Revision 298068 changed MIPS_INTRNG and ARM_INTRNG to simply INTRNG.
MEDIATEK_BASE config was missed by this revision, so we change
MIPS_INTRNG to INTRNG here.

Approved by:	adrian (mentor)
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D5978
2016-04-16 19:42:54 +00:00
Stanislav Galabov
3e4b91800a In order to build a kernel with one of these configs the user should do
the following:

1. Give the appropriate board dts file to be used by either:
1.1. edit the SoC kernel config required (e.g., MT7620A_FDT) and include
the required FDT_DTS_FILE makeoption; or
1.2. simply supply FDT_DTS_FILE="xx.dts" on the command line when building
the kernel
Of course, the user can also create a completely new kernel config to
match the desired board and include the SoC kernel config from within
it.

If required, edit the MEDIATEK config file, which includes optional
drivers and comment out the unneeded ones.
2.1. this would only make sense if kernel size is a concern. Even if we
build the kernel with all drivers, if we lzma it and package it as a uImage,
its size is still around 1.1MiB.

The user will have to choose a dts file (or create a new one) from
sys/gnu/dts/mips , where all Mediatek/Ralink dts files will be imported via
a later revision.

Approved by:	adrian (mentor)
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D5966
2016-04-15 15:20:41 +00:00
Adrian Chadd
dc2e095538 Migrate UNCOMPRESS -> UZIP 2016-02-24 03:06:26 +00:00
Maxim Sobolev
5497acc527 Obsolete mkulzma(8) and geom_uncompress(4), their functionality
is now provided by mkuzip(8) and geom_uzip(4) respectively.

MFC after:	1 month
2016-02-24 00:39:36 +00:00
Adrian Chadd
6d525d0af8 Migrate the other MIPS24K SoC cores to use the CPU_MIPS24K option. 2016-02-11 06:23:02 +00:00
Adrian Chadd
ceb51257dd Use CPU_MIPS24K now in AR933x based boards.
I'll flip on other boards as i test them.

Tested:

* AR9331, Carambola 2
2016-02-02 16:22:35 +00:00
Adrian Chadd
04b5e02371 Rename some CPU_MIPSxxx options and add new CPU_MIPSxxx options
This revision does the following renames:
CPU_MIPS24KC -> CPU_MIPS24K
CPU_MIPS74KC -> CPU_MIPS74K
CPU_MIPS1004KC -> CPU_MIPS1004K

It also adds the following new CPU_MIPSxxx options:
CPU_MIPS24KE, CPU_MIPS34K, CPU_MIPS1074K, CPU_INTERAPTIV, CPU_PROAPTIV

CPU_MIPSxxxxKC is limiting and possibly misleading as it implies the
MIPSxxxxK CPU has no FPU.
It would be better if the CPUs are named after their standard functionalities
only and the presence or absence of FPU can then be controlled via the
CPU_HAVEFPU option.

I will send out another dependent revision that moves MIPS 32 r2 and r3
CPUs to use the EHB instruction for clearing hazards instead of NOP/SSNOP.

Submitted by:	Stanislav Galabov <sgalabov@gmail.com>
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D5077
2016-02-02 07:47:38 +00:00
Mark Johnston
00b0fb8757 Remove a duplicate setting of the AH_DEBUG_ALQ option. 2016-01-26 01:16:45 +00:00
Adrian Chadd
d5c2c0134b Add initial configuration files for the MT7620 and RT5350 SoCs.
These are all works in progress.  Notably - no wifi support just yet!

I've booted the MT7620 on a TP-Link Archer C2 via tftpboot.

Submitted by:	Stanislav Galabov <sgalabov@gmail.com>
2015-12-25 00:58:41 +00:00
Adrian Chadd
43747185a0 Add missing device rename. 2015-12-24 22:27:00 +00:00
Adrian Chadd
1bbf40fab5 [rt305x] Prepare for the upcoming regime change - add RT305x options.
Submitted by:	Stanislav Galabov <sgalabov@gmail.com>
2015-12-24 18:30:04 +00:00
Adrian Chadd
cd15736797 Add support for the integrated wifi for the QCA953x base config and
AP143.

Tested:

* AP143 reference design board
2015-11-29 05:49:49 +00:00
Warner Losh
29d1144aeb Mark the mostly redundant kernels that just pull
in something from _BASE as NO_UNIVERSE

Differential Revision: https://reviews.freebsd.org/D4200
2015-11-19 01:58:12 +00:00
Adrian Chadd
e69ad1c9b3 Add the QCA9533 base configuration file and an example configuration
for the AP143.

Wifi doesn't work on the QCA9533 board, but basic ethernet/ethernet
and ethernet switch support does work.

The AP143 has 32MB RAM and 4MB flash, so this was tested with a USB
rootfs.

Tested:

* QCA9533v2, AP143 reference design board.
2015-11-18 06:25:25 +00:00
Allan Jude
a065797aa4 Add a kernel config for the Onion Omega
Small $25 IoT device, 400mhz Atheros cpu, Atheros WiFi and Ethernet
18 GPIOs, and support for Relay, Servo, and OLED expansion
https://onion.io/omega/

Reviewed by:	adrian
Approved by:	bapt (mentor)
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D4188
2015-11-17 21:02:27 +00:00
Adrian Chadd
bd1df7e776 Commit the right board file - use the right name + hints. 2015-10-22 15:15:45 +00:00
Adrian Chadd
bb5c955e8d Add support for the TP-Link TL-WR740N v4.
This is an AR9331 part based on the AP121 reference design but with
32MB RAM.  Yes, it has 4MB flash and it has no USB, so clever hacks
are required to get it up and working.

But boot/work it does.
2015-10-22 08:08:06 +00:00
Sean Bruno
205bb74daa Disable SWAPPING as we don't do it on this board. 2015-10-20 19:32:26 +00:00
Sean Bruno
3675892f65 Remove geom_uncompress from TP-MR3020 config. Its now using root on USB
and there's no need for it now.
2015-10-18 18:41:30 +00:00
Sean Bruno
dd9f3185c9 Add VM_KMEM_SIZE_SCALE=1 as these systems are going to have super small
amount of RAM, e.g. 16M or 32M

Reviewed by:	adrian
2015-10-18 18:40:11 +00:00
Sean Bruno
a53f1fce3b Correctly use the default values for location of MAC addrs of arge0,
arge1, ath0.  woo!

Reviewed by:	adrian
2015-10-18 04:50:51 +00:00
Ed Maste
42d17d369b Add Ubiquiti EdgeRouter Lite (ERL) kernel config file
The ERL is a fairly cheap (~$100 USD) and readily available dual core
MIPS64 device so it makes a useful MIPS reference platform.

This is based in part on the kernel config generated by the mkerlimage
script from http://rtfm.net/FreeBSD/ERL/.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3884
2015-10-14 21:10:05 +00:00
Sean Bruno
88a1a27261 Correct flash layout (this is a 4M flash unit).
Remove "rootfs" entry and assign the 800K or so to the kernel
partition as this unit boots from usb mass storage.
2015-10-11 18:37:29 +00:00
Alexander Motin
4a3760bae6 Remove compatibility shims for legacy ATA device names.
We got new ATA stack in FreeBSD 8.x, switched to it at 9.x, completely
removed old stack at 10.x, so at 11.x it is time to remove compat shims.
2015-10-11 13:01:51 +00:00
Sean Bruno
fc28939612 Use machine specific values cleaned from openwrt for the mac address
location on the TP link mr3020
2015-10-11 03:31:11 +00:00
Sean Bruno
6b79bfd0de There's no way a fbsd install + kernel will fit into 4MB of flash.
Assume and enforce the fact that this will always boot a rootfs from
usb.
2015-10-10 19:08:34 +00:00
Adrian Chadd
27b3a39a8f Update the AP135 reference design flash layout to be more useful.
* Shuffle the kernel to be at the beginning
* Give the kernel 2mb, the rootfs 6mb, and 'mib0' the rest
* put the cfg parition just before the ART calibration data for the
  wifi part in the SoC
* .. and make sure ART points to the right 64k region.

I've updated the freebsd-wifi-build wiki the instructions on using this.

If someone has an AP135 with 8MB SPI flash then this won't work; everything
minus the big mib0 partition is just a bit over 8MB.  Come see me if this
ever happens (you'll likely just have to shrink the rootfs and the kernel
a little in order to make it fit.)

Tested:

* AP135 reference board.
2015-10-10 05:00:18 +00:00
Sean Bruno
2bfaedae36 Set correct argemdio addr, comment out arge1 as its not physically
connected to anything.  Move a couple of devices out of the kernel
and into modules.
2015-10-04 22:50:37 +00:00
Sean Bruno
1f6aae90ad Make Broadcom XLR use shared ds1374 RTC driver.
Remove its identical and redundant ds1374u version.

Differential Revision:	D3225
Submitted by:	kevin.bowling@kev009.com
2015-07-29 15:32:59 +00:00
Ruslan Bukin
4ebd95ae06 o Add a description for virtio block device implemented
in PISM (Bluespec C-interface device)
o Add a kernel config

Sponsored by:	HEIF5
2015-07-03 14:46:57 +00:00
Adrian Chadd
b14a705362 Add initial support for the TP-Link Archer C7 v2.
The SoC, the flash, the ethernet ports and ethernet switch all work.
The USB works.

The 11ac PCIe NIC internally is at least seen by the PCIE RC, but
I haven't tried using it yet.  There's no driver and I haven't
yet swapped it out for a non-11ac chip.

The on-chip 2GHz wifi works, but there are some data errors that
get thrown up in STA mode when scanning.  I have a feeling I have
to finish the DDR flush code out and have it run correctly on the
shared interrupts; that'll take a bit of time to get right.

But if you're after an updated piece of hardware, the Archer C7 v2
is certainly there, and you can replace the 11ac NIC with a 3x3
Atheros PCIe device (eg AR9380, AR9390, AR9580, etc) and it'll
"just work".

Tested:

* TP-Link archer c7v2.
2015-07-03 06:09:56 +00:00
Adrian Chadd
212faba17d Add pcb1 to the QCA955x.
The Tp-link Archer-C7v2 unit has a QCA9558 internally but hangs the
QCA988x 11ac PCIe NIC off of PCI RC #1, not #0.

So I actually finally /do/ have a board to verify whether PCIe is working.
Grr.

Tested:

* TP-Link Archer-C7v2.
2015-07-03 06:06:44 +00:00
Mark Murray
d1b06863fb Huge cleanup of random(4) code.
* GENERAL
- Update copyright.
- Make kernel options for RANDOM_YARROW and RANDOM_DUMMY. Set
  neither to ON, which means we want Fortuna
- If there is no 'device random' in the kernel, there will be NO
  random(4) device in the kernel, and the KERN_ARND sysctl will
  return nothing. With RANDOM_DUMMY there will be a random(4) that
  always blocks.
- Repair kern.arandom (KERN_ARND sysctl). The old version went
  through arc4random(9) and was a bit weird.
- Adjust arc4random stirring a bit - the existing code looks a little
  suspect.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Redo read_random(9) so as to duplicate random(4)'s read internals.
  This makes it a first-class citizen rather than a hack.
- Move stuff out of locked regions when it does not need to be
  there.
- Trim RANDOM_DEBUG printfs. Some are excess to requirement, some
  behind boot verbose.
- Use SYSINIT to sequence the startup.
- Fix init/deinit sysctl stuff.
- Make relevant sysctls also tunables.
- Add different harvesting "styles" to allow for different requirements
  (direct, queue, fast).
- Add harvesting of FFS atime events. This needs to be checked for
  weighing down the FS code.
- Add harvesting of slab allocator events. This needs to be checked for
  weighing down the allocator code.
- Fix the random(9) manpage.
- Loadable modules are not present for now. These will be re-engineered
  when the dust settles.
- Use macros for locks.
- Fix comments.

* src/share/man/...
- Update the man pages.

* src/etc/...
- The startup/shutdown work is done in D2924.

* src/UPDATING
- Add UPDATING announcement.

* src/sys/dev/random/build.sh
- Add copyright.
- Add libz for unit tests.

* src/sys/dev/random/dummy.c
- Remove; no longer needed. Functionality incorporated into randomdev.*.

* live_entropy_sources.c live_entropy_sources.h
- Remove; content moved.
- move content to randomdev.[ch] and optimise.

* src/sys/dev/random/random_adaptors.c src/sys/dev/random/random_adaptors.h
- Remove; plugability is no longer used. Compile-time algorithm
  selection is the way to go.

* src/sys/dev/random/random_harvestq.c src/sys/dev/random/random_harvestq.h
- Add early (re)boot-time randomness caching.

* src/sys/dev/random/randomdev_soft.c src/sys/dev/random/randomdev_soft.h
- Remove; no longer needed.

* src/sys/dev/random/uint128.h
- Provide a fake uint128_t; if a real one ever arrived, we can use
  that instead. All that is needed here is N=0, N++, N==0, and some
  localised trickery is used to manufacture a 128-bit 0ULLL.

* src/sys/dev/random/unit_test.c src/sys/dev/random/unit_test.h
- Improve unit tests; previously the testing human needed clairvoyance;
  now the test will do a basic check of compressibility. Clairvoyant
  talent is still a good idea.
- This is still a long way off a proper unit test.

* src/sys/dev/random/fortuna.c src/sys/dev/random/fortuna.h
- Improve messy union to just uint128_t.
- Remove unneeded 'static struct fortuna_start_cache'.
- Tighten up up arithmetic.
- Provide a method to allow eternal junk to be introduced; harden
  it against blatant by compress/hashing.
- Assert that locks are held correctly.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Turn into self-sufficient module (no longer requires randomdev_soft.[ch])

* src/sys/dev/random/yarrow.c src/sys/dev/random/yarrow.h
- Improve messy union to just uint128_t.
- Remove unneeded 'staic struct start_cache'.
- Tighten up up arithmetic.
- Provide a method to allow eternal junk to be introduced; harden
  it against blatant by compress/hashing.
- Assert that locks are held correctly.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Turn into self-sufficient module (no longer requires randomdev_soft.[ch])
- Fix some magic numbers elsewhere used as FAST and SLOW.

Differential Revision: https://reviews.freebsd.org/D2025
Reviewed by: vsevolod,delphij,rwatson,trasz,jmg
Approved by: so (delphij)
2015-06-30 17:00:45 +00:00
Allan Jude
5b889f3ddb Add if_vlan, ipfw{,_nat}.ko, and libalias to the AR934X kernel config
This makes the TP-Link WDR3600 routers more useful

Differential Revision:	https://reviews.freebsd.org/D2780
Approved by:	adrian
Sponsored by:	ScaleEngine Inc.
2015-06-13 06:09:00 +00:00
Adrian Chadd
5b53111b63 Cope with .. less memory. 2015-06-08 03:01:19 +00:00
Adrian Chadd
d395135696 Convert routerstation to use geom_uncompress. 2015-05-19 06:45:56 +00:00
Adrian Chadd
946b5412be Migrate RSPRO to use the uncompress module, not uzip.
(This is hand-in-hand with what I'm about to do with freebsd-wifi-build.)
2015-05-19 06:45:06 +00:00
Adrian Chadd
3d191bf47c QCA955x / AP135 platform tidyups.
* Change mips24k -> mips74k for hwpmc, but leave it disabled for now.
* don't build pci by default.
* build pci and qca955x_pci for AP135, as theres a PCIe NIC.
* don't build a hwpmc module, it doesn't really work out well
  for the mips boards at the moment.
* add ipfw and DEFAULT_TO_ACCEPT.
2015-05-19 05:41:00 +00:00
Adrian Chadd
3cbe641352 The AP135 PCIe NIC isn't an ath device, it's an 11ac part (linux ath10k.)
So, don't try to attach hints to it here.
2015-05-19 05:33:07 +00:00
Adrian Chadd
517aea2c14 Start enabling the available GPIO pins on the Carambola 2.
The carambola2 exposes all the gpio pins, but some are reserved for
core functions (eg usb, ethernet, etc.) Others are configured by default
to be available as normal GPIO pins to do interesting things with.

GPIO 18->23 is the I2S, SLIC and SPDIF device pins, but none of those
are currently used.  So, just allow those to show up.

Tested:

* AR9344, Carambola 2
* (.. bitbang SPI to an Adafruit LCD via libgpio, because FreeBSD could
  do with more shiny output devices that aren't network interfaces.)

TODO:

There are some other pins aren't currently included here, but should be.
The LED pins are for the internal switch inside the AR9344.

* GPIO 0+1 are "LED0 + LED1", but they're tied to high for bootstrapping.
* GPIO 13-17 are "LED2..7", but they're tied (H, L, L, L, H) for bootstrapping.
* GPIO 11 and 12 are UART RTS/CTS or I2S; but GPIO 12 is tied L for bootstrap.
2015-04-12 00:02:32 +00:00
Adrian Chadd
c2dc6e2aab Convert the DIR-825C1 to use the new map based MAC address configuration.
Tested:

* DIR-825C1
2015-04-05 22:00:44 +00:00
Adrian Chadd
e1f0bb305b Update the board MAC address configuration for the DIR-655A1.
The MAC addresses were totally wrong. They're like the DIR-625C1 - at
0x1ffe0004 and 0x1ffe0018. They're however stored as text strings.
The ath0 MAC address is also not set, even though the calibration
partition is valid.

So, pick the board address / first MAC as the ath0 MAC, and derive
arge0/arge1 from that.  That way they're hopefully unique enough
for people with multiple devices.

Tested:

* DIR-655A1

TODO:

* Do the same for the DIR-625A1 and DIR-625C1.
2015-04-05 20:56:51 +00:00
Adrian Chadd
34a3c98143 Migrate the TL-WR1043nd v2 to use the new map based MAC hints mechanism.
This programs separate, correct mac addresses for the ethernet and
wlan interfaces.
2015-04-01 06:44:39 +00:00
Adrian Chadd
e133fa3e58 Add hints to set the board MAC address and derived values for each interface.
This allows the TL-WDR3600 to use the correct MAC address for ath0, ath1
and arge0.  arge1 isn't used; until I disable it entirely it'll just
show up with a randomly generated MAC.
2015-03-28 23:42:59 +00:00
Adrian Chadd
746e48e321 Remove the second MODULES_OVERRIDE; add if_vlan to the list. 2015-03-28 23:01:59 +00:00
Adrian Chadd
b7ece01c7e Add the MAC address hints for arge0/arge1 on the CARAMBOLA2.
Obtained from:	Linux OpenWRT
2015-03-28 19:59:33 +00:00
Adrian Chadd
e6b369a09c Set VM_KMEM_SIZE_SCALE=1 for the AR91xx SoCs.
Without this the autotuning fails for small amounts of RAM (32mb),
which all the AR91xx shipping products seemed to have.

Thanks to gjb for reminding me to re-test this stuff.

Tested:

* AR91xx, TP-Link TL-WR1043nd v1
2015-03-28 06:54:18 +00:00
Glen Barber
a3ea67c7f9 Remove duplicate AH_DEBUG_ALQ option.
Sponsored by:	The FreeBSD Foundation
2015-03-26 12:58:30 +00:00
Adrian Chadd
75fa40f89c Add initial D-Link DIR-655 (A1) support.
This is based on the AP135 design - QCA9558 SoC, 3x3 2GHz wifi, but no
5GHz (11n or 11ac) chip is available.

It however still has 128MiB of RAM, 16MiB of NOR flash and the AR8327N
gigabit switch - so it's quite a beefy router device.

Tested:

* Well, a unit, naturally

Obtained from:	Completely messing up an amazon.com order and getting this instead, and asking "hey, wonder if I could.."
2015-03-22 02:15:09 +00:00