Commit Graph

3119 Commits

Author SHA1 Message Date
matt
075e272fa0 On Cortex, speculative loads can cache lines to be populated after then they've
been invalidated for a DMA read.  So after the DMA read we have to reinvalidate
them again.  We have to both invalidates since the former prevents dirty lines
overwriting just DMAed data.
2013-01-16 22:32:45 +00:00
macallan
1483daf6ab copy data in 32bit chunks whenever alignment permits
-> very noticeable speedup
2013-01-16 20:34:10 +00:00
macallan
72eb09896d fix some bit #define, now the name actually makes some sense 2013-01-16 20:32:24 +00:00
jmcneill
a04b60d0f0 MPU_* registers are not valid for OMAP3, so restrict access to them to
OMAP2 boards.
2013-01-16 03:30:48 +00:00
macallan
8760ecba75 implement right to left and bottom to top blits, now scrolling works right
in all directions.
while there, fix the xor mask for the cursor attribute - now it's actually
inverted
2013-01-16 00:09:27 +00:00
skrll
1228c04a6e Simplify by using PMAP_NOCACHE 2013-01-13 06:10:25 +00:00
matt
92b7334f0f Don't install fp.h anymore 2013-01-11 14:09:54 +00:00
matt
cc1e101e52 Don't include <machine/fp.h> since it no longer exists 2013-01-11 14:04:55 +00:00
matt
bcca54655d Remove FPA specific header. 2013-01-11 14:03:03 +00:00
matt
cc0f73fd1f Remove FPA support and replace with VFP.
(happily jmp_buf is large enough to store the needed VFP16 registers)
2013-01-11 13:56:32 +00:00
matt
e29ecd6857 Fix a bug in pmap_modify_pv where we didn't set PVF_WRITE on a page after
changing its mapping to writeable.
Add more KASSERTS
Don't go into DDB by default in pmap_fixup.
2013-01-11 12:04:00 +00:00
matt
16b1a4f53d Don't hard code the frequency used for INTRCVLAZY but grab the correct
frequency from the cpu_softc.
2013-01-10 22:07:19 +00:00
matt
a3cac63a0e Use the clk_info in cpu_softc. 2013-01-10 22:06:32 +00:00
jmcneill
4150d24789 basic mmap support, ok skrll 2013-01-10 21:57:38 +00:00
jmcneill
790bc42378 reinstate SDHC_HIGH_SPEED_SUPP capability, and add SDHC_FLAG_NO_HS_BIT flag to workaround bcm2835 sdhc issue with many high speed cards 2013-01-10 17:21:36 +00:00
jmcneill
5810b6bbe7 only print switching to fb message if genfb is console 2013-01-10 14:12:16 +00:00
jmcneill
bcf1f8eea8 Don't set SDHC_HIGH_SPEED_SUPP in host caps as many cards stop responding
after the switch to high speed mode.
2013-01-10 03:59:22 +00:00
jmcneill
e1e890627d bcm2835 watchdog timer support 2013-01-10 02:23:26 +00:00
macallan
8e0ecbc573 implement omapfb_mmap() - now X with wsfb works 2013-01-10 02:18:06 +00:00
jmcneill
5681b93d0e If genfb.type=<int> is passed on cmdline, override the wsdisplay type
returned by WSDISPLAYIO_GTYPE ioctl.
2013-01-09 23:58:40 +00:00
skrll
0b453b8d4b Provide dotg(4) - a driver for the Synposys DesignWare OTG USB IP found
in the RaspberryPI. The driver supports host mode and control, interrupt,
and bulk transfers only at this point.

Heavily based on the FreeBSD driver by Hans Petter Selasky.

Thanks to all who helped. Jared McNeill, Michael van Elst and other.
2013-01-09 22:23:44 +00:00
matt
737b720dde Don't rely on PKTTYPE in the rxsts since it becomes unreliable. 2013-01-09 18:19:09 +00:00
matt
b36e44e7ce Handle BUS_SPACE_MAP_PREFETCHABLE like BUS_SPACE_MAP_CACHEABLE. 2013-01-09 17:45:13 +00:00
macallan
ec14d8bfde remove debug cruft 2013-01-09 04:52:47 +00:00
macallan
0b95bee04c omapdma needs-flag now 2013-01-09 04:49:05 +00:00
macallan
0926576008 if omapdma is present, (ab)use channel 0 for basic graphics acceleration
idea from RISC OS
2013-01-09 04:40:46 +00:00
macallan
a99e9d499e do some more setup, while there fix a bunch of typos 2013-01-09 04:38:14 +00:00
macallan
b4f7590656 omapdma* -> omap3_sdma* 2013-01-09 03:35:11 +00:00
jmcneill
1f7593441b aprint_verbose -> aprint_debug 2013-01-09 01:57:59 +00:00
jmcneill
3ccf78bfe7 add genfb glue 2013-01-08 23:52:48 +00:00
jmcneill
6ed7299e5c add fb and dotg devices 2013-01-08 23:51:33 +00:00
skrll
a9b146de5a Fix BCM2835_USB_SIZE. 2013-01-08 21:58:40 +00:00
macallan
a33b98edb0 add a simple driver for OMAP3's built-in DMA controller 2013-01-08 19:03:16 +00:00
skrll
167a48ec70 Sprinkle needs-flag 2013-01-08 16:24:23 +00:00
skrll
18ad95daea Whitespace 2013-01-08 12:15:42 +00:00
skrll
172593ef18 Trailing whitespace 2013-01-08 12:13:58 +00:00
jmcneill
3f943dffbb serialize bcmmbox_request 2013-01-08 09:11:11 +00:00
jmcneill
e27de4fba2 allow for a single board specific device to attach to the mbox driver 2013-01-07 20:15:32 +00:00
jmcneill
e892f15350 emmc supports 1k block size, so set SDHC_MAX_BLK_LEN_1024 in host caps 2013-01-07 13:23:46 +00:00
jakllsch
74dad3229c Add driver for BCM2835 SPI0 controller. 2013-01-05 20:31:23 +00:00
jakllsch
605407517d Add driver for Broadcom Serial Control (I²C) master on BCM2835. 2013-01-05 20:15:17 +00:00
jakllsch
4f7412af4d Add a function for adjusting the pin muxer in the GPIO block.
(This should probably be revisited later.)
2013-01-05 19:55:18 +00:00
jakllsch
1dc05e277c Whitespace style adjustments. 2013-01-05 19:47:17 +00:00
jakllsch
f8c023710e The BSC (I²C) interrupt is actually shared between (at least) the BSC0 and
BSC1 units, so don't name it as belonging to only BSC0.
2013-01-05 19:44:44 +00:00
christos
bd1c8509d7 remove show panic cmd 2013-01-05 15:06:51 +00:00
jakllsch
2db6832d7c Use config_stdsubmatch() to enable (optional) use of locators on obio devices. 2013-01-04 21:00:23 +00:00
jakllsch
19bc285103 Add driver for TI CPSW Ethernet on TI AM335x SoCs.
Portions of this driver are derived from FreeBSD's cpsw(4).

Developed and tested on a BeagleBone.
2013-01-03 21:13:26 +00:00
jmcneill
612297b23e If EDID is supplied, parse and print it. While here, try not to crash
if is_console is false.
2013-01-01 23:22:44 +00:00
jmcneill
39c8eada8e add a function to lookup the i2c controller tag for the specified device_t 2013-01-01 23:20:24 +00:00
jakllsch
60d3e1aba4 Hook up generic_bs_sr_4 for bus_space_set_region_4 in the OMAP bus space. 2013-01-01 17:28:27 +00:00
jmcneill
58b12b0f42 Add OMAP3530 temperature sensor support 2013-01-01 13:05:21 +00:00
jmcneill
4a745538bc reset todr clock on shutdown 2012-12-31 21:34:31 +00:00
jmcneill
cd6325cba1 beagleboard supports 8-bit SD mode 2012-12-31 13:20:16 +00:00
jmcneill
802b3063a6 Add OMAP3530 I2C support 2012-12-31 12:45:49 +00:00
skrll
ebfcd7f4ed At each function level print a useful offset (as also shown in rlv)
OK from gimpy
2012-12-31 08:57:27 +00:00
matt
a3f59f9868 Always re-enable the VFP when loading for a kernel LWP. 2012-12-31 03:23:53 +00:00
matt
1e9ef444c0 Correct one of the kernel_size calculations. 2012-12-31 01:23:31 +00:00
matt
b17bcc6bf4 Switch to using vfp_kernel_{acquire,release} so that softints don't cause
the VFP to become disabled.
2012-12-31 01:19:36 +00:00
matt
08e4b731e6 print the PC of the VFP kernel fault in the panic message. 2012-12-31 00:01:48 +00:00
riz
6b151fea8c In kernel tickle mode, tickle once immediately upon setting the mode.
Works around a peculiarity where the first watchdog period (only) on the
BeagleBone is only half as long as expected.
2012-12-29 04:59:21 +00:00
jmcneill
ae40238ab7 no need to print irq twice 2012-12-29 00:08:26 +00:00
jmcneill
5049e6aa84 dont set SDHC_FLAG_SINGLE_ONLY for OMAP3530 either 2012-12-29 00:05:45 +00:00
msaitoh
d378899cf3 Enable DCache Streaming Switch and Write Allocate for Sheeva CPU.
This change improve system performance significantly.
2012-12-28 03:48:00 +00:00
matt
fecfceb41a Add not-yet-enabled code to use vfp_kernel_{acquire,release} 2012-12-26 18:35:47 +00:00
matt
adeb5a5214 Add support for PCU_KERNEL and vfp_kernel_acquire/vfp_kernel_release.
Add an undefined handler to catch NEON instructions.
2012-12-26 18:34:56 +00:00
matt
024608da0e Add vfp_kernel_acquire and vfp_kernel_release prototypes. 2012-12-26 18:32:41 +00:00
matt
a2f743a4c3 Remove pcb_fpstate.
Add pcb_kernel_vfp.
2012-12-26 18:32:01 +00:00
matt
8daebbc807 Fix comment. Add MDLWP_VFPINTR 2012-12-25 22:34:36 +00:00
matt
98afdbcba0 Add CP15 Generic Timer definitions.
Add cortex PMUSERENR inlines
2012-12-25 22:33:39 +00:00
matt
9176544926 Change the way rx are consumed. Only consume a 1/4 of the receive buffers
before refilling with new buffers.  Don't stop until there are no packets
left to receive.
2012-12-25 21:17:40 +00:00
kiyohara
cb96e275df Don't wait DPLL5 lock, if set to automatic mode. It is locked by 120 MHz
being supplied.
Also enable EN_USBHOST2(120MHz) in usbhost_init().
2012-12-24 06:41:02 +00:00
kiyohara
d127ce65d4 Add gpio6 to critical_devs[]. This required by some boards. 2012-12-24 06:28:55 +00:00
jakllsch
67d7dad798 TI_AM335X SDHCI does not need SDHC_FLAG_SINGLE_ONLY. This was
drastically hindering transfer rate performance.

I suspect SDHC_FLAG_SINGLE_ONLY is bogus on most/all other TI-flavored
SDHCI cores as well, but I am unable to confirm.
2012-12-23 18:34:01 +00:00
jakllsch
c0d7cbcbb3 The BCM2835 reference says the SDHC_HIGH_SPEED bit in SDHC_HOST_CTL is
implemented, so add SDHC_HIGH_SPEED_SUPP to the software-implemented
SDHC_CAPABILITIES register.
2012-12-23 18:26:16 +00:00
matt
26c0064a49 Conditional execution still takes one cycle per skipped instruction.
branch to unlikely cases instead of conditionally skipping them.
2012-12-23 13:26:21 +00:00
matt
721d83f761 Make inner loop do up 128 bytes into one shot.
Reorganize the code that deals with non-dword starts.
2012-12-23 13:24:22 +00:00
matt
f1811fc942 Generate the trailing mask at the start and put it and the starting address
in r11/r10 and use them as need.  Always round the length endian address to
a word boundary.  Unconditionally apply the trailing mask at the end since
it's a cheap op.
2012-12-23 03:44:24 +00:00
matt
17511a3ef4 Rework considerably. Use alternating sets of registers.
(Still not faster than normal ARM code).
2012-12-22 18:58:29 +00:00
matt
2c76bd3255 When doing 16 bytes at a time, alternate register sets to reduce load stall
times.
2012-12-22 08:12:26 +00:00
matt
6f4687f9a5 Always round up to word lengths. 2012-12-22 08:10:40 +00:00
matt
3fdd59ce12 More optimizations (have separate 64-byte loop which alternates loads
and add of different registers).  Be more consistent on endian issues.
Use pld.
2012-12-21 06:35:34 +00:00
matt
4ccd5607a0 Add fast path for dealing with a single 32-bit word at the end. 2012-12-20 08:03:21 +00:00
matt
c0946adbff Add $NetBSD$ 2012-12-20 07:20:04 +00:00
matt
69105f68aa Make this work. Various fixes and some further optimizations. 2012-12-20 07:18:33 +00:00
matt
6fd79daca4 Move loading of r1 with 0xffff to cpu_in_cksum_fold.S 2012-12-20 07:16:00 +00:00
matt
8774e5e119 Move the final ip checksum to a common file to be included.
Add a generic ip checksum calculator for a buffer (ptr/len).
2012-12-19 15:05:16 +00:00
matt
3a9c3dd87a Use max_linkhdr to determine what rcvoffset to program. 2012-12-19 02:44:39 +00:00
matt
4df9023ec8 Add ldrd support (one additional instruction over 5 ldrs) but two of them
won't be executed resulting in 2 less loads which should save a few cyles.
2012-12-18 14:08:25 +00:00
matt
d5f77a1ef1 Add a routine to compute the IP checksum of a 20-byte IP header. 2012-12-18 13:41:42 +00:00
matt
079b06266e Start adding support for disassembling some NEON instructions. 2012-12-18 06:31:58 +00:00
matt
52be9411ef Remove unneeded definitions.
When forking a LWP, disable the VFP in the new LWP since it isn't the LWP
that owns the VFP.
2012-12-18 06:30:18 +00:00
matt
9529d9505a Tighten up cpu_in_cksum_neon_v4hdr by 3 instructions.
Swap the doubles on a partial qword load on BE platforms.
2012-12-18 06:05:56 +00:00
matt
fc5bdb5822 Make sure to load the FPEXC context on context switch (if there a VFP) so
that the VFP state will be what the LWP expects.  (This isn't needed on
PPC or MIPS since their FPU/VEC state is reflected in the PSL/CPO_STATUS
which is handled automatically.)
2012-12-17 17:45:01 +00:00
matt
c6f05c9a80 Add CPU_VFP_ID and PCB_VFP_FPEXC 2012-12-17 17:10:48 +00:00
matt
6df5b9a309 Add preliminary version of a NEON based in_cksum routine. 2012-12-17 00:44:03 +00:00
jkunz
c332c3c01b Contribution from Petri Laakso: Initial support for SD card controller.
iMX233-OLinuXino can now boot and run from its own SD card.
2012-12-16 19:45:52 +00:00
jkunz
8a7d722d8b Contribution from Petri Laakso: Fix some spelling. 2012-12-16 19:40:00 +00:00
riastradh
98770c509f Implement TI AM335x's SDHC reset quirk. Beaglebone SDHC works now!
On the AM335x, we first must wait for the controller to acknowledge
the reset; then we can wait for the reset to complete.

I believe this quirk also applies to the OMAP4 ES, but I don't have
one of those to test and we don't seem to have an obvious conditional
for it anyway.

This quirk may work for controllers that don't require it too, but I
am nervous about doing it by default because if we miss the reset
acknowledgement, then we'll just time out even though everything is
really hunky-dory.

Also, for all sdhc, don't bother writing 0 in sdhc_soft_reset while
waiting for the reset to complete; there is no need.

ok matt
2012-12-13 06:43:37 +00:00
jakllsch
d2066ccadf software-initiated-reset glue for AM335x on BeagleBone 2012-12-13 02:12:15 +00:00
matt
553b4049c5 Add SDRC and I2C bases for OMAP3xxx 2012-12-13 01:15:50 +00:00
matt
93c6d75137 Improved SDHC support for OMAP3.
From jmcneill.
2012-12-12 15:19:53 +00:00
matt
93c3ea0a2c Protect more definitions with #ifndef _LOCORE 2012-12-12 15:09:37 +00:00
matt
1153693c28 Improved USB EHCI support OMAP3 variants.
From jmcneill.
2012-12-12 00:33:45 +00:00
matt
98ebdb3421 Enable direct-mapped poolpages if __HAVE_MM_MD_DIRECT_MAPPED_PHYS is defined. 2012-12-12 00:29:17 +00:00
matt
ad978013b0 When initializing the ethernet, make sure the IO_CONTROL_DIRECT IDM register
is set properly.
2012-12-12 00:01:28 +00:00
matt
641883151f Add IO_CONTROL_DIRECT register values. 2012-12-12 00:00:38 +00:00
matt
5c340aed67 Use RET, not bx lr.
Due to evbarm/conf/INTEGRATOR conditional use of pld.
2012-12-11 23:59:18 +00:00
matt
905eecf6c7 Fix C&P bug. 2012-12-11 23:51:34 +00:00
matt
784a6ad142 Don't steal the console by default. 2012-12-11 22:47:40 +00:00
macallan
01002f0e04 different u-boot versions set up the video hardware in different ways, make
sure we can deal with both
2012-12-11 21:57:41 +00:00
riastradh
10e52c1da0 Initial kludgerific attempt at making sdhc work on the AM335x.
There's a timing issue somewhere in the whole sdmmc thing so that
this doesn't actually work without SDMMC_DEBUG or some specially
crafted debugging messages, and the SoC-specific code needs to be
separated out here another way, but it's a little progress.
2012-12-11 19:26:40 +00:00
riastradh
6c00237a82 Detect the AM335x CPU frequency on the beaglebone. 2012-12-11 19:24:38 +00:00
riastradh
572635e572 Hook up all the new AM335x files. 2012-12-11 19:21:05 +00:00
riastradh
7e93cad334 Make the interrupt controller and PRCM critical for the AM335x.
This adds some more crufty #ifdefs to a mess that needs to be
rototilled, but it'll do to make progress for now.
2012-12-11 19:18:56 +00:00
riastradh
460fd6b039 AM335x driver attachment goop for omapdmtimer. 2012-12-11 19:06:23 +00:00
riastradh
ef1342fc22 New driver for OMAP-style dual-mode timers, for both v1 and v2 cores. 2012-12-11 19:01:18 +00:00
riastradh
f19b5fc52e Implement prcm_module_enable and prcm_module_disable for the AM335x. 2012-12-11 18:53:26 +00:00
riastradh
d2477942b2 Export a little more from the omap2 prcm driver.
This is in anticipation of drivers that need to enable (and, for
future power management, perhaps disable) modules on an SoC.  Each
SoC has a different notion of enabling and disabling modules and will
need to implement prcm_module_enable and prcm_module_disable
separately.
2012-12-11 18:51:38 +00:00
khorben
89dbf15fc9 Added kernel option OMAP_3430 to allow easy differentiation between the
BEAGLEBOARD and N900 kernels; otherwise no real change.

Resulting N900 kernel tested with no visible regression.

<gimpy> go for it
2012-12-11 01:54:41 +00:00
matt
bc0ae31576 Add code to patch pmap_{copy,zero}_page_generic to change calls to
b{copy,zero}_page to b{copy,zero}_page_vfp
2012-12-11 01:52:30 +00:00
matt
98a505fe40 Fix c&p error. 2012-12-11 01:51:14 +00:00
matt
d37381c8bd Defer configuring children of obio until all obio are attached.
from jmcneill.
2012-12-11 01:33:32 +00:00
matt
3add6f77d8 Optimize pmap_{copy,zerp}_page_generic to understand that when all of memory
is always mapped that you don't have create mappings dynamically.
2012-12-11 01:16:10 +00:00
matt
82296793c8 These contain to just contain bzero_page_vfp and bcopy_page_vfp 2012-12-11 01:13:05 +00:00
matt
958910a301 Add b{zero,copy}_page{,_vfp} and physical_end 2012-12-10 08:19:59 +00:00
matt
b83b5a89c9 add mm_md_direct_mapped_phys 2012-12-10 08:19:10 +00:00
matt
541e1a1106 Change a KASSERT to a KASSERTMSG 2012-12-10 06:54:23 +00:00
matt
b8d7acb128 Add pmap_{copy,zero}_page_vfp 2012-12-10 06:53:52 +00:00
matt
a798da9773 if __HAVE_MM_MD_DIRECT_MAPPED_PHYS is defined, make sure mapallmem_p is true. 2012-12-10 06:51:49 +00:00
matt
1ee1fc76a5 Make sure we can deal with VA != PA but still we need to have all of PA mapped. 2012-12-10 06:51:05 +00:00
matt
80269dc9ce add __HAVE_MM_MD_DIRECT_MAPPED_PHYS 2012-12-10 06:50:28 +00:00
matt
01b65f59ed Add VFP_FPEXC_EN 2012-12-10 05:03:42 +00:00
matt
18feae1b06 Add code to use VFP(or Neon) instructions to zero or copy a page via
pmap_zero_page and pmap_copy_page.  (Not hooked into vfp_init yet).
Requires FPU_VFP
2012-12-10 04:58:54 +00:00
matt
18d4b47816 Rename pcb_sp/PCB_SP to pcb_ksp/PCB_KSP so that ipsec.c will compile. 2012-12-10 01:37:30 +00:00
matt
e34a352fa4 move inlines into FPU_VFP 2012-12-10 01:35:28 +00:00
matt
5e6666bf7b Define the correct __UCONTEXT_SIZE for EABI. 2012-12-08 06:58:36 +00:00
matt
a431007dd2 On Cortex, make sure to load/save the upper 16 64-FP registers.
When creating a mcontext_t, make sure _UC_ARM_VFP is set.
2012-12-08 06:49:00 +00:00
matt
3b04b7dc45 Make sure that if _UC_FPU is set, that _UC_ARM_VFP is also set. 2012-12-08 06:47:31 +00:00
matt
cb733fbb03 Make sure the enable bit is not set when restoring the VFP context since
that has special meaning to the VFP PCU code.
2012-12-08 06:46:49 +00:00
christos
b72a1f38b6 need stdint.h for uint64_t and it is messy to do it open-coded. 2012-12-08 02:41:54 +00:00
matt
ea39f48440 Make evcnt'ers optional. 2012-12-07 22:21:03 +00:00
matt
69b293bf1c Add BCMETH_COUNTERS 2012-12-07 22:18:45 +00:00
matt
46372d58aa Extend vfpreg to include all 32 64-bit FP registers.
For __ARM_EABI__, define __vfp_fstmx to have space for all 32 32-bit
FP registers (It's a newly supported ABI so we can "break" binary
compatibility.
2012-12-07 18:49:13 +00:00
matt
d75601563c FPCONTEXTSIZE is dead. 2012-12-07 18:46:50 +00:00
matt
c7350ec513 For armv7 (cortex), disable access to the upper 16 FP registers (restrict
the register space to 16 64-bit FP registers).
2012-12-05 19:30:10 +00:00
matt
cb72f6574f ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.
2012-12-05 19:05:45 +00:00
msaitoh
335564ef1d Use snprintf() instead of sprintf(). 2012-11-30 08:15:45 +00:00
msaitoh
1ba55f16aa s/,/;/ 2012-11-30 08:12:27 +00:00
matt
2e5dd08939 Add inlines for SCTRL 2012-11-29 18:15:33 +00:00
matt
35ce1aa6eb Make sure to bring the ULPI ports out of reset. 2012-11-29 17:38:26 +00:00