Commit Graph

113 Commits

Author SHA1 Message Date
Christopher Anderson
0b3c554c4c [gem] Add a command for stack stats and descriptor status 2015-09-02 14:29:01 -07:00
John Grossman
8a7219ddb1 [lib][bio] Add erase geometry to lib/bio
Extend the block i/o system to allow registered devices to advertise
an erase geometry.  Devices which do not need to be explicitly erased
may skip this.  Extent the Zynq spiflash code to publish the erase
geometry as read from the flash device.

Signed-off-by: John Grossman <johngro@google.com>
Change-Id: I42e16fbe9a0fcf8334c317f16dea1c551c203eb2
2015-06-29 17:32:10 -07:00
Travis Geiselbrecht
f45b123db0 [platform][zynq] save the reboot status register and clear reason bits
Pretty print the reason bits.
2015-06-19 15:36:56 -07:00
Travis Geiselbrecht
5f16c6e93b [arch][arm] change conditional to only cover waiting for secondary cpus
Instead of conditionalizing arch code booting secondaries, only conditionalize
waiting for each of them to come up.

This should be semi-temporary, as the need to wait will go away once arm
switches entirely to the trampoline page table strategy.

Change-Id: Idbdb9720bfac58adf514b7fa137e59aee413f4df
2015-06-02 13:39:15 -07:00
Travis Geiselbrecht
bb15480a66 [platform][zynq][gem] hold the gem spinlock across the entire irq handler
Change-Id: Ifc88db88f60e1f6381a9d7195cfea6bffa02fa7a
2015-06-01 19:08:11 -07:00
Travis Geiselbrecht
2362022970 [arch][arm] conditionalize the code to boot the secondary cpus in arch_init()
On some platforms, the secondary cpus have been booted and trapped by the arch/arm code
and need to be brought up lockstep to make sure the temporary page mappings are
still in place as they are booted. For these platforms, set
ARM_ARCH_BOOTS_SECONDARIES=1 to have arch_init() try to release and start the cpus.

For other platforms, after arch_init() they can simply arrange for the secondary cpus
to start themselves.

Change-Id: I7619ac66d84bd26060ddd949ae6641c1ef6e2b1d
2015-06-01 18:35:25 -07:00
Travis Geiselbrecht
5635ef811d [platform][zynq] fix double acquire of spinlock
Change-Id: Ia0ac5e1e2cdc51d616676b7fd34f1976b171a01e
2015-05-29 15:18:52 -07:00
Travis Geiselbrecht
96ba54f187 [merge] merge back from smp branch 2015-05-28 12:52:41 -07:00
Travis Geiselbrecht
056b30bfe7 [app][lkboot] ask platform code if we should autoboot before booting
-have the zynq nak autobooting if the BOOT_MODE pins were set to
JTAG mode.
-Clean up some of the timeout logic a bit.

Change-Id: I4ace6354de89f2e88aa270e5ebc1bf01ebe3b046
2015-05-20 23:31:39 -07:00
Travis Geiselbrecht
f13ebc12f5 [platform][zynq] add code to read the BOOT_MODE pins sampled at power on
Change-Id: I2745b4aa5d63f1f8d6630836fec88ae0577feb7d
2015-05-20 23:31:39 -07:00
Travis Geiselbrecht
307628f29b [platform][zynq] add watchdog driver
-use lib/watchdog to manage the hardware watchdog driver
-set the default timeout to 1 second, pet at 500ms intervals

Change-Id: I04d23313083e4715791e197d4a50f319df9916aa
2015-05-20 23:31:39 -07:00
John Grossman
c2b645ef8a [zynq][gpio] Fix a collection of bugs with the GPIO driver.
+ When setting GPIOs, the MASK_DATA registers are used.  Code was
  properly computing which register to use based on register index
  (either LSW or MSW), but was improperly computing the mask/value to
  set when the GPIO to be manipulated existed in the upper 16 bits
  (the shift needed to be offset by 16 bits and was not).
+ Do not manipulate things like the IO driver type, drive speed, and
  so on when enabling/disabling the pullup in the SLCR registers.
  Previously, whenever a GPIO was being configured, the SLCR register
  was being set to be 1.8v LVCMOS, and having the DISABLE RCV bit set.
  Things like the IO type have been set by the platform and should not
  be manipulated by the GPIO driver.  Now, the GPIO code leaves those
  bits the way they were configured, and changes only the PULLUP bit
  as well as the 4 levels mux bits (arguably, it should not even
  change the mux bits; it is the platform's job to properly mux the
  pins).
+ Address an issue with the subtle (undocumented) difference between
  the DIRM and the OEN bits when configuring for input vs. output.
  Please read the extensive comment in the code for details.

Change-Id: I160069eeef92b1cf0763274ccb64c5d14744f563
Signed-off-by: John Grossman <johngro@google.com>
2015-05-19 10:21:33 -07:00
Arve Hjønnevåg
2c9c5959e7 Merge branch 'master' of https://github.com/travisg/lk into smp
Change-Id: Iecb11d57b6f089234c0826932bdb229588939750
2015-05-18 16:49:37 -07:00
John Grossman
1f2e62da4d [zynq][gpio] Fix a typo in the GPIO code.
Fix an issue with the GPIO code where it was dividing by 31 instead of
32 when attempting to map GPIO numbers to bank IDs.

Change-Id: I986eac1f9dce119445d1611666b61a7b2635ca5b
Signed-off-by: John Grossman <johngro@google.com>
2015-05-18 14:42:51 -07:00
Travis Geiselbrecht
b49071770d [zynq][gem] fix newly introduced bug setting up tx descriptors for the first time
Change-Id: I04b174fa9bde08b8a5a334bd33e049f8e445bb91
2015-05-07 19:39:48 -07:00
Travis Geiselbrecht
71313ca6e6 [platform][zynq][gem] flatten all the gem tracking registers into a single structure
This actually manifests itself as a slight win performance wise, due
to better codegen with all the variables being near each other.
2015-05-06 16:45:07 -07:00
Travis Geiselbrecht
da74d15562 [platform][zynq] a few tweaks to the gem driver to use cached pktbuf ram
-handle flushing tx/rx buffers
-tweak tx logic to handle multiple tx descriptors per interrupt
-fix subtle race with tx dma engine as descriptors are filled
2015-05-06 14:18:06 -07:00
Travis Geiselbrecht
5b830de81f [zynq-common] squelch a little bit of debug spew when compiling at lower debug levels 2015-05-02 22:48:57 -07:00
Travis Geiselbrecht
73e39eab9a [lib][minip] add reschedule arg to pktbuf_free
Make sure the zynq gem driver doesn't reschedule at interrupt time.

Change-Id: Ieaf56930253bf9e2ebb68001a62f986ea2a50a0c
2015-04-29 15:54:00 -07:00
Travis Geiselbrecht
80b3d58178 [platform][zynq] remove some extraneous debug commands at lower debug levels
Change-Id: Ib29b125d393090978f6bab32779edb934201a902
2015-04-24 15:53:55 -07:00
John Grossman
43d86bfdb0 [zynq][fpga] Add a function to check the FPGA config status.
Add a small function which checks to see if the FPGA has been
successfully configured yet.

Change-Id: If7c8f4f006b54958cf3052bb5962c964668cd5a9
2015-04-24 15:53:55 -07:00
Christopher Anderson
4a038ceef6 [zynq] Add support for GPIO interrupts 2015-04-23 13:30:39 -07:00
Christopher Anderson
d352ac1d2b [gem][minip][pktbuf] Improvements for TX scatter gather functionality
- GEM now supports asynchronous scatter-gather queuing and properly handling
  pktbuf ownership
- General stack cleanups in Minip
- pktbufs now grab buffers from the user, or from a preallocated pool
2015-04-23 13:30:39 -07:00
Christopher Anderson
165a69ebf0 [zynq] gpio driver cleanup and plumbing for later int work 2015-04-03 16:49:46 -07:00
Christopher Anderson
ffbb7b8fd3 [zynq] Add MIO_DEFAULT and correctly ignore MIO configuration based on that rather than 0 2015-04-02 11:03:55 -07:00
Travis Geiselbrecht
233ec94538 [platform][zynq] change SMP to be conditionally on, overrideable in project/target 2015-03-31 15:43:47 -07:00
Travis Geiselbrecht
29b9ed8658 [platform][zynq] in smp mode, pass through the secondary start trampoline 2015-03-31 15:35:45 -07:00
Travis Geiselbrecht
80fbfef0e1 [merge] merge branch 'master' into smp
Conflicts:
	kernel/vm/pmm.c
	platform/zynq/debug.c
	platform/zynq/platform.c
2015-03-31 15:35:13 -07:00
Travis Geiselbrecht
f64743d91d [platform][zynq] set SMP cpu count to 2, convert gem driver to spinlocks 2015-03-27 21:43:29 -07:00
Travis Geiselbrecht
65cec8ef65 [platform][zynq] add a simple gpio driver
Change-Id: I123ff3cc0523d97ccb85129da872ac3cac07c65d
2015-03-23 16:30:43 -07:00
Travis Geiselbrecht
dc8a44f5b8 [platform][zynq] halt the cpu when paniced
Change-Id: I96cabb7f713dc52c25dcff7cdb9f2c1fec5c9480
2015-03-19 20:50:35 -07:00
Travis Geiselbrecht
8c1f3b0809 [platform][zynq] trap the second cpu in lk's image to reclaim the last 64k of sram
Change-Id: I7eb6787f967f037670bddbe0eeaa4fb384e04d83
2015-03-19 20:50:11 -07:00
Travis Geiselbrecht
84ab5f65e4 [platform][zynq] if not initializing sdram and sdram_size == 0, power off the ddr pll
also consolidate some debug commands

Change-Id: Ibd10f77f1e536884f7da249d75711099f6d7944b
2015-03-19 15:11:52 -07:00
Travis Geiselbrecht
52c18ef50a [platform][zynq] boottime configuration updates
-statically configure more clk registers at boot
-configure the same number of MIO regsters for 225 vs 400 pin packages

Change-Id: Ib8aab1546ce743d1a58343d492af7626c8b5ce7e
2015-03-18 19:26:46 -07:00
Travis Geiselbrecht
5cea44316c [platform][zynq] make building gem/minip optional, make initializing sdram optional
Change-Id: Ia499573363fcf9b60a7338e072ea21f72e7e4eee
2015-03-17 17:47:54 -07:00
Travis Geiselbrecht
f5bba00e01 [platform][zynq][gem] move the register pointer setting earlier in gem_init
Change-Id: I5d5f6a8b7a47ae9c6184b5029199b057957c264b
2015-03-17 17:47:15 -07:00
Travis Geiselbrecht
99c00354eb [platform] convert platform code for alterasoc, vexpress-a9, and zynq to SMP 2015-03-10 16:43:55 -07:00
Travis Geiselbrecht
dc2066bc79 [platform][zynq] add some tracing options for the fpga programming code
Slight code cleanup as well.
2015-03-03 14:54:22 -08:00
Travis Geiselbrecht
a173db1b31 [platform][zynq] add timeout to fpga programming code, only dma 4 byte words (/4) 2014-12-11 20:01:11 -08:00
Travis Geiselbrecht
68f935e613 [platform][zynq] add support for putting the qspi peripheral in linear mode 2014-12-11 19:25:29 -08:00
Chris Anderson
5ed4eca1ba [zynq] Add slcr commands and pull out DDR config 2014-11-21 10:37:00 -08:00
Chris Anderson
67eba69600 [gem] Make TX path asynchronous 2014-11-21 10:37:00 -08:00
Travis Geiselbrecht
90d4cf1e3f [platform][zynq] extend gem test routine to take packet size
Change-Id: I44b3bb228a55858a2443a0057db9d97095d2870f
2014-10-21 13:29:19 -07:00
Travis Geiselbrecht
199e94c63c [platform][zynq][gem] put the GEM driver in cached mode
Add appropriate flushing for the TX and RX path
2014-10-19 00:29:47 -07:00
Travis Geiselbrecht
1baac2f315 [zynq][spiflash] wait a bit before rereading cr1 register
Change-Id: Ie791fb689f9c2bac9127ae27ac3a83274f67755a
2014-10-15 18:13:24 -07:00
Travis Geiselbrecht
0b9a33463f [zynq][spiflash] write enable before using the cr1 write routine
Change-Id: Id3dbffee2438bfca3208884b4a46cffeb79eccf2
2014-10-15 18:10:04 -07:00
Travis Geiselbrecht
98283e9610 [zynq][qspi] properly remember the current speed setting
-this was causing the spiflash driver to drop to 50mhz and never go back to 100

Change-Id: If231f5b0281b17001abfbafd50afa9eb8a7a77cb
2014-10-13 19:27:23 -07:00
Travis Geiselbrecht
a88d310855 [platform][zynq] detect flash in single spi mode and add command to set qspi mode
Change-Id: I3d0ea403c79f9b7a8c34c9f871e97bd728b46d7f
2014-10-13 19:08:22 -07:00
Chris Anderson
a112873487 [zynq][gem] Move uzed and zybo gem inits to target 2014-10-10 14:56:38 -07:00
Chris Anderson
65e4028ddc [zynq] Setup eth1 clocks 2014-10-10 14:21:39 -07:00