1 --- a/arch/arm/configs/bcmrpi_cutdown_defconfig
2 +++ b/arch/arm/configs/bcmrpi_cutdown_defconfig
5 -# Automatically generated file; DO NOT EDIT.
6 -# Linux/arm 3.1.9 Kernel Configuration
9 -CONFIG_SYS_SUPPORTS_APM_EMULATION=y
10 -CONFIG_GENERIC_GPIO=y
11 -# CONFIG_ARCH_USES_GETTIMEOFFSET is not set
12 -CONFIG_GENERIC_CLOCKEVENTS=y
13 -CONFIG_KTIME_SCALAR=y
14 -CONFIG_HAVE_PROC_CPU=y
15 -CONFIG_STACKTRACE_SUPPORT=y
16 -CONFIG_HAVE_LATENCYTOP_SUPPORT=y
17 -CONFIG_LOCKDEP_SUPPORT=y
18 -CONFIG_TRACE_IRQFLAGS_SUPPORT=y
19 -CONFIG_HARDIRQS_SW_RESEND=y
20 -CONFIG_GENERIC_IRQ_PROBE=y
21 -CONFIG_RWSEM_GENERIC_SPINLOCK=y
22 -CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
23 -CONFIG_GENERIC_HWEIGHT=y
24 -CONFIG_GENERIC_CALIBRATE_DELAY=y
25 -CONFIG_NEED_DMA_MAP_STATE=y
26 -CONFIG_VECTORS_BASE=0xffff0000
27 -# CONFIG_ARM_PATCH_PHYS_VIRT is not set
28 -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
29 -CONFIG_HAVE_IRQ_WORK=y
35 -CONFIG_BROKEN_ON_SMP=y
36 -CONFIG_INIT_ENV_ARG_LIMIT=32
37 -CONFIG_CROSS_COMPILE=""
38 -CONFIG_LOCALVERSION=""
39 # CONFIG_LOCALVERSION_AUTO is not set
40 -CONFIG_HAVE_KERNEL_GZIP=y
41 -CONFIG_HAVE_KERNEL_LZMA=y
42 -CONFIG_HAVE_KERNEL_LZO=y
44 -# CONFIG_KERNEL_LZMA is not set
45 -# CONFIG_KERNEL_LZO is not set
46 -CONFIG_DEFAULT_HOSTNAME="(none)"
49 -CONFIG_SYSVIPC_SYSCTL=y
51 -CONFIG_POSIX_MQUEUE_SYSCTL=y
52 -# CONFIG_BSD_PROCESS_ACCT is not set
53 -# CONFIG_FHANDLE is not set
54 -# CONFIG_TASKSTATS is not set
55 -# CONFIG_AUDIT is not set
56 -CONFIG_HAVE_GENERIC_HARDIRQS=y
61 -CONFIG_GENERIC_HARDIRQS=y
62 -CONFIG_HAVE_SPARSE_IRQ=y
63 -CONFIG_GENERIC_IRQ_SHOW=y
64 -# CONFIG_SPARSE_IRQ is not set
70 -# CONFIG_PREEMPT_RCU is not set
71 -# CONFIG_RCU_TRACE is not set
72 -# CONFIG_TREE_RCU_TRACE is not set
74 CONFIG_IKCONFIG_PROC=y
75 -CONFIG_LOG_BUF_SHIFT=17
76 -# CONFIG_CGROUPS is not set
77 -# CONFIG_NAMESPACES is not set
78 -# CONFIG_SCHED_AUTOGROUP is not set
79 -# CONFIG_SYSFS_DEPRECATED is not set
80 -# CONFIG_RELAY is not set
81 -# CONFIG_BLK_DEV_INITRD is not set
82 -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
86 # CONFIG_UID16 is not set
87 -CONFIG_SYSCTL_SYSCALL=y
88 # CONFIG_KALLSYMS is not set
92 -# CONFIG_ELF_CORE is not set
102 -CONFIG_HAVE_PERF_EVENTS=y
103 -CONFIG_PERF_USE_VMALLOC=y
106 -# Kernel Performance Events And Counters
108 -# CONFIG_PERF_EVENTS is not set
109 -# CONFIG_PERF_COUNTERS is not set
110 # CONFIG_VM_EVENT_COUNTERS is not set
111 # CONFIG_COMPAT_BRK is not set
113 -# CONFIG_SLUB is not set
114 -# CONFIG_SLOB is not set
115 -# CONFIG_PROFILING is not set
116 -CONFIG_HAVE_OPROFILE=y
117 -# CONFIG_KPROBES is not set
118 -CONFIG_HAVE_KPROBES=y
119 -CONFIG_HAVE_KRETPROBES=y
120 -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
122 -CONFIG_HAVE_DMA_API_DEBUG=y
125 -# GCOV-based kernel profiling
127 -CONFIG_HAVE_GENERIC_DMA_COHERENT=y
132 -# CONFIG_MODULE_FORCE_LOAD is not set
133 CONFIG_MODULE_UNLOAD=y
134 -# CONFIG_MODULE_FORCE_UNLOAD is not set
136 CONFIG_MODULE_SRCVERSION_ALL=y
139 # CONFIG_BLK_DEV_BSG is not set
140 -# CONFIG_BLK_DEV_BSGLIB is not set
141 -# CONFIG_BLK_DEV_INTEGRITY is not set
146 -CONFIG_IOSCHED_NOOP=y
147 -CONFIG_IOSCHED_DEADLINE=y
148 -CONFIG_IOSCHED_CFQ=y
149 -# CONFIG_DEFAULT_DEADLINE is not set
150 -CONFIG_DEFAULT_CFQ=y
151 -# CONFIG_DEFAULT_NOOP is not set
152 -CONFIG_DEFAULT_IOSCHED="cfq"
153 -# CONFIG_INLINE_SPIN_TRYLOCK is not set
154 -# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
155 -# CONFIG_INLINE_SPIN_LOCK is not set
156 -# CONFIG_INLINE_SPIN_LOCK_BH is not set
157 -# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
158 -# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
159 -CONFIG_INLINE_SPIN_UNLOCK=y
160 -# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
161 -CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
162 -# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
163 -# CONFIG_INLINE_READ_TRYLOCK is not set
164 -# CONFIG_INLINE_READ_LOCK is not set
165 -# CONFIG_INLINE_READ_LOCK_BH is not set
166 -# CONFIG_INLINE_READ_LOCK_IRQ is not set
167 -# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
168 -CONFIG_INLINE_READ_UNLOCK=y
169 -# CONFIG_INLINE_READ_UNLOCK_BH is not set
170 -CONFIG_INLINE_READ_UNLOCK_IRQ=y
171 -# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
172 -# CONFIG_INLINE_WRITE_TRYLOCK is not set
173 -# CONFIG_INLINE_WRITE_LOCK is not set
174 -# CONFIG_INLINE_WRITE_LOCK_BH is not set
175 -# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
176 -# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
177 -CONFIG_INLINE_WRITE_UNLOCK=y
178 -# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
179 -CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
180 -# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
181 -# CONFIG_MUTEX_SPIN_ON_OWNER is not set
188 -# CONFIG_ARCH_INTEGRATOR is not set
189 -# CONFIG_ARCH_REALVIEW is not set
190 -# CONFIG_ARCH_VERSATILE is not set
191 -# CONFIG_ARCH_VEXPRESS is not set
192 -# CONFIG_ARCH_AT91 is not set
193 -# CONFIG_ARCH_BCMRING is not set
194 -# CONFIG_ARCH_CLPS711X is not set
195 -# CONFIG_ARCH_CNS3XXX is not set
196 -# CONFIG_ARCH_GEMINI is not set
197 -# CONFIG_ARCH_PRIMA2 is not set
198 -# CONFIG_ARCH_EBSA110 is not set
199 -# CONFIG_ARCH_EP93XX is not set
200 -# CONFIG_ARCH_FOOTBRIDGE is not set
201 -# CONFIG_ARCH_MXC is not set
202 -# CONFIG_ARCH_MXS is not set
203 -# CONFIG_ARCH_NETX is not set
204 -# CONFIG_ARCH_H720X is not set
205 -# CONFIG_ARCH_IOP13XX is not set
206 -# CONFIG_ARCH_IOP32X is not set
207 -# CONFIG_ARCH_IOP33X is not set
208 -# CONFIG_ARCH_IXP23XX is not set
209 -# CONFIG_ARCH_IXP2000 is not set
210 -# CONFIG_ARCH_IXP4XX is not set
211 -# CONFIG_ARCH_DOVE is not set
212 -# CONFIG_ARCH_KIRKWOOD is not set
213 -# CONFIG_ARCH_LPC32XX is not set
214 -# CONFIG_ARCH_MV78XX0 is not set
215 -# CONFIG_ARCH_ORION5X is not set
216 -# CONFIG_ARCH_MMP is not set
217 -# CONFIG_ARCH_KS8695 is not set
218 -# CONFIG_ARCH_W90X900 is not set
219 -# CONFIG_ARCH_NUC93X is not set
220 -# CONFIG_ARCH_TEGRA is not set
221 -# CONFIG_ARCH_PNX4008 is not set
222 -# CONFIG_ARCH_PXA is not set
223 -# CONFIG_ARCH_MSM is not set
224 -# CONFIG_ARCH_SHMOBILE is not set
225 -# CONFIG_ARCH_RPC is not set
226 -# CONFIG_ARCH_SA1100 is not set
227 -# CONFIG_ARCH_S3C2410 is not set
228 -# CONFIG_ARCH_S3C64XX is not set
229 -# CONFIG_ARCH_S5P64X0 is not set
230 -# CONFIG_ARCH_S5PC100 is not set
231 -# CONFIG_ARCH_S5PV210 is not set
232 -# CONFIG_ARCH_EXYNOS4 is not set
233 -# CONFIG_ARCH_SHARK is not set
234 -# CONFIG_ARCH_TCC_926 is not set
235 -# CONFIG_ARCH_U300 is not set
236 -# CONFIG_ARCH_U8500 is not set
237 -# CONFIG_ARCH_NOMADIK is not set
238 -# CONFIG_ARCH_DAVINCI is not set
239 -# CONFIG_ARCH_OMAP is not set
240 -# CONFIG_PLAT_SPEAR is not set
241 CONFIG_ARCH_BCM2708=y
242 -# CONFIG_ARCH_VT8500 is not set
243 -# CONFIG_ARCH_ZYNQ is not set
250 -# Broadcom BCM2708 Implementations
252 -CONFIG_MACH_BCM2708=y
253 -CONFIG_BCM2708_GPIO=y
254 -CONFIG_BCM2708_VCMEM=y
261 -CONFIG_CPU_ABRT_EV6=y
262 -CONFIG_CPU_PABRT_V6=y
263 -CONFIG_CPU_CACHE_V6=y
264 -CONFIG_CPU_CACHE_VIPT=y
265 -CONFIG_CPU_COPY_V6=y
267 -CONFIG_CPU_HAS_ASID=y
269 -CONFIG_CPU_CP15_MMU=y
270 -CONFIG_CPU_USE_DOMAINS=y
273 -# Processor Features
276 -# CONFIG_CPU_ICACHE_DISABLE is not set
277 -# CONFIG_CPU_DCACHE_DISABLE is not set
278 -# CONFIG_CPU_BPREDICT_DISABLE is not set
279 -CONFIG_ARM_L1_CACHE_SHIFT=5
280 -CONFIG_ARM_DMA_MEM_BUFFERABLE=y
281 -CONFIG_CPU_HAS_PMU=y
282 -CONFIG_ARM_ERRATA_411920=y
283 -# CONFIG_ARM_ERRATA_364296 is not set
289 -# CONFIG_PCI_SYSCALL is not set
290 -# CONFIG_ARCH_SUPPORTS_MSI is not set
291 -# CONFIG_PCCARD is not set
296 -CONFIG_TICK_ONESHOT=y
298 -# CONFIG_HIGH_RES_TIMERS is not set
299 -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
301 -# CONFIG_VMSPLIT_2G is not set
302 -# CONFIG_VMSPLIT_1G is not set
303 -CONFIG_PAGE_OFFSET=0xC0000000
304 -CONFIG_PREEMPT_NONE=y
305 -# CONFIG_PREEMPT_VOLUNTARY is not set
306 -# CONFIG_PREEMPT is not set
308 +CONFIG_HIGH_RES_TIMERS=y
310 -CONFIG_OABI_COMPAT=y
311 -# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
312 -# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
313 -CONFIG_HAVE_ARCH_PFN_VALID=y
314 -# CONFIG_HIGHMEM is not set
315 -CONFIG_SELECT_MEMORY_MODEL=y
316 -CONFIG_FLATMEM_MANUAL=y
318 -CONFIG_FLAT_NODE_MEM_MAP=y
319 -CONFIG_HAVE_MEMBLOCK=y
320 -CONFIG_PAGEFLAGS_EXTENDED=y
321 -CONFIG_SPLIT_PTLOCK_CPUS=4
322 -# CONFIG_COMPACTION is not set
323 -# CONFIG_PHYS_ADDR_T_64BIT is not set
324 -CONFIG_ZONE_DMA_FLAG=0
325 -CONFIG_VIRT_TO_BUS=y
326 -# CONFIG_KSM is not set
327 -CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
328 -CONFIG_NEED_PER_CPU_KM=y
329 -# CONFIG_CLEANCACHE is not set
330 -CONFIG_FORCE_MAX_ZONEORDER=11
331 -CONFIG_ALIGNMENT_TRAP=y
332 -# CONFIG_UACCESS_WITH_MEMCPY is not set
333 -# CONFIG_SECCOMP is not set
334 -# CONFIG_CC_STACKPROTECTOR is not set
335 -# CONFIG_DEPRECATED_PARAM_STRUCT is not set
340 -# CONFIG_USE_OF is not set
341 CONFIG_ZBOOT_ROM_TEXT=0x0
342 CONFIG_ZBOOT_ROM_BSS=0x0
343 CONFIG_CMDLINE="dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext3 rootwait"
344 -CONFIG_CMDLINE_FROM_BOOTLOADER=y
345 -# CONFIG_CMDLINE_EXTEND is not set
346 -# CONFIG_CMDLINE_FORCE is not set
347 -# CONFIG_XIP_KERNEL is not set
348 -# CONFIG_KEXEC is not set
349 -# CONFIG_CRASH_DUMP is not set
350 -# CONFIG_AUTO_ZRELADDR is not set
353 -# CPU Power Management
356 -CONFIG_CPU_IDLE_GOV_LADDER=y
357 -CONFIG_CPU_IDLE_GOV_MENU=y
360 -# Floating point emulation
364 -# At least one emulation must be selected
366 -# CONFIG_FPE_NWFPE is not set
367 -# CONFIG_FPE_FASTFPE is not set
371 -# Userspace binary formats
375 -# CONFIG_BINFMT_AOUT is not set
376 -# CONFIG_BINFMT_MISC is not set
379 -# Power management options
382 -CONFIG_SUSPEND_FREEZER=y
384 -# CONFIG_PM_RUNTIME is not set
386 -# CONFIG_PM_DEBUG is not set
387 -# CONFIG_APM_EMULATION is not set
389 -CONFIG_ARCH_SUSPEND_POSSIBLE=y
390 +CONFIG_BINFMT_MISC=m
394 -# Networking options
400 -# CONFIG_XFRM_SUB_POLICY is not set
401 -# CONFIG_XFRM_MIGRATE is not set
402 -# CONFIG_XFRM_STATISTICS is not set
404 -# CONFIG_NET_KEY_MIGRATE is not set
406 CONFIG_IP_MULTICAST=y
407 -# CONFIG_IP_ADVANCED_ROUTER is not set
410 -# CONFIG_IP_PNP_BOOTP is not set
412 -# CONFIG_NET_IPIP is not set
413 -# CONFIG_NET_IPGRE_DEMUX is not set
414 -# CONFIG_IP_MROUTE is not set
415 -# CONFIG_ARPD is not set
417 -# CONFIG_INET_AH is not set
418 -# CONFIG_INET_ESP is not set
419 -# CONFIG_INET_IPCOMP is not set
420 -# CONFIG_INET_XFRM_TUNNEL is not set
421 -# CONFIG_INET_TUNNEL is not set
422 # CONFIG_INET_XFRM_MODE_TRANSPORT is not set
423 # CONFIG_INET_XFRM_MODE_TUNNEL is not set
424 # CONFIG_INET_XFRM_MODE_BEET is not set
425 # CONFIG_INET_LRO is not set
426 # CONFIG_INET_DIAG is not set
427 -# CONFIG_TCP_CONG_ADVANCED is not set
428 -CONFIG_TCP_CONG_CUBIC=y
429 -CONFIG_DEFAULT_TCP_CONG="cubic"
430 -# CONFIG_TCP_MD5SIG is not set
431 # CONFIG_IPV6 is not set
432 -# CONFIG_NETWORK_SECMARK is not set
433 -# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
434 -# CONFIG_NETFILTER is not set
435 -# CONFIG_IP_DCCP is not set
436 -# CONFIG_IP_SCTP is not set
437 -# CONFIG_RDS is not set
438 -# CONFIG_TIPC is not set
439 -# CONFIG_ATM is not set
440 -# CONFIG_L2TP is not set
441 -# CONFIG_BRIDGE is not set
442 -# CONFIG_NET_DSA is not set
443 -# CONFIG_VLAN_8021Q is not set
444 -# CONFIG_DECNET is not set
445 -# CONFIG_LLC2 is not set
446 -# CONFIG_IPX is not set
447 -# CONFIG_ATALK is not set
448 -# CONFIG_X25 is not set
449 -# CONFIG_LAPB is not set
450 -# CONFIG_ECONET is not set
451 -# CONFIG_WAN_ROUTER is not set
452 -# CONFIG_PHONET is not set
453 -# CONFIG_IEEE802154 is not set
454 -# CONFIG_NET_SCHED is not set
455 -# CONFIG_DCB is not set
456 -CONFIG_DNS_RESOLVER=y
457 -# CONFIG_BATMAN_ADV is not set
463 -# CONFIG_HAMRADIO is not set
464 -# CONFIG_CAN is not set
465 -# CONFIG_IRDA is not set
466 -# CONFIG_BT is not set
467 -# CONFIG_AF_RXRPC is not set
472 -# CONFIG_NL80211_TESTMODE is not set
473 -# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
474 -# CONFIG_CFG80211_REG_DEBUG is not set
475 -CONFIG_CFG80211_DEFAULT_PS=y
476 -# CONFIG_CFG80211_INTERNAL_REGDB is not set
477 -CONFIG_CFG80211_WEXT=y
478 -CONFIG_WIRELESS_EXT_SYSFS=y
479 -# CONFIG_LIB80211 is not set
480 -# CONFIG_MAC80211 is not set
481 -# CONFIG_WIMAX is not set
482 -# CONFIG_RFKILL is not set
483 -# CONFIG_NET_9P is not set
484 -# CONFIG_CAIF is not set
485 -# CONFIG_CEPH_LIB is not set
486 -# CONFIG_NFC is not set
493 -# Generic Driver Options
495 -CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
496 -# CONFIG_DEVTMPFS is not set
498 -CONFIG_PREVENT_FIRMWARE_BUILD=y
500 -CONFIG_FIRMWARE_IN_KERNEL=y
501 -CONFIG_EXTRA_FIRMWARE=""
502 -# CONFIG_DEBUG_DRIVER is not set
503 -# CONFIG_DEBUG_DEVRES is not set
504 -# CONFIG_SYS_HYPERVISOR is not set
505 -# CONFIG_CONNECTOR is not set
506 -# CONFIG_MTD is not set
507 -# CONFIG_PARPORT is not set
509 -# CONFIG_BLK_DEV_COW_COMMON is not set
514 +CONFIG_IRDA_CACHE_LAST_LSAP=y
515 +CONFIG_IRDA_FAST_RR=y
517 +CONFIG_KINGSUN_DONGLE=m
518 +CONFIG_KSDAZZLE_DONGLE=m
519 +CONFIG_KS959_DONGLE=m
521 +CONFIG_SIGMATEL_FIR=m
527 +CONFIG_BT_RFCOMM_TTY=y
529 +CONFIG_BT_BNEP_MC_FILTER=y
530 +CONFIG_BT_BNEP_PROTO_FILTER=y
532 +CONFIG_BT_HCIBTUSB=m
533 +CONFIG_BT_HCIBCM203X=m
534 +CONFIG_BT_HCIBPA10X=m
535 +CONFIG_BT_HCIBFUSB=m
538 +CONFIG_BT_MRVL_SDIO=m
542 +CONFIG_MAC80211_RC_PID=y
543 +CONFIG_MAC80211_MESH=y
549 CONFIG_BLK_DEV_LOOP=y
550 -CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
551 -# CONFIG_BLK_DEV_CRYPTOLOOP is not set
554 -# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
556 -# CONFIG_BLK_DEV_NBD is not set
557 -# CONFIG_BLK_DEV_UB is not set
558 +CONFIG_BLK_DEV_CRYPTOLOOP=m
559 +CONFIG_BLK_DEV_NBD=m
561 -CONFIG_BLK_DEV_RAM_COUNT=16
562 -CONFIG_BLK_DEV_RAM_SIZE=4096
563 -# CONFIG_BLK_DEV_XIP is not set
564 -# CONFIG_CDROM_PKTCDVD is not set
565 -# CONFIG_ATA_OVER_ETH is not set
566 -# CONFIG_MG_DISK is not set
567 -# CONFIG_BLK_DEV_RBD is not set
568 -# CONFIG_SENSORS_LIS3LV02D is not set
569 +CONFIG_CDROM_PKTCDVD=m
570 CONFIG_MISC_DEVICES=y
571 -# CONFIG_ENCLOSURE_SERVICES is not set
572 -# CONFIG_C2PORT is not set
577 -# CONFIG_EEPROM_93CX6 is not set
578 -# CONFIG_IWMC3200TOP is not set
581 -# Texas Instruments shared transport line discipline
583 -# CONFIG_TI_ST is not set
584 -CONFIG_BCM2708_VCHIQ=y
586 -# CONFIG_IDE is not set
589 -# SCSI device support
592 -# CONFIG_RAID_ATTRS is not set
595 -# CONFIG_SCSI_TGT is not set
596 -# CONFIG_SCSI_NETLINK is not set
597 # CONFIG_SCSI_PROC_FS is not set
600 -# SCSI support type (disk, tape, CD-ROM)
603 -# CONFIG_CHR_DEV_ST is not set
604 -# CONFIG_CHR_DEV_OSST is not set
607 -# CONFIG_BLK_DEV_SR_VENDOR is not set
608 -# CONFIG_CHR_DEV_SG is not set
609 -# CONFIG_CHR_DEV_SCH is not set
610 CONFIG_SCSI_MULTI_LUN=y
611 -# CONFIG_SCSI_CONSTANTS is not set
612 -# CONFIG_SCSI_LOGGING is not set
613 -# CONFIG_SCSI_SCAN_ASYNC is not set
614 -CONFIG_SCSI_WAIT_SCAN=m
619 -# CONFIG_SCSI_SPI_ATTRS is not set
620 -# CONFIG_SCSI_FC_ATTRS is not set
621 -# CONFIG_SCSI_ISCSI_ATTRS is not set
622 -# CONFIG_SCSI_SAS_ATTRS is not set
623 -# CONFIG_SCSI_SAS_LIBSAS is not set
624 -# CONFIG_SCSI_SRP_ATTRS is not set
625 # CONFIG_SCSI_LOWLEVEL is not set
626 -# CONFIG_SCSI_DH is not set
627 -# CONFIG_SCSI_OSD_INITIATOR is not set
628 -# CONFIG_ATA is not set
629 -# CONFIG_MD is not set
630 -# CONFIG_TARGET_CORE is not set
632 -# CONFIG_DUMMY is not set
633 -# CONFIG_BONDING is not set
634 -# CONFIG_MACVLAN is not set
635 -# CONFIG_EQUALIZER is not set
637 -# CONFIG_VETH is not set
642 -# MII PHY device drivers
644 -# CONFIG_MARVELL_PHY is not set
645 -# CONFIG_DAVICOM_PHY is not set
646 -# CONFIG_QSEMI_PHY is not set
647 -# CONFIG_LXT_PHY is not set
648 -# CONFIG_CICADA_PHY is not set
649 -# CONFIG_VITESSE_PHY is not set
650 -# CONFIG_SMSC_PHY is not set
651 -# CONFIG_BROADCOM_PHY is not set
652 -# CONFIG_ICPLUS_PHY is not set
653 -# CONFIG_REALTEK_PHY is not set
654 -# CONFIG_NATIONAL_PHY is not set
655 -# CONFIG_STE10XP is not set
656 -# CONFIG_LSI_ET1011C_PHY is not set
657 -# CONFIG_MICREL_PHY is not set
658 CONFIG_MDIO_BITBANG=m
659 -# CONFIG_MDIO_GPIO is not set
660 CONFIG_NET_ETHERNET=y
662 -# CONFIG_AX88796_93CX6 is not set
663 -# CONFIG_SMC91X is not set
664 -# CONFIG_DM9000 is not set
665 -# CONFIG_ETHOC is not set
666 -# CONFIG_SMC911X is not set
667 -# CONFIG_SMSC911X is not set
668 -# CONFIG_DNET is not set
669 -# CONFIG_IBM_NEW_EMAC_ZMII is not set
670 -# CONFIG_IBM_NEW_EMAC_RGMII is not set
671 -# CONFIG_IBM_NEW_EMAC_TAH is not set
672 -# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
673 -# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
674 -# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
675 -# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
676 -# CONFIG_B44 is not set
677 -# CONFIG_KS8851_MLL is not set
678 -# CONFIG_FTMAC100 is not set
679 # CONFIG_NETDEV_1000 is not set
680 # CONFIG_NETDEV_10000 is not set
681 -# CONFIG_WLAN is not set
684 -# Enable WiMAX (Networking options) to see the WiMAX drivers
688 -# USB Network Adapters
690 -# CONFIG_USB_CATC is not set
691 -# CONFIG_USB_KAWETH is not set
692 -# CONFIG_USB_PEGASUS is not set
693 -# CONFIG_USB_RTL8150 is not set
694 +CONFIG_LIBERTAS_THINFIRM=m
695 +CONFIG_LIBERTAS_THINFIRM_USB=m
696 +CONFIG_AT76C50X_USB=m
698 +CONFIG_USB_NET_RNDIS_WLAN=m
700 +CONFIG_MAC80211_HWSIM=m
710 +CONFIG_LIBERTAS_USB=m
711 +CONFIG_LIBERTAS_SDIO=m
718 +CONFIG_RT2800USB_RT53XX=y
721 +CONFIG_WL12XX_MENU=m
724 +CONFIG_MWIFIEX_SDIO=m
725 +CONFIG_WIMAX_I2400M_USB=m
728 +CONFIG_USB_PEGASUS=m
729 +CONFIG_USB_RTL8150=m
731 CONFIG_USB_NET_AX8817X=m
732 -# CONFIG_USB_NET_CDCETHER is not set
733 -# CONFIG_USB_NET_CDC_EEM is not set
734 -CONFIG_USB_NET_CDC_NCM=y
735 -# CONFIG_USB_NET_DM9601 is not set
736 -# CONFIG_USB_NET_SMSC75XX is not set
737 +CONFIG_USB_NET_CDCETHER=m
738 +CONFIG_USB_NET_CDC_EEM=m
739 +CONFIG_USB_NET_DM9601=m
740 +CONFIG_USB_NET_SMSC75XX=m
741 CONFIG_USB_NET_SMSC95XX=y
742 -# CONFIG_USB_NET_GL620A is not set
743 -# CONFIG_USB_NET_NET1080 is not set
744 -# CONFIG_USB_NET_PLUSB is not set
745 -# CONFIG_USB_NET_MCS7830 is not set
746 -# CONFIG_USB_NET_RNDIS_HOST is not set
747 -# CONFIG_USB_NET_CDC_SUBSET is not set
748 +CONFIG_USB_NET_GL620A=m
749 +CONFIG_USB_NET_NET1080=m
750 +CONFIG_USB_NET_PLUSB=m
751 +CONFIG_USB_NET_MCS7830=m
752 +CONFIG_USB_NET_CDC_SUBSET=m
753 +CONFIG_USB_ALI_M5632=y
756 # CONFIG_USB_NET_ZAURUS is not set
757 -# CONFIG_USB_NET_CX82310_ETH is not set
758 -# CONFIG_USB_NET_KALMIA is not set
759 -# CONFIG_USB_NET_INT51X1 is not set
760 -# CONFIG_USB_IPHETH is not set
761 -# CONFIG_USB_SIERRA_NET is not set
762 -# CONFIG_WAN is not set
765 -# CAIF transport drivers
767 -# CONFIG_PPP is not set
768 -# CONFIG_SLIP is not set
769 -# CONFIG_NETCONSOLE is not set
770 -# CONFIG_NETPOLL is not set
771 -# CONFIG_NET_POLL_CONTROLLER is not set
772 -# CONFIG_ISDN is not set
773 -# CONFIG_PHONE is not set
776 -# Input device support
779 -# CONFIG_INPUT_FF_MEMLESS is not set
780 -# CONFIG_INPUT_POLLDEV is not set
781 -# CONFIG_INPUT_SPARSEKMAP is not set
784 -# Userland interfaces
786 -CONFIG_INPUT_MOUSEDEV=y
787 +CONFIG_USB_NET_CX82310_ETH=m
788 +CONFIG_USB_NET_KALMIA=m
789 +CONFIG_USB_NET_INT51X1=m
791 +CONFIG_USB_SIERRA_NET=m
795 +CONFIG_PPP_SYNC_TTY=m
796 +CONFIG_PPP_DEFLATE=m
797 +CONFIG_PPP_BSDCOMP=m
799 +CONFIG_SLIP_COMPRESSED=y
801 +CONFIG_INPUT_POLLDEV=m
802 # CONFIG_INPUT_MOUSEDEV_PSAUX is not set
803 -CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
804 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
805 -# CONFIG_INPUT_JOYDEV is not set
806 +CONFIG_INPUT_JOYDEV=m
808 -# CONFIG_INPUT_EVBUG is not set
811 -# Input Device Drivers
813 # CONFIG_INPUT_KEYBOARD is not set
814 # CONFIG_INPUT_MOUSE is not set
815 -# CONFIG_INPUT_JOYSTICK is not set
816 -# CONFIG_INPUT_TABLET is not set
817 -# CONFIG_INPUT_TOUCHSCREEN is not set
819 -# CONFIG_INPUT_AD714X is not set
820 -# CONFIG_INPUT_ATI_REMOTE is not set
821 -# CONFIG_INPUT_ATI_REMOTE2 is not set
822 -# CONFIG_INPUT_KEYSPAN_REMOTE is not set
823 -# CONFIG_INPUT_POWERMATE is not set
824 -# CONFIG_INPUT_YEALINK is not set
825 -# CONFIG_INPUT_CM109 is not set
826 +CONFIG_INPUT_AD714X=m
827 +CONFIG_INPUT_ATI_REMOTE=m
828 +CONFIG_INPUT_ATI_REMOTE2=m
829 +CONFIG_INPUT_KEYSPAN_REMOTE=m
830 +CONFIG_INPUT_POWERMATE=m
831 +CONFIG_INPUT_YEALINK=m
832 +CONFIG_INPUT_CM109=m
833 CONFIG_INPUT_UINPUT=m
834 -# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
835 -# CONFIG_INPUT_ADXL34X is not set
836 -# CONFIG_INPUT_CMA3000 is not set
839 -# Hardware I/O ports
841 +CONFIG_INPUT_GPIO_ROTARY_ENCODER=m
842 +CONFIG_INPUT_ADXL34X=m
843 +CONFIG_INPUT_CMA3000=m
845 -CONFIG_SERIO_SERPORT=m
846 -# CONFIG_SERIO_AMBAKMI is not set
847 -# CONFIG_SERIO_LIBPS2 is not set
849 -# CONFIG_SERIO_ALTERA_PS2 is not set
850 -# CONFIG_SERIO_PS2MULT is not set
852 CONFIG_GAMEPORT_NS558=m
859 -CONFIG_CONSOLE_TRANSLATIONS=y
862 CONFIG_VT_HW_CONSOLE_BINDING=y
863 -CONFIG_UNIX98_PTYS=y
864 -# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
865 # CONFIG_LEGACY_PTYS is not set
866 -# CONFIG_SERIAL_NONSTANDARD is not set
867 -# CONFIG_N_GSM is not set
868 -# CONFIG_TRACE_SINK is not set
869 # CONFIG_DEVKMEM is not set
874 -# CONFIG_SERIAL_8250 is not set
877 -# Non-8250 serial port support
879 -# CONFIG_SERIAL_AMBA_PL010 is not set
880 CONFIG_SERIAL_AMBA_PL011=y
881 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
882 -CONFIG_SERIAL_CORE=y
883 -CONFIG_SERIAL_CORE_CONSOLE=y
884 -# CONFIG_SERIAL_TIMBERDALE is not set
885 -# CONFIG_SERIAL_ALTERA_JTAGUART is not set
886 -# CONFIG_SERIAL_ALTERA_UART is not set
887 -# CONFIG_SERIAL_XILINX_PS_UART is not set
888 -# CONFIG_TTY_PRINTK is not set
889 -# CONFIG_HVC_DCC is not set
890 -# CONFIG_IPMI_HANDLER is not set
891 # CONFIG_HW_RANDOM is not set
892 -# CONFIG_R3964 is not set
894 -CONFIG_MAX_RAW_DEVS=256
895 -# CONFIG_TCG_TPM is not set
896 -# CONFIG_RAMOOPS is not set
897 -# CONFIG_I2C is not set
898 -# CONFIG_SPI is not set
903 -# CONFIG_PPS is not set
906 -# PPS generators support
914 -# Enable Device Drivers -> PPS to see the PTP clock options.
916 -CONFIG_ARCH_REQUIRE_GPIOLIB=y
918 -# CONFIG_DEBUG_GPIO is not set
922 -# Memory mapped GPIO drivers:
924 -# CONFIG_GPIO_GENERIC_PLATFORM is not set
925 -# CONFIG_GPIO_IT8761E is not set
926 -# CONFIG_GPIO_PL061 is not set
929 -# I2C GPIO expanders:
933 -# PCI GPIO expanders:
937 -# SPI GPIO expanders:
941 -# AC97 GPIO expanders:
945 -# MODULbus GPIO expanders:
947 -# CONFIG_W1 is not set
948 -# CONFIG_POWER_SUPPLY is not set
949 # CONFIG_HWMON is not set
950 -# CONFIG_THERMAL is not set
951 -# CONFIG_WATCHDOG is not set
952 -CONFIG_SSB_POSSIBLE=y
955 -# Sonics Silicon Backplane
957 -# CONFIG_SSB is not set
958 -CONFIG_BCMA_POSSIBLE=y
961 -# Broadcom specific AMBA
963 -# CONFIG_BCMA is not set
965 +CONFIG_BCM2708_WDT=m
966 # CONFIG_MFD_SUPPORT is not set
967 -# CONFIG_REGULATOR is not set
968 -# CONFIG_MEDIA_SUPPORT is not set
973 -# CONFIG_DRM is not set
974 -# CONFIG_VGASTATE is not set
975 -# CONFIG_VIDEO_OUTPUT_CONTROL is not set
977 -# CONFIG_FIRMWARE_EDID is not set
978 -# CONFIG_FB_DDC is not set
979 -# CONFIG_FB_BOOT_VESA_SUPPORT is not set
980 -CONFIG_FB_CFB_FILLRECT=y
981 -CONFIG_FB_CFB_COPYAREA=y
982 -CONFIG_FB_CFB_IMAGEBLIT=y
983 -# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
984 -# CONFIG_FB_SYS_FILLRECT is not set
985 -# CONFIG_FB_SYS_COPYAREA is not set
986 -# CONFIG_FB_SYS_IMAGEBLIT is not set
987 -# CONFIG_FB_FOREIGN_ENDIAN is not set
988 -# CONFIG_FB_SYS_FOPS is not set
989 -# CONFIG_FB_WMT_GE_ROPS is not set
990 -# CONFIG_FB_SVGALIB is not set
991 -# CONFIG_FB_MACMODES is not set
992 -# CONFIG_FB_BACKLIGHT is not set
993 -# CONFIG_FB_MODE_HELPERS is not set
994 -# CONFIG_FB_TILEBLITTING is not set
997 -# Frame buffer hardware drivers
1000 -# CONFIG_FB_ARMCLCD is not set
1001 -# CONFIG_FB_S1D13XXX is not set
1002 -# CONFIG_FB_UDL is not set
1003 -# CONFIG_FB_VIRTUAL is not set
1004 -# CONFIG_FB_METRONOME is not set
1005 -# CONFIG_FB_BROADSHEET is not set
1006 -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
1009 -# Display device support
1011 -# CONFIG_DISPLAY_SUPPORT is not set
1014 -# Console display driver support
1016 -CONFIG_DUMMY_CONSOLE=y
1017 CONFIG_FRAMEBUFFER_CONSOLE=y
1018 -# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
1019 -# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
1020 -# CONFIG_FONTS is not set
1024 # CONFIG_LOGO_LINUX_MONO is not set
1025 # CONFIG_LOGO_LINUX_VGA16 is not set
1026 -CONFIG_LOGO_LINUX_CLUT224=y
1027 -# CONFIG_SOUND is not set
1028 -CONFIG_HID_SUPPORT=y
1030 -# CONFIG_HIDRAW is not set
1033 -# USB Input Devices
1038 +CONFIG_SND_SEQUENCER=m
1039 +CONFIG_SND_SEQ_DUMMY=m
1040 +CONFIG_SND_MIXER_OSS=m
1041 +CONFIG_SND_PCM_OSS=m
1042 +CONFIG_SND_SEQUENCER_OSS=y
1043 +CONFIG_SND_HRTIMER=m
1046 +CONFIG_SND_VIRMIDI=m
1048 +CONFIG_SND_SERIAL_U16550=m
1049 +CONFIG_SND_MPU401=m
1050 +CONFIG_SND_BCM2835=m
1051 +CONFIG_SND_USB_AUDIO=m
1052 +CONFIG_SND_USB_UA101=m
1053 +CONFIG_SND_USB_CAIAQ=m
1054 +CONFIG_SND_USB_6FIRE=m
1055 +CONFIG_SOUND_PRIME=m
1060 -# Special HID drivers
1063 -# CONFIG_HID_ACRUX is not set
1068 CONFIG_HID_CHICONY=m
1069 CONFIG_HID_CYPRESS=m
1070 CONFIG_HID_DRAGONRISE=m
1071 -# CONFIG_DRAGONRISE_FF is not set
1072 -# CONFIG_HID_EMS_FF is not set
1073 +CONFIG_HID_EMS_FF=m
1074 +CONFIG_HID_ELECOM=m
1076 -# CONFIG_HID_HOLTEK is not set
1077 -# CONFIG_HID_KEYTOUCH is not set
1078 +CONFIG_HID_HOLTEK=m
1079 +CONFIG_HID_KEYTOUCH=m
1081 -# CONFIG_HID_UCLOGIC is not set
1082 -# CONFIG_HID_WALTOP is not set
1083 +CONFIG_HID_UCLOGIC=m
1084 +CONFIG_HID_WALTOP=m
1085 CONFIG_HID_GYRATION=m
1086 CONFIG_HID_TWINHAN=m
1087 CONFIG_HID_KENSINGTON=m
1088 -# CONFIG_HID_LCPOWER is not set
1089 +CONFIG_HID_LCPOWER=m
1090 CONFIG_HID_LOGITECH=m
1091 -# CONFIG_LOGITECH_FF is not set
1092 -# CONFIG_LOGIRUMBLEPAD2_FF is not set
1093 -# CONFIG_LOGIG940_FF is not set
1094 -# CONFIG_LOGIWII_FF is not set
1095 +CONFIG_HID_MAGICMOUSE=m
1096 CONFIG_HID_MICROSOFT=m
1097 CONFIG_HID_MONTEREY=m
1098 -# CONFIG_HID_MULTITOUCH is not set
1099 -# CONFIG_HID_NTRIG is not set
1100 +CONFIG_HID_MULTITOUCH=m
1103 CONFIG_HID_PANTHERLORD=m
1104 -# CONFIG_PANTHERLORD_FF is not set
1105 CONFIG_HID_PETALYNX=m
1106 -# CONFIG_HID_PICOLCD is not set
1107 -# CONFIG_HID_QUANTA is not set
1108 -# CONFIG_HID_ROCCAT is not set
1109 +CONFIG_HID_PICOLCD=m
1110 +CONFIG_HID_QUANTA=m
1111 +CONFIG_HID_ROCCAT=m
1112 CONFIG_HID_SAMSUNG=m
1114 -# CONFIG_HID_SPEEDLINK is not set
1115 +CONFIG_HID_SPEEDLINK=m
1116 CONFIG_HID_SUNPLUS=m
1117 CONFIG_HID_GREENASIA=m
1118 -# CONFIG_GREENASIA_FF is not set
1119 CONFIG_HID_SMARTJOYPLUS=m
1120 -# CONFIG_SMARTJOYPLUS_FF is not set
1121 CONFIG_HID_TOPSEED=m
1122 CONFIG_HID_THRUSTMASTER=m
1123 -# CONFIG_THRUSTMASTER_FF is not set
1125 +CONFIG_HID_WIIMOTE=m
1126 CONFIG_HID_ZEROPLUS=m
1127 -# CONFIG_ZEROPLUS_FF is not set
1128 -# CONFIG_HID_ZYDACRON is not set
1129 -CONFIG_USB_SUPPORT=y
1130 -CONFIG_USB_ARCH_HAS_HCD=y
1131 -# CONFIG_USB_ARCH_HAS_OHCI is not set
1132 -# CONFIG_USB_ARCH_HAS_EHCI is not set
1133 +CONFIG_HID_ZYDACRON=m
1135 -# CONFIG_USB_DEBUG is not set
1136 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
1139 -# Miscellaneous USB options
1141 -# CONFIG_USB_DEVICEFS is not set
1142 -CONFIG_USB_DEVICE_CLASS=y
1143 -# CONFIG_USB_DYNAMIC_MINORS is not set
1144 -# CONFIG_USB_OTG_WHITELIST is not set
1145 -# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1147 -# CONFIG_USB_WUSB is not set
1148 -# CONFIG_USB_WUSB_CBAF is not set
1151 -# USB Host Controller Drivers
1153 -# CONFIG_USB_C67X00_HCD is not set
1154 -# CONFIG_USB_OXU210HP_HCD is not set
1155 -# CONFIG_USB_ISP116X_HCD is not set
1156 -# CONFIG_USB_ISP1760_HCD is not set
1157 -# CONFIG_USB_ISP1362_HCD is not set
1158 -# CONFIG_USB_SL811_HCD is not set
1159 -# CONFIG_USB_R8A66597_HCD is not set
1160 -# CONFIG_USB_HWA_HCD is not set
1164 -# USB Device Class drivers
1166 -# CONFIG_USB_ACM is not set
1167 -# CONFIG_USB_PRINTER is not set
1168 -# CONFIG_USB_WDM is not set
1169 -# CONFIG_USB_TMC is not set
1172 -# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1176 -# also be needed; see USB_STORAGE Help for more info
1178 CONFIG_USB_STORAGE=y
1179 -# CONFIG_USB_STORAGE_DEBUG is not set
1180 -# CONFIG_USB_STORAGE_REALTEK is not set
1181 -# CONFIG_USB_STORAGE_DATAFAB is not set
1182 -# CONFIG_USB_STORAGE_FREECOM is not set
1183 -# CONFIG_USB_STORAGE_ISD200 is not set
1184 -# CONFIG_USB_STORAGE_USBAT is not set
1185 -# CONFIG_USB_STORAGE_SDDR09 is not set
1186 -# CONFIG_USB_STORAGE_SDDR55 is not set
1187 -# CONFIG_USB_STORAGE_JUMPSHOT is not set
1188 -# CONFIG_USB_STORAGE_ALAUDA is not set
1189 -# CONFIG_USB_STORAGE_ONETOUCH is not set
1190 -# CONFIG_USB_STORAGE_KARMA is not set
1191 -# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1192 -# CONFIG_USB_STORAGE_ENE_UB6250 is not set
1193 -# CONFIG_USB_UAS is not set
1194 +CONFIG_USB_STORAGE_REALTEK=m
1195 +CONFIG_USB_STORAGE_DATAFAB=m
1196 +CONFIG_USB_STORAGE_FREECOM=m
1197 +CONFIG_USB_STORAGE_ISD200=m
1198 +CONFIG_USB_STORAGE_USBAT=m
1199 +CONFIG_USB_STORAGE_SDDR09=m
1200 +CONFIG_USB_STORAGE_SDDR55=m
1201 +CONFIG_USB_STORAGE_JUMPSHOT=m
1202 +CONFIG_USB_STORAGE_ALAUDA=m
1203 +CONFIG_USB_STORAGE_ONETOUCH=m
1204 +CONFIG_USB_STORAGE_KARMA=m
1205 +CONFIG_USB_STORAGE_CYPRESS_ATACB=m
1206 +CONFIG_USB_STORAGE_ENE_UB6250=m
1208 CONFIG_USB_LIBUSUAL=y
1211 -# USB Imaging devices
1213 -# CONFIG_USB_MDC800 is not set
1214 -# CONFIG_USB_MICROTEK is not set
1219 -# CONFIG_USB_SERIAL is not set
1222 -# USB Miscellaneous drivers
1224 -# CONFIG_USB_EMI62 is not set
1225 -# CONFIG_USB_EMI26 is not set
1226 -# CONFIG_USB_ADUTUX is not set
1227 -# CONFIG_USB_SEVSEG is not set
1228 -# CONFIG_USB_RIO500 is not set
1229 -# CONFIG_USB_LEGOTOWER is not set
1230 -# CONFIG_USB_LCD is not set
1231 -# CONFIG_USB_LED is not set
1232 -# CONFIG_USB_CYPRESS_CY7C63 is not set
1233 -# CONFIG_USB_CYTHERM is not set
1234 -# CONFIG_USB_IDMOUSE is not set
1235 -# CONFIG_USB_FTDI_ELAN is not set
1236 -# CONFIG_USB_APPLEDISPLAY is not set
1237 -# CONFIG_USB_LD is not set
1238 -# CONFIG_USB_TRANCEVIBRATOR is not set
1239 -# CONFIG_USB_IOWARRIOR is not set
1240 -# CONFIG_USB_TEST is not set
1241 -# CONFIG_USB_ISIGHTFW is not set
1242 -# CONFIG_USB_YUREX is not set
1243 -# CONFIG_USB_GADGET is not set
1246 -# OTG and related infrastructure
1248 -# CONFIG_USB_GPIO_VBUS is not set
1249 -# CONFIG_USB_ULPI is not set
1250 -# CONFIG_NOP_USB_XCEIV is not set
1251 +CONFIG_USB_MDC800=m
1252 +CONFIG_USB_MICROTEK=m
1253 +CONFIG_USB_SERIAL=m
1254 +CONFIG_USB_SERIAL_GENERIC=y
1255 +CONFIG_USB_SERIAL_AIRCABLE=m
1256 +CONFIG_USB_SERIAL_ARK3116=m
1257 +CONFIG_USB_SERIAL_BELKIN=m
1258 +CONFIG_USB_SERIAL_CH341=m
1259 +CONFIG_USB_SERIAL_WHITEHEAT=m
1260 +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
1261 +CONFIG_USB_SERIAL_CP210X=m
1262 +CONFIG_USB_SERIAL_CYPRESS_M8=m
1263 +CONFIG_USB_SERIAL_EMPEG=m
1264 +CONFIG_USB_SERIAL_FTDI_SIO=m
1265 +CONFIG_USB_SERIAL_FUNSOFT=m
1266 +CONFIG_USB_SERIAL_VISOR=m
1267 +CONFIG_USB_SERIAL_IPAQ=m
1268 +CONFIG_USB_SERIAL_IR=m
1269 +CONFIG_USB_SERIAL_EDGEPORT=m
1270 +CONFIG_USB_SERIAL_EDGEPORT_TI=m
1271 +CONFIG_USB_SERIAL_GARMIN=m
1272 +CONFIG_USB_SERIAL_IPW=m
1273 +CONFIG_USB_SERIAL_IUU=m
1274 +CONFIG_USB_SERIAL_KEYSPAN_PDA=m
1275 +CONFIG_USB_SERIAL_KEYSPAN=m
1276 +CONFIG_USB_SERIAL_KLSI=m
1277 +CONFIG_USB_SERIAL_KOBIL_SCT=m
1278 +CONFIG_USB_SERIAL_MCT_U232=m
1279 +CONFIG_USB_SERIAL_MOS7720=m
1280 +CONFIG_USB_SERIAL_MOS7840=m
1281 +CONFIG_USB_SERIAL_MOTOROLA=m
1282 +CONFIG_USB_SERIAL_NAVMAN=m
1283 +CONFIG_USB_SERIAL_PL2303=m
1284 +CONFIG_USB_SERIAL_OTI6858=m
1285 +CONFIG_USB_SERIAL_QCAUX=m
1286 +CONFIG_USB_SERIAL_QUALCOMM=m
1287 +CONFIG_USB_SERIAL_SPCP8X5=m
1288 +CONFIG_USB_SERIAL_HP4X=m
1289 +CONFIG_USB_SERIAL_SAFE=m
1290 +CONFIG_USB_SERIAL_SIEMENS_MPI=m
1291 +CONFIG_USB_SERIAL_SIERRAWIRELESS=m
1292 +CONFIG_USB_SERIAL_SYMBOL=m
1293 +CONFIG_USB_SERIAL_TI=m
1294 +CONFIG_USB_SERIAL_CYBERJACK=m
1295 +CONFIG_USB_SERIAL_XIRCOM=m
1296 +CONFIG_USB_SERIAL_OPTION=m
1297 +CONFIG_USB_SERIAL_OMNINET=m
1298 +CONFIG_USB_SERIAL_OPTICON=m
1299 +CONFIG_USB_SERIAL_VIVOPAY_SERIAL=m
1300 +CONFIG_USB_SERIAL_ZIO=m
1301 +CONFIG_USB_SERIAL_SSU100=m
1302 +CONFIG_USB_SERIAL_DEBUG=m
1305 +CONFIG_USB_ADUTUX=m
1306 +CONFIG_USB_SEVSEG=m
1307 +CONFIG_USB_RIO500=m
1308 +CONFIG_USB_LEGOTOWER=m
1311 +CONFIG_USB_CYPRESS_CY7C63=m
1312 +CONFIG_USB_CYTHERM=m
1313 +CONFIG_USB_IDMOUSE=m
1314 +CONFIG_USB_FTDI_ELAN=m
1315 +CONFIG_USB_APPLEDISPLAY=m
1317 +CONFIG_USB_TRANCEVIBRATOR=m
1318 +CONFIG_USB_IOWARRIOR=m
1320 +CONFIG_USB_ISIGHTFW=m
1323 -# CONFIG_MMC_DEBUG is not set
1324 -# CONFIG_MMC_UNSAFE_RESUME is not set
1325 -# CONFIG_MMC_CLKGATE is not set
1328 -# MMC/SD/SDIO Card Drivers
1331 -CONFIG_MMC_BLOCK_MINORS=8
1332 -CONFIG_MMC_BLOCK_BOUNCE=y
1333 -# CONFIG_SDIO_UART is not set
1334 -# CONFIG_MMC_TEST is not set
1337 -# MMC/SD/SDIO Host Controller Drivers
1339 -# CONFIG_MMC_ARMMMCI is not set
1341 -CONFIG_MMC_SDHCI_IO_ACCESSORS=y
1342 CONFIG_MMC_SDHCI_PLTFM=y
1343 -# CONFIG_MMC_SDHCI_PXAV3 is not set
1344 -# CONFIG_MMC_SDHCI_PXAV2 is not set
1345 CONFIG_MMC_SDHCI_BCM2708=y
1346 CONFIG_MMC_SDHCI_BCM2708_DMA=y
1347 -# CONFIG_MMC_BCM2708 is not set
1348 -# CONFIG_MMC_DW is not set
1349 -# CONFIG_MMC_VUB300 is not set
1350 -# CONFIG_MMC_USHC is not set
1351 -# CONFIG_MEMSTICK is not set
1353 -CONFIG_LEDS_CLASS=y
1359 -# CONFIG_LEDS_LT3593 is not set
1360 -CONFIG_LEDS_TRIGGERS=y
1365 CONFIG_LEDS_TRIGGER_TIMER=m
1366 CONFIG_LEDS_TRIGGER_HEARTBEAT=m
1367 -# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1368 -# CONFIG_LEDS_TRIGGER_GPIO is not set
1369 CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
1372 -# iptables trigger is under Netfilter config (LED target)
1374 -# CONFIG_ACCESSIBILITY is not set
1376 -# CONFIG_RTC_CLASS is not set
1377 -# CONFIG_DMADEVICES is not set
1378 -# CONFIG_AUXDISPLAY is not set
1379 -# CONFIG_UIO is not set
1384 -# CONFIG_VIRTIO_BALLOON is not set
1385 -# CONFIG_STAGING is not set
1386 -CONFIG_CLKDEV_LOOKUP=y
1389 +CONFIG_UIO_PDRV_GENIRQ=m
1390 # CONFIG_IOMMU_SUPPORT is not set
1391 -# CONFIG_VIRT_DRIVERS is not set
1397 -CONFIG_EXT2_FS_XATTR=y
1398 -CONFIG_EXT2_FS_POSIX_ACL=y
1399 -CONFIG_EXT2_FS_SECURITY=y
1400 -CONFIG_EXT2_FS_XIP=y
1402 -# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1403 -CONFIG_EXT3_FS_XATTR=y
1404 -CONFIG_EXT3_FS_POSIX_ACL=y
1405 -CONFIG_EXT3_FS_SECURITY=y
1407 -CONFIG_EXT4_FS_XATTR=y
1409 CONFIG_EXT4_FS_POSIX_ACL=y
1410 CONFIG_EXT4_FS_SECURITY=y
1411 -# CONFIG_EXT4_DEBUG is not set
1415 -CONFIG_FS_MBCACHE=y
1416 -# CONFIG_REISERFS_FS is not set
1417 -# CONFIG_JFS_FS is not set
1418 -# CONFIG_XFS_FS is not set
1419 -# CONFIG_GFS2_FS is not set
1420 -# CONFIG_OCFS2_FS is not set
1421 -# CONFIG_BTRFS_FS is not set
1422 -# CONFIG_NILFS2_FS is not set
1423 -CONFIG_FS_POSIX_ACL=y
1424 -CONFIG_FILE_LOCKING=y
1427 -CONFIG_INOTIFY_USER=y
1428 -# CONFIG_FANOTIFY is not set
1429 -# CONFIG_QUOTA is not set
1430 -# CONFIG_QUOTACTL is not set
1431 +CONFIG_REISERFS_FS=m
1432 +CONFIG_REISERFS_FS_XATTR=y
1433 +CONFIG_REISERFS_FS_POSIX_ACL=y
1434 +CONFIG_REISERFS_FS_SECURITY=y
1436 +CONFIG_JFS_POSIX_ACL=y
1437 +CONFIG_JFS_SECURITY=y
1440 +CONFIG_XFS_POSIX_ACL=y
1445 +CONFIG_BTRFS_FS_POSIX_ACL=y
1455 -# CONFIG_FSCACHE_STATS is not set
1456 -# CONFIG_FSCACHE_HISTOGRAM is not set
1457 -# CONFIG_FSCACHE_DEBUG is not set
1458 -# CONFIG_FSCACHE_OBJECT_LIST is not set
1460 -# CONFIG_CACHEFILES_DEBUG is not set
1461 -# CONFIG_CACHEFILES_HISTOGRAM is not set
1464 -# CD-ROM/DVD Filesystems
1473 -# DOS/FAT/NT Filesystems
1478 -CONFIG_FAT_DEFAULT_CODEPAGE=437
1479 CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
1481 -# CONFIG_NTFS_DEBUG is not set
1482 -# CONFIG_NTFS_RW is not set
1485 -# Pseudo filesystems
1488 -CONFIG_PROC_SYSCTL=y
1489 -CONFIG_PROC_PAGE_MONITOR=y
1492 -# CONFIG_TMPFS_POSIX_ACL is not set
1493 -# CONFIG_TMPFS_XATTR is not set
1494 -# CONFIG_HUGETLB_PAGE is not set
1495 +CONFIG_TMPFS_POSIX_ACL=y
1496 CONFIG_CONFIGFS_FS=y
1497 -CONFIG_MISC_FILESYSTEMS=y
1498 -# CONFIG_ADFS_FS is not set
1499 -# CONFIG_AFFS_FS is not set
1500 -# CONFIG_ECRYPT_FS is not set
1501 -# CONFIG_HFS_FS is not set
1502 -# CONFIG_HFSPLUS_FS is not set
1503 -# CONFIG_BEFS_FS is not set
1504 -# CONFIG_BFS_FS is not set
1505 -# CONFIG_EFS_FS is not set
1506 -# CONFIG_LOGFS is not set
1507 -# CONFIG_CRAMFS is not set
1508 -# CONFIG_SQUASHFS is not set
1509 -# CONFIG_VXFS_FS is not set
1510 -# CONFIG_MINIX_FS is not set
1511 -# CONFIG_OMFS_FS is not set
1512 -# CONFIG_HPFS_FS is not set
1513 -# CONFIG_QNX4FS_FS is not set
1514 -# CONFIG_ROMFS_FS is not set
1515 -# CONFIG_PSTORE is not set
1516 -# CONFIG_SYSV_FS is not set
1517 -# CONFIG_UFS_FS is not set
1518 -CONFIG_NETWORK_FILESYSTEMS=y
1520 +CONFIG_SQUASHFS_XATTR=y
1521 +CONFIG_SQUASHFS_LZO=y
1522 +CONFIG_SQUASHFS_XZ=y
1527 -# CONFIG_NFS_V4_1 is not set
1529 CONFIG_NFS_FSCACHE=y
1530 -# CONFIG_NFS_USE_LEGACY_DNS is not set
1531 -CONFIG_NFS_USE_KERNEL_DNS=y
1532 -# CONFIG_NFS_USE_NEW_IDMAPPER is not set
1533 -# CONFIG_NFSD is not set
1536 -CONFIG_NFS_ACL_SUPPORT=y
1537 -CONFIG_NFS_COMMON=y
1539 -CONFIG_SUNRPC_GSS=y
1540 -# CONFIG_CEPH_FS is not set
1542 -# CONFIG_CIFS_STATS is not set
1543 CONFIG_CIFS_WEAK_PW_HASH=y
1544 -# CONFIG_CIFS_UPCALL is not set
1547 -# CONFIG_CIFS_DEBUG2 is not set
1548 -# CONFIG_CIFS_DFS_UPCALL is not set
1549 -# CONFIG_CIFS_FSCACHE is not set
1550 -# CONFIG_CIFS_ACL is not set
1551 -# CONFIG_NCP_FS is not set
1552 -# CONFIG_CODA_FS is not set
1553 -# CONFIG_AFS_FS is not set
1559 CONFIG_PARTITION_ADVANCED=y
1560 -# CONFIG_ACORN_PARTITION is not set
1561 -# CONFIG_OSF_PARTITION is not set
1562 -# CONFIG_AMIGA_PARTITION is not set
1563 -# CONFIG_ATARI_PARTITION is not set
1564 CONFIG_MAC_PARTITION=y
1565 -CONFIG_MSDOS_PARTITION=y
1566 -# CONFIG_BSD_DISKLABEL is not set
1567 -# CONFIG_MINIX_SUBPARTITION is not set
1568 -# CONFIG_SOLARIS_X86_PARTITION is not set
1569 -# CONFIG_UNIXWARE_DISKLABEL is not set
1570 -# CONFIG_LDM_PARTITION is not set
1571 -# CONFIG_SGI_PARTITION is not set
1572 -# CONFIG_ULTRIX_PARTITION is not set
1573 -# CONFIG_SUN_PARTITION is not set
1574 -# CONFIG_KARMA_PARTITION is not set
1575 CONFIG_EFI_PARTITION=y
1576 -# CONFIG_SYSV68_PARTITION is not set
1578 CONFIG_NLS_DEFAULT="utf8"
1579 CONFIG_NLS_CODEPAGE_437=y
1580 CONFIG_NLS_CODEPAGE_737=m
1581 @@ -1341,218 +470,25 @@ CONFIG_NLS_ISO8859_15=m
1585 -# CONFIG_DLM is not set
1590 -# CONFIG_PRINTK_TIME is not set
1591 -CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
1592 -CONFIG_ENABLE_WARN_DEPRECATED=y
1593 -CONFIG_ENABLE_MUST_CHECK=y
1594 -CONFIG_FRAME_WARN=1024
1595 -# CONFIG_MAGIC_SYSRQ is not set
1596 -# CONFIG_STRIP_ASM_SYMS is not set
1597 -# CONFIG_UNUSED_SYMBOLS is not set
1598 -# CONFIG_DEBUG_FS is not set
1599 -# CONFIG_HEADERS_CHECK is not set
1600 -# CONFIG_DEBUG_SECTION_MISMATCH is not set
1601 -CONFIG_DEBUG_KERNEL=y
1602 -# CONFIG_DEBUG_SHIRQ is not set
1603 -# CONFIG_LOCKUP_DETECTOR is not set
1604 -# CONFIG_HARDLOCKUP_DETECTOR is not set
1605 -# CONFIG_DETECT_HUNG_TASK is not set
1606 # CONFIG_SCHED_DEBUG is not set
1607 -# CONFIG_SCHEDSTATS is not set
1608 -# CONFIG_TIMER_STATS is not set
1609 -# CONFIG_DEBUG_OBJECTS is not set
1610 -# CONFIG_DEBUG_SLAB is not set
1611 -# CONFIG_DEBUG_KMEMLEAK is not set
1612 -# CONFIG_DEBUG_RT_MUTEXES is not set
1613 -# CONFIG_RT_MUTEX_TESTER is not set
1614 -# CONFIG_DEBUG_SPINLOCK is not set
1615 -# CONFIG_DEBUG_MUTEXES is not set
1616 -# CONFIG_DEBUG_LOCK_ALLOC is not set
1617 -# CONFIG_PROVE_LOCKING is not set
1618 -# CONFIG_SPARSE_RCU_POINTER is not set
1619 -# CONFIG_LOCK_STAT is not set
1620 -# CONFIG_DEBUG_ATOMIC_SLEEP is not set
1621 -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1622 -# CONFIG_DEBUG_STACK_USAGE is not set
1623 -# CONFIG_DEBUG_KOBJECT is not set
1624 # CONFIG_DEBUG_BUGVERBOSE is not set
1625 -# CONFIG_DEBUG_INFO is not set
1626 -# CONFIG_DEBUG_VM is not set
1627 -# CONFIG_DEBUG_WRITECOUNT is not set
1628 -# CONFIG_DEBUG_MEMORY_INIT is not set
1629 -# CONFIG_DEBUG_LIST is not set
1630 -# CONFIG_TEST_LIST_SORT is not set
1631 -# CONFIG_DEBUG_SG is not set
1632 -# CONFIG_DEBUG_NOTIFIERS is not set
1633 -# CONFIG_DEBUG_CREDENTIALS is not set
1634 -CONFIG_FRAME_POINTER=y
1635 -# CONFIG_BOOT_PRINTK_DELAY is not set
1636 -# CONFIG_RCU_TORTURE_TEST is not set
1637 -# CONFIG_BACKTRACE_SELF_TEST is not set
1638 -# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1639 -# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1640 -# CONFIG_FAULT_INJECTION is not set
1641 -# CONFIG_LATENCYTOP is not set
1642 -# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1643 -# CONFIG_DEBUG_PAGEALLOC is not set
1644 -CONFIG_HAVE_FUNCTION_TRACER=y
1645 -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1646 -CONFIG_HAVE_DYNAMIC_FTRACE=y
1647 -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1648 -CONFIG_HAVE_C_RECORDMCOUNT=y
1649 -CONFIG_TRACING_SUPPORT=y
1650 # CONFIG_FTRACE is not set
1651 -# CONFIG_DMA_API_DEBUG is not set
1652 -# CONFIG_ATOMIC64_SELFTEST is not set
1653 -# CONFIG_SAMPLES is not set
1654 -CONFIG_HAVE_ARCH_KGDB=y
1655 -# CONFIG_KGDB is not set
1656 -# CONFIG_TEST_KSTRTOX is not set
1657 -# CONFIG_STRICT_DEVMEM is not set
1658 # CONFIG_ARM_UNWIND is not set
1659 -# CONFIG_DEBUG_USER is not set
1660 -# CONFIG_DEBUG_LL is not set
1661 -# CONFIG_OC_ETM is not set
1667 -# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
1668 -# CONFIG_SECURITY_DMESG_RESTRICT is not set
1669 -# CONFIG_SECURITY is not set
1670 -# CONFIG_SECURITYFS is not set
1671 -CONFIG_DEFAULT_SECURITY_DAC=y
1672 -CONFIG_DEFAULT_SECURITY=""
1676 -# Crypto core or helper
1678 -CONFIG_CRYPTO_ALGAPI=y
1679 -CONFIG_CRYPTO_ALGAPI2=y
1680 -CONFIG_CRYPTO_AEAD=m
1681 -CONFIG_CRYPTO_AEAD2=y
1682 -CONFIG_CRYPTO_BLKCIPHER=y
1683 -CONFIG_CRYPTO_BLKCIPHER2=y
1684 -CONFIG_CRYPTO_HASH=y
1685 -CONFIG_CRYPTO_HASH2=y
1686 -CONFIG_CRYPTO_RNG=m
1687 -CONFIG_CRYPTO_RNG2=y
1688 -CONFIG_CRYPTO_PCOMP2=y
1689 -CONFIG_CRYPTO_MANAGER=y
1690 -CONFIG_CRYPTO_MANAGER2=y
1691 -CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
1692 -# CONFIG_CRYPTO_GF128MUL is not set
1693 -# CONFIG_CRYPTO_NULL is not set
1694 -CONFIG_CRYPTO_WORKQUEUE=y
1695 -# CONFIG_CRYPTO_CRYPTD is not set
1696 CONFIG_CRYPTO_AUTHENC=m
1697 -# CONFIG_CRYPTO_TEST is not set
1700 -# Authenticated Encryption with Associated Data
1702 -# CONFIG_CRYPTO_CCM is not set
1703 -# CONFIG_CRYPTO_GCM is not set
1704 CONFIG_CRYPTO_SEQIV=m
1710 -# CONFIG_CRYPTO_CTR is not set
1711 -# CONFIG_CRYPTO_CTS is not set
1712 -CONFIG_CRYPTO_ECB=m
1713 -# CONFIG_CRYPTO_LRW is not set
1714 -# CONFIG_CRYPTO_PCBC is not set
1715 -# CONFIG_CRYPTO_XTS is not set
1720 CONFIG_CRYPTO_HMAC=y
1721 CONFIG_CRYPTO_XCBC=m
1722 -# CONFIG_CRYPTO_VMAC is not set
1727 -CONFIG_CRYPTO_CRC32C=y
1728 -# CONFIG_CRYPTO_GHASH is not set
1729 -CONFIG_CRYPTO_MD4=m
1731 -CONFIG_CRYPTO_MICHAEL_MIC=m
1732 -# CONFIG_CRYPTO_RMD128 is not set
1733 -# CONFIG_CRYPTO_RMD160 is not set
1734 -# CONFIG_CRYPTO_RMD256 is not set
1735 -# CONFIG_CRYPTO_RMD320 is not set
1736 CONFIG_CRYPTO_SHA1=y
1737 CONFIG_CRYPTO_SHA256=m
1738 CONFIG_CRYPTO_SHA512=m
1739 CONFIG_CRYPTO_TGR192=m
1740 CONFIG_CRYPTO_WP512=m
1745 -# CONFIG_CRYPTO_AES is not set
1746 -# CONFIG_CRYPTO_ANUBIS is not set
1747 -CONFIG_CRYPTO_ARC4=m
1748 -# CONFIG_CRYPTO_BLOWFISH is not set
1749 -# CONFIG_CRYPTO_CAMELLIA is not set
1750 CONFIG_CRYPTO_CAST5=m
1751 -# CONFIG_CRYPTO_CAST6 is not set
1753 -# CONFIG_CRYPTO_FCRYPT is not set
1754 -# CONFIG_CRYPTO_KHAZAD is not set
1755 -# CONFIG_CRYPTO_SALSA20 is not set
1756 -# CONFIG_CRYPTO_SEED is not set
1757 -# CONFIG_CRYPTO_SERPENT is not set
1758 -# CONFIG_CRYPTO_TEA is not set
1759 -# CONFIG_CRYPTO_TWOFISH is not set
1764 CONFIG_CRYPTO_DEFLATE=m
1765 -# CONFIG_CRYPTO_ZLIB is not set
1766 -# CONFIG_CRYPTO_LZO is not set
1769 -# Random Number Generation
1771 # CONFIG_CRYPTO_ANSI_CPRNG is not set
1772 -# CONFIG_CRYPTO_USER_API_HASH is not set
1773 -# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
1774 # CONFIG_CRYPTO_HW is not set
1775 -# CONFIG_BINARY_PRINTF is not set
1780 -CONFIG_BITREVERSE=y
1783 -# CONFIG_CRC_T10DIF is not set
1786 -# CONFIG_CRC7 is not set
1788 -# CONFIG_CRC8 is not set
1789 -CONFIG_ZLIB_INFLATE=m
1790 -CONFIG_ZLIB_DEFLATE=m
1791 -# CONFIG_XZ_DEC is not set
1792 -# CONFIG_XZ_DEC_BCJ is not set
1794 -CONFIG_HAS_IOPORT=y
1797 -CONFIG_GENERIC_ATOMIC64=y
1798 -# CONFIG_AVERAGE is not set
1799 -# CONFIG_CORDIC is not set
1801 +++ b/arch/arm/configs/bcmrpi_defconfig
1803 +CONFIG_EXPERIMENTAL=y
1804 +# CONFIG_LOCALVERSION_AUTO is not set
1806 +CONFIG_POSIX_MQUEUE=y
1807 +CONFIG_BSD_PROCESS_ACCT=y
1808 +CONFIG_BSD_PROCESS_ACCT_V3=y
1812 +CONFIG_IKCONFIG_PROC=y
1813 +CONFIG_CGROUP_FREEZER=y
1814 +CONFIG_CGROUP_DEVICE=y
1815 +CONFIG_CGROUP_CPUACCT=y
1816 +CONFIG_RESOURCE_COUNTERS=y
1817 +CONFIG_BLK_CGROUP=y
1818 +CONFIG_NAMESPACES=y
1819 +CONFIG_SCHED_AUTOGROUP=y
1821 +# CONFIG_COMPAT_BRK is not set
1827 +CONFIG_MODULE_UNLOAD=y
1828 +CONFIG_MODVERSIONS=y
1829 +CONFIG_MODULE_SRCVERSION_ALL=y
1830 +# CONFIG_BLK_DEV_BSG is not set
1831 +CONFIG_BLK_DEV_THROTTLING=y
1832 +CONFIG_CFQ_GROUP_IOSCHED=y
1833 +CONFIG_ARCH_BCM2708=y
1835 +CONFIG_HIGH_RES_TIMERS=y
1838 +CONFIG_CC_STACKPROTECTOR=y
1839 +CONFIG_ZBOOT_ROM_TEXT=0x0
1840 +CONFIG_ZBOOT_ROM_BSS=0x0
1841 +CONFIG_CMDLINE="dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext3 rootwait"
1845 +CONFIG_BINFMT_MISC=m
1852 +CONFIG_IP_MULTICAST=y
1854 +CONFIG_IP_PNP_DHCP=y
1855 +CONFIG_IP_PNP_RARP=y
1856 +CONFIG_SYN_COOKIES=y
1857 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
1858 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
1859 +# CONFIG_INET_XFRM_MODE_BEET is not set
1860 +# CONFIG_INET_LRO is not set
1861 +# CONFIG_INET_DIAG is not set
1862 +# CONFIG_IPV6 is not set
1863 +CONFIG_NET_PKTGEN=m
1867 +CONFIG_IRDA_ULTRA=y
1868 +CONFIG_IRDA_CACHE_LAST_LSAP=y
1869 +CONFIG_IRDA_FAST_RR=y
1871 +CONFIG_KINGSUN_DONGLE=m
1872 +CONFIG_KSDAZZLE_DONGLE=m
1873 +CONFIG_KS959_DONGLE=m
1875 +CONFIG_SIGMATEL_FIR=m
1881 +CONFIG_BT_RFCOMM_TTY=y
1883 +CONFIG_BT_BNEP_MC_FILTER=y
1884 +CONFIG_BT_BNEP_PROTO_FILTER=y
1886 +CONFIG_BT_HCIBTUSB=m
1887 +CONFIG_BT_HCIBCM203X=m
1888 +CONFIG_BT_HCIBPA10X=m
1889 +CONFIG_BT_HCIBFUSB=m
1890 +CONFIG_BT_HCIVHCI=m
1892 +CONFIG_BT_MRVL_SDIO=m
1896 +CONFIG_MAC80211_RC_PID=y
1897 +CONFIG_MAC80211_MESH=y
1902 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
1903 +CONFIG_BLK_DEV_LOOP=y
1904 +CONFIG_BLK_DEV_CRYPTOLOOP=m
1905 +CONFIG_BLK_DEV_NBD=m
1906 +CONFIG_BLK_DEV_RAM=y
1907 +CONFIG_CDROM_PKTCDVD=m
1908 +CONFIG_MISC_DEVICES=y
1910 +# CONFIG_SCSI_PROC_FS is not set
1911 +CONFIG_BLK_DEV_SD=y
1912 +CONFIG_BLK_DEV_SR=m
1913 +CONFIG_SCSI_MULTI_LUN=y
1914 +# CONFIG_SCSI_LOWLEVEL is not set
1916 +CONFIG_NETDEVICES=y
1919 +CONFIG_MDIO_BITBANG=m
1920 +CONFIG_NET_ETHERNET=y
1921 +# CONFIG_NETDEV_1000 is not set
1922 +# CONFIG_NETDEV_10000 is not set
1923 +CONFIG_LIBERTAS_THINFIRM=m
1924 +CONFIG_LIBERTAS_THINFIRM_USB=m
1925 +CONFIG_AT76C50X_USB=m
1926 +CONFIG_USB_ZD1201=m
1927 +CONFIG_USB_NET_RNDIS_WLAN=m
1929 +CONFIG_MAC80211_HWSIM=m
1930 +CONFIG_ATH_COMMON=m
1939 +CONFIG_LIBERTAS_USB=m
1940 +CONFIG_LIBERTAS_SDIO=m
1941 +CONFIG_P54_COMMON=m
1947 +CONFIG_RT2800USB_RT53XX=y
1950 +CONFIG_WL12XX_MENU=m
1953 +CONFIG_MWIFIEX_SDIO=m
1954 +CONFIG_WIMAX_I2400M_USB=m
1956 +CONFIG_USB_KAWETH=m
1957 +CONFIG_USB_PEGASUS=m
1958 +CONFIG_USB_RTL8150=m
1959 +CONFIG_USB_USBNET=y
1960 +CONFIG_USB_NET_AX8817X=m
1961 +CONFIG_USB_NET_CDCETHER=m
1962 +CONFIG_USB_NET_CDC_EEM=m
1963 +CONFIG_USB_NET_DM9601=m
1964 +CONFIG_USB_NET_SMSC75XX=m
1965 +CONFIG_USB_NET_SMSC95XX=y
1966 +CONFIG_USB_NET_GL620A=m
1967 +CONFIG_USB_NET_NET1080=m
1968 +CONFIG_USB_NET_PLUSB=m
1969 +CONFIG_USB_NET_MCS7830=m
1970 +CONFIG_USB_NET_CDC_SUBSET=m
1971 +CONFIG_USB_ALI_M5632=y
1972 +CONFIG_USB_AN2720=y
1973 +CONFIG_USB_KC2190=y
1974 +# CONFIG_USB_NET_ZAURUS is not set
1975 +CONFIG_USB_NET_CX82310_ETH=m
1976 +CONFIG_USB_NET_KALMIA=m
1977 +CONFIG_USB_NET_INT51X1=m
1978 +CONFIG_USB_IPHETH=m
1979 +CONFIG_USB_SIERRA_NET=m
1983 +CONFIG_PPP_SYNC_TTY=m
1984 +CONFIG_PPP_DEFLATE=m
1985 +CONFIG_PPP_BSDCOMP=m
1987 +CONFIG_SLIP_COMPRESSED=y
1988 +CONFIG_NETCONSOLE=m
1989 +CONFIG_INPUT_POLLDEV=m
1990 +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
1991 +CONFIG_INPUT_JOYDEV=m
1992 +CONFIG_INPUT_EVDEV=m
1993 +# CONFIG_INPUT_KEYBOARD is not set
1994 +# CONFIG_INPUT_MOUSE is not set
1995 +CONFIG_INPUT_MISC=y
1996 +CONFIG_INPUT_AD714X=m
1997 +CONFIG_INPUT_ATI_REMOTE=m
1998 +CONFIG_INPUT_ATI_REMOTE2=m
1999 +CONFIG_INPUT_KEYSPAN_REMOTE=m
2000 +CONFIG_INPUT_POWERMATE=m
2001 +CONFIG_INPUT_YEALINK=m
2002 +CONFIG_INPUT_CM109=m
2003 +CONFIG_INPUT_UINPUT=m
2004 +CONFIG_INPUT_GPIO_ROTARY_ENCODER=m
2005 +CONFIG_INPUT_ADXL34X=m
2006 +CONFIG_INPUT_CMA3000=m
2010 +CONFIG_GAMEPORT_NS558=m
2011 +CONFIG_GAMEPORT_L4=m
2012 +CONFIG_VT_HW_CONSOLE_BINDING=y
2013 +# CONFIG_LEGACY_PTYS is not set
2014 +# CONFIG_DEVKMEM is not set
2015 +CONFIG_SERIAL_AMBA_PL011=y
2016 +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
2017 +# CONFIG_HW_RANDOM is not set
2018 +CONFIG_RAW_DRIVER=y
2019 +CONFIG_GPIO_SYSFS=y
2020 +# CONFIG_HWMON is not set
2022 +CONFIG_BCM2708_WDT=m
2023 +# CONFIG_MFD_SUPPORT is not set
2025 +CONFIG_FB_BCM2708=y
2026 +CONFIG_FRAMEBUFFER_CONSOLE=y
2028 +# CONFIG_LOGO_LINUX_MONO is not set
2029 +# CONFIG_LOGO_LINUX_VGA16 is not set
2032 +CONFIG_SND_SEQUENCER=m
2033 +CONFIG_SND_SEQ_DUMMY=m
2034 +CONFIG_SND_MIXER_OSS=m
2035 +CONFIG_SND_PCM_OSS=m
2036 +CONFIG_SND_SEQUENCER_OSS=y
2037 +CONFIG_SND_HRTIMER=m
2040 +CONFIG_SND_VIRMIDI=m
2042 +CONFIG_SND_SERIAL_U16550=m
2043 +CONFIG_SND_MPU401=m
2044 +CONFIG_SND_BCM2835=m
2045 +CONFIG_SND_USB_AUDIO=m
2046 +CONFIG_SND_USB_UA101=m
2047 +CONFIG_SND_USB_CAIAQ=m
2048 +CONFIG_SND_USB_6FIRE=m
2049 +CONFIG_SOUND_PRIME=m
2051 +CONFIG_USB_HIDDEV=y
2052 +CONFIG_HID_A4TECH=m
2055 +CONFIG_HID_BELKIN=m
2056 +CONFIG_HID_CHERRY=m
2057 +CONFIG_HID_CHICONY=m
2058 +CONFIG_HID_CYPRESS=m
2059 +CONFIG_HID_DRAGONRISE=m
2060 +CONFIG_HID_EMS_FF=m
2061 +CONFIG_HID_ELECOM=m
2063 +CONFIG_HID_HOLTEK=m
2064 +CONFIG_HID_KEYTOUCH=m
2066 +CONFIG_HID_UCLOGIC=m
2067 +CONFIG_HID_WALTOP=m
2068 +CONFIG_HID_GYRATION=m
2069 +CONFIG_HID_TWINHAN=m
2070 +CONFIG_HID_KENSINGTON=m
2071 +CONFIG_HID_LCPOWER=m
2072 +CONFIG_HID_LOGITECH=m
2073 +CONFIG_HID_MAGICMOUSE=m
2074 +CONFIG_HID_MICROSOFT=m
2075 +CONFIG_HID_MONTEREY=m
2076 +CONFIG_HID_MULTITOUCH=m
2079 +CONFIG_HID_PANTHERLORD=m
2080 +CONFIG_HID_PETALYNX=m
2081 +CONFIG_HID_PICOLCD=m
2082 +CONFIG_HID_QUANTA=m
2083 +CONFIG_HID_ROCCAT=m
2084 +CONFIG_HID_SAMSUNG=m
2086 +CONFIG_HID_SPEEDLINK=m
2087 +CONFIG_HID_SUNPLUS=m
2088 +CONFIG_HID_GREENASIA=m
2089 +CONFIG_HID_SMARTJOYPLUS=m
2090 +CONFIG_HID_TOPSEED=m
2091 +CONFIG_HID_THRUSTMASTER=m
2093 +CONFIG_HID_WIIMOTE=m
2094 +CONFIG_HID_ZEROPLUS=m
2095 +CONFIG_HID_ZYDACRON=m
2097 +CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
2099 +CONFIG_USB_DWCOTG=y
2100 +CONFIG_USB_STORAGE=y
2101 +CONFIG_USB_STORAGE_REALTEK=m
2102 +CONFIG_USB_STORAGE_DATAFAB=m
2103 +CONFIG_USB_STORAGE_FREECOM=m
2104 +CONFIG_USB_STORAGE_ISD200=m
2105 +CONFIG_USB_STORAGE_USBAT=m
2106 +CONFIG_USB_STORAGE_SDDR09=m
2107 +CONFIG_USB_STORAGE_SDDR55=m
2108 +CONFIG_USB_STORAGE_JUMPSHOT=m
2109 +CONFIG_USB_STORAGE_ALAUDA=m
2110 +CONFIG_USB_STORAGE_ONETOUCH=m
2111 +CONFIG_USB_STORAGE_KARMA=m
2112 +CONFIG_USB_STORAGE_CYPRESS_ATACB=m
2113 +CONFIG_USB_STORAGE_ENE_UB6250=m
2115 +CONFIG_USB_LIBUSUAL=y
2116 +CONFIG_USB_MDC800=m
2117 +CONFIG_USB_MICROTEK=m
2118 +CONFIG_USB_SERIAL=m
2119 +CONFIG_USB_SERIAL_GENERIC=y
2120 +CONFIG_USB_SERIAL_AIRCABLE=m
2121 +CONFIG_USB_SERIAL_ARK3116=m
2122 +CONFIG_USB_SERIAL_BELKIN=m
2123 +CONFIG_USB_SERIAL_CH341=m
2124 +CONFIG_USB_SERIAL_WHITEHEAT=m
2125 +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
2126 +CONFIG_USB_SERIAL_CP210X=m
2127 +CONFIG_USB_SERIAL_CYPRESS_M8=m
2128 +CONFIG_USB_SERIAL_EMPEG=m
2129 +CONFIG_USB_SERIAL_FTDI_SIO=m
2130 +CONFIG_USB_SERIAL_FUNSOFT=m
2131 +CONFIG_USB_SERIAL_VISOR=m
2132 +CONFIG_USB_SERIAL_IPAQ=m
2133 +CONFIG_USB_SERIAL_IR=m
2134 +CONFIG_USB_SERIAL_EDGEPORT=m
2135 +CONFIG_USB_SERIAL_EDGEPORT_TI=m
2136 +CONFIG_USB_SERIAL_GARMIN=m
2137 +CONFIG_USB_SERIAL_IPW=m
2138 +CONFIG_USB_SERIAL_IUU=m
2139 +CONFIG_USB_SERIAL_KEYSPAN_PDA=m
2140 +CONFIG_USB_SERIAL_KEYSPAN=m
2141 +CONFIG_USB_SERIAL_KLSI=m
2142 +CONFIG_USB_SERIAL_KOBIL_SCT=m
2143 +CONFIG_USB_SERIAL_MCT_U232=m
2144 +CONFIG_USB_SERIAL_MOS7720=m
2145 +CONFIG_USB_SERIAL_MOS7840=m
2146 +CONFIG_USB_SERIAL_MOTOROLA=m
2147 +CONFIG_USB_SERIAL_NAVMAN=m
2148 +CONFIG_USB_SERIAL_PL2303=m
2149 +CONFIG_USB_SERIAL_OTI6858=m
2150 +CONFIG_USB_SERIAL_QCAUX=m
2151 +CONFIG_USB_SERIAL_QUALCOMM=m
2152 +CONFIG_USB_SERIAL_SPCP8X5=m
2153 +CONFIG_USB_SERIAL_HP4X=m
2154 +CONFIG_USB_SERIAL_SAFE=m
2155 +CONFIG_USB_SERIAL_SIEMENS_MPI=m
2156 +CONFIG_USB_SERIAL_SIERRAWIRELESS=m
2157 +CONFIG_USB_SERIAL_SYMBOL=m
2158 +CONFIG_USB_SERIAL_TI=m
2159 +CONFIG_USB_SERIAL_CYBERJACK=m
2160 +CONFIG_USB_SERIAL_XIRCOM=m
2161 +CONFIG_USB_SERIAL_OPTION=m
2162 +CONFIG_USB_SERIAL_OMNINET=m
2163 +CONFIG_USB_SERIAL_OPTICON=m
2164 +CONFIG_USB_SERIAL_VIVOPAY_SERIAL=m
2165 +CONFIG_USB_SERIAL_ZIO=m
2166 +CONFIG_USB_SERIAL_SSU100=m
2167 +CONFIG_USB_SERIAL_DEBUG=m
2170 +CONFIG_USB_ADUTUX=m
2171 +CONFIG_USB_SEVSEG=m
2172 +CONFIG_USB_RIO500=m
2173 +CONFIG_USB_LEGOTOWER=m
2176 +CONFIG_USB_CYPRESS_CY7C63=m
2177 +CONFIG_USB_CYTHERM=m
2178 +CONFIG_USB_IDMOUSE=m
2179 +CONFIG_USB_FTDI_ELAN=m
2180 +CONFIG_USB_APPLEDISPLAY=m
2182 +CONFIG_USB_TRANCEVIBRATOR=m
2183 +CONFIG_USB_IOWARRIOR=m
2185 +CONFIG_USB_ISIGHTFW=m
2189 +CONFIG_MMC_SDHCI_PLTFM=y
2190 +CONFIG_MMC_SDHCI_BCM2708=y
2191 +CONFIG_MMC_SDHCI_BCM2708_DMA=y
2193 +CONFIG_LEDS_TRIGGER_TIMER=m
2194 +CONFIG_LEDS_TRIGGER_HEARTBEAT=m
2195 +CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
2198 +CONFIG_UIO_PDRV_GENIRQ=m
2199 +# CONFIG_IOMMU_SUPPORT is not set
2201 +CONFIG_EXT4_FS_POSIX_ACL=y
2202 +CONFIG_EXT4_FS_SECURITY=y
2203 +CONFIG_REISERFS_FS=m
2204 +CONFIG_REISERFS_FS_XATTR=y
2205 +CONFIG_REISERFS_FS_POSIX_ACL=y
2206 +CONFIG_REISERFS_FS_SECURITY=y
2208 +CONFIG_JFS_POSIX_ACL=y
2209 +CONFIG_JFS_SECURITY=y
2210 +CONFIG_JFS_STATISTICS=y
2213 +CONFIG_XFS_POSIX_ACL=y
2218 +CONFIG_BTRFS_FS_POSIX_ACL=y
2221 +CONFIG_AUTOFS4_FS=y
2225 +CONFIG_FSCACHE_STATS=y
2226 +CONFIG_FSCACHE_HISTOGRAM=y
2227 +CONFIG_CACHEFILES=y
2228 +CONFIG_ISO9660_FS=m
2234 +CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
2237 +CONFIG_TMPFS_POSIX_ACL=y
2238 +CONFIG_CONFIGFS_FS=y
2240 +CONFIG_SQUASHFS_XATTR=y
2241 +CONFIG_SQUASHFS_LZO=y
2242 +CONFIG_SQUASHFS_XZ=y
2245 +CONFIG_NFS_V3_ACL=y
2248 +CONFIG_NFS_FSCACHE=y
2250 +CONFIG_CIFS_WEAK_PW_HASH=y
2251 +CONFIG_CIFS_XATTR=y
2252 +CONFIG_CIFS_POSIX=y
2254 +CONFIG_9P_FS_POSIX_ACL=y
2255 +CONFIG_PARTITION_ADVANCED=y
2256 +CONFIG_MAC_PARTITION=y
2257 +CONFIG_EFI_PARTITION=y
2258 +CONFIG_NLS_DEFAULT="utf8"
2259 +CONFIG_NLS_CODEPAGE_437=y
2260 +CONFIG_NLS_CODEPAGE_737=m
2261 +CONFIG_NLS_CODEPAGE_775=m
2262 +CONFIG_NLS_CODEPAGE_850=m
2263 +CONFIG_NLS_CODEPAGE_852=m
2264 +CONFIG_NLS_CODEPAGE_855=m
2265 +CONFIG_NLS_CODEPAGE_857=m
2266 +CONFIG_NLS_CODEPAGE_860=m
2267 +CONFIG_NLS_CODEPAGE_861=m
2268 +CONFIG_NLS_CODEPAGE_862=m
2269 +CONFIG_NLS_CODEPAGE_863=m
2270 +CONFIG_NLS_CODEPAGE_864=m
2271 +CONFIG_NLS_CODEPAGE_865=m
2272 +CONFIG_NLS_CODEPAGE_866=m
2273 +CONFIG_NLS_CODEPAGE_869=m
2274 +CONFIG_NLS_CODEPAGE_936=m
2275 +CONFIG_NLS_CODEPAGE_950=m
2276 +CONFIG_NLS_CODEPAGE_932=m
2277 +CONFIG_NLS_CODEPAGE_949=m
2278 +CONFIG_NLS_CODEPAGE_874=m
2279 +CONFIG_NLS_ISO8859_8=m
2280 +CONFIG_NLS_CODEPAGE_1250=m
2281 +CONFIG_NLS_CODEPAGE_1251=m
2283 +CONFIG_NLS_ISO8859_1=m
2284 +CONFIG_NLS_ISO8859_2=m
2285 +CONFIG_NLS_ISO8859_3=m
2286 +CONFIG_NLS_ISO8859_4=m
2287 +CONFIG_NLS_ISO8859_5=m
2288 +CONFIG_NLS_ISO8859_6=m
2289 +CONFIG_NLS_ISO8859_7=m
2290 +CONFIG_NLS_ISO8859_9=m
2291 +CONFIG_NLS_ISO8859_13=m
2292 +CONFIG_NLS_ISO8859_14=m
2293 +CONFIG_NLS_ISO8859_15=m
2294 +CONFIG_NLS_KOI8_R=m
2295 +CONFIG_NLS_KOI8_U=m
2297 +CONFIG_PRINTK_TIME=y
2298 +CONFIG_DETECT_HUNG_TASK=y
2299 +CONFIG_TIMER_STATS=y
2300 +CONFIG_DEBUG_STACK_USAGE=y
2301 +CONFIG_DEBUG_INFO=y
2302 +CONFIG_DEBUG_MEMORY_INIT=y
2303 +CONFIG_BOOT_PRINTK_DELAY=y
2304 +CONFIG_LATENCYTOP=y
2305 +CONFIG_SYSCTL_SYSCALL_CHECK=y
2306 +CONFIG_IRQSOFF_TRACER=y
2307 +CONFIG_SCHED_TRACER=y
2308 +CONFIG_STACK_TRACER=y
2309 +CONFIG_BLK_DEV_IO_TRACE=y
2310 +CONFIG_FUNCTION_PROFILER=y
2313 +CONFIG_KDB_KEYBOARD=y
2314 +CONFIG_STRICT_DEVMEM=y
2315 +CONFIG_CRYPTO_AUTHENC=m
2316 +CONFIG_CRYPTO_SEQIV=m
2317 +CONFIG_CRYPTO_CBC=y
2318 +CONFIG_CRYPTO_HMAC=y
2319 +CONFIG_CRYPTO_XCBC=m
2320 +CONFIG_CRYPTO_MD5=y
2321 +CONFIG_CRYPTO_SHA1=y
2322 +CONFIG_CRYPTO_SHA256=m
2323 +CONFIG_CRYPTO_SHA512=m
2324 +CONFIG_CRYPTO_TGR192=m
2325 +CONFIG_CRYPTO_WP512=m
2326 +CONFIG_CRYPTO_CAST5=m
2327 +CONFIG_CRYPTO_DES=y
2328 +CONFIG_CRYPTO_DEFLATE=m
2329 +# CONFIG_CRYPTO_ANSI_CPRNG is not set
2330 +# CONFIG_CRYPTO_HW is not set
2334 +++ b/arch/arm/configs/bcmrpi_emergency_defconfig
2336 +CONFIG_EXPERIMENTAL=y
2337 +# CONFIG_LOCALVERSION_AUTO is not set
2339 +CONFIG_POSIX_MQUEUE=y
2340 +CONFIG_BSD_PROCESS_ACCT=y
2341 +CONFIG_BSD_PROCESS_ACCT_V3=y
2345 +CONFIG_IKCONFIG_PROC=y
2346 +CONFIG_BLK_DEV_INITRD=y
2347 +CONFIG_INITRAMFS_SOURCE="../target_fs"
2348 +CONFIG_CGROUP_FREEZER=y
2349 +CONFIG_CGROUP_DEVICE=y
2350 +CONFIG_CGROUP_CPUACCT=y
2351 +CONFIG_RESOURCE_COUNTERS=y
2352 +CONFIG_BLK_CGROUP=y
2353 +CONFIG_NAMESPACES=y
2354 +CONFIG_SCHED_AUTOGROUP=y
2356 +# CONFIG_COMPAT_BRK is not set
2362 +CONFIG_MODULE_UNLOAD=y
2363 +CONFIG_MODVERSIONS=y
2364 +CONFIG_MODULE_SRCVERSION_ALL=y
2365 +# CONFIG_BLK_DEV_BSG is not set
2366 +CONFIG_BLK_DEV_THROTTLING=y
2367 +CONFIG_CFQ_GROUP_IOSCHED=y
2368 +CONFIG_ARCH_BCM2708=y
2370 +CONFIG_HIGH_RES_TIMERS=y
2373 +CONFIG_CC_STACKPROTECTOR=y
2374 +CONFIG_ZBOOT_ROM_TEXT=0x0
2375 +CONFIG_ZBOOT_ROM_BSS=0x0
2376 +CONFIG_CMDLINE="dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext3 rootwait"
2380 +CONFIG_BINFMT_MISC=m
2387 +CONFIG_IP_MULTICAST=y
2389 +CONFIG_IP_PNP_DHCP=y
2390 +CONFIG_IP_PNP_RARP=y
2391 +CONFIG_SYN_COOKIES=y
2392 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
2393 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
2394 +# CONFIG_INET_XFRM_MODE_BEET is not set
2395 +# CONFIG_INET_LRO is not set
2396 +# CONFIG_INET_DIAG is not set
2397 +# CONFIG_IPV6 is not set
2398 +CONFIG_NET_PKTGEN=m
2402 +CONFIG_IRDA_ULTRA=y
2403 +CONFIG_IRDA_CACHE_LAST_LSAP=y
2404 +CONFIG_IRDA_FAST_RR=y
2406 +CONFIG_KINGSUN_DONGLE=m
2407 +CONFIG_KSDAZZLE_DONGLE=m
2408 +CONFIG_KS959_DONGLE=m
2410 +CONFIG_SIGMATEL_FIR=m
2416 +CONFIG_BT_RFCOMM_TTY=y
2418 +CONFIG_BT_BNEP_MC_FILTER=y
2419 +CONFIG_BT_BNEP_PROTO_FILTER=y
2421 +CONFIG_BT_HCIBTUSB=m
2422 +CONFIG_BT_HCIBCM203X=m
2423 +CONFIG_BT_HCIBPA10X=m
2424 +CONFIG_BT_HCIBFUSB=m
2425 +CONFIG_BT_HCIVHCI=m
2427 +CONFIG_BT_MRVL_SDIO=m
2431 +CONFIG_MAC80211_RC_PID=y
2432 +CONFIG_MAC80211_MESH=y
2437 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
2438 +CONFIG_BLK_DEV_LOOP=y
2439 +CONFIG_BLK_DEV_CRYPTOLOOP=m
2440 +CONFIG_BLK_DEV_NBD=m
2441 +CONFIG_BLK_DEV_RAM=y
2442 +CONFIG_CDROM_PKTCDVD=m
2443 +CONFIG_MISC_DEVICES=y
2445 +# CONFIG_SCSI_PROC_FS is not set
2446 +CONFIG_BLK_DEV_SD=y
2447 +CONFIG_BLK_DEV_SR=m
2448 +CONFIG_SCSI_MULTI_LUN=y
2449 +# CONFIG_SCSI_LOWLEVEL is not set
2451 +CONFIG_NETDEVICES=y
2454 +CONFIG_MDIO_BITBANG=m
2455 +CONFIG_NET_ETHERNET=y
2456 +# CONFIG_NETDEV_1000 is not set
2457 +# CONFIG_NETDEV_10000 is not set
2458 +CONFIG_LIBERTAS_THINFIRM=m
2459 +CONFIG_LIBERTAS_THINFIRM_USB=m
2460 +CONFIG_AT76C50X_USB=m
2461 +CONFIG_USB_ZD1201=m
2462 +CONFIG_USB_NET_RNDIS_WLAN=m
2464 +CONFIG_MAC80211_HWSIM=m
2465 +CONFIG_ATH_COMMON=m
2474 +CONFIG_LIBERTAS_USB=m
2475 +CONFIG_LIBERTAS_SDIO=m
2476 +CONFIG_P54_COMMON=m
2482 +CONFIG_RT2800USB_RT53XX=y
2485 +CONFIG_WL12XX_MENU=m
2488 +CONFIG_MWIFIEX_SDIO=m
2489 +CONFIG_WIMAX_I2400M_USB=m
2491 +CONFIG_USB_KAWETH=m
2492 +CONFIG_USB_PEGASUS=m
2493 +CONFIG_USB_RTL8150=m
2494 +CONFIG_USB_USBNET=y
2495 +CONFIG_USB_NET_AX8817X=m
2496 +CONFIG_USB_NET_CDCETHER=m
2497 +CONFIG_USB_NET_CDC_EEM=m
2498 +CONFIG_USB_NET_DM9601=m
2499 +CONFIG_USB_NET_SMSC75XX=m
2500 +CONFIG_USB_NET_SMSC95XX=y
2501 +CONFIG_USB_NET_GL620A=m
2502 +CONFIG_USB_NET_NET1080=m
2503 +CONFIG_USB_NET_PLUSB=m
2504 +CONFIG_USB_NET_MCS7830=m
2505 +CONFIG_USB_NET_CDC_SUBSET=m
2506 +CONFIG_USB_ALI_M5632=y
2507 +CONFIG_USB_AN2720=y
2508 +CONFIG_USB_KC2190=y
2509 +# CONFIG_USB_NET_ZAURUS is not set
2510 +CONFIG_USB_NET_CX82310_ETH=m
2511 +CONFIG_USB_NET_KALMIA=m
2512 +CONFIG_USB_NET_INT51X1=m
2513 +CONFIG_USB_IPHETH=m
2514 +CONFIG_USB_SIERRA_NET=m
2518 +CONFIG_PPP_SYNC_TTY=m
2519 +CONFIG_PPP_DEFLATE=m
2520 +CONFIG_PPP_BSDCOMP=m
2522 +CONFIG_SLIP_COMPRESSED=y
2523 +CONFIG_NETCONSOLE=m
2524 +CONFIG_INPUT_POLLDEV=m
2525 +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
2526 +CONFIG_INPUT_JOYDEV=m
2527 +CONFIG_INPUT_EVDEV=m
2528 +# CONFIG_INPUT_KEYBOARD is not set
2529 +# CONFIG_INPUT_MOUSE is not set
2530 +CONFIG_INPUT_MISC=y
2531 +CONFIG_INPUT_AD714X=m
2532 +CONFIG_INPUT_ATI_REMOTE=m
2533 +CONFIG_INPUT_ATI_REMOTE2=m
2534 +CONFIG_INPUT_KEYSPAN_REMOTE=m
2535 +CONFIG_INPUT_POWERMATE=m
2536 +CONFIG_INPUT_YEALINK=m
2537 +CONFIG_INPUT_CM109=m
2538 +CONFIG_INPUT_UINPUT=m
2539 +CONFIG_INPUT_GPIO_ROTARY_ENCODER=m
2540 +CONFIG_INPUT_ADXL34X=m
2541 +CONFIG_INPUT_CMA3000=m
2545 +CONFIG_GAMEPORT_NS558=m
2546 +CONFIG_GAMEPORT_L4=m
2547 +CONFIG_VT_HW_CONSOLE_BINDING=y
2548 +# CONFIG_LEGACY_PTYS is not set
2549 +# CONFIG_DEVKMEM is not set
2550 +CONFIG_SERIAL_AMBA_PL011=y
2551 +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
2552 +# CONFIG_HW_RANDOM is not set
2553 +CONFIG_RAW_DRIVER=y
2554 +CONFIG_GPIO_SYSFS=y
2555 +# CONFIG_HWMON is not set
2557 +CONFIG_BCM2708_WDT=m
2558 +# CONFIG_MFD_SUPPORT is not set
2560 +CONFIG_FB_BCM2708=y
2561 +CONFIG_FRAMEBUFFER_CONSOLE=y
2563 +# CONFIG_LOGO_LINUX_MONO is not set
2564 +# CONFIG_LOGO_LINUX_VGA16 is not set
2567 +CONFIG_SND_SEQUENCER=m
2568 +CONFIG_SND_SEQ_DUMMY=m
2569 +CONFIG_SND_MIXER_OSS=m
2570 +CONFIG_SND_PCM_OSS=m
2571 +CONFIG_SND_SEQUENCER_OSS=y
2572 +CONFIG_SND_HRTIMER=m
2575 +CONFIG_SND_VIRMIDI=m
2577 +CONFIG_SND_SERIAL_U16550=m
2578 +CONFIG_SND_MPU401=m
2579 +CONFIG_SND_BCM2835=m
2580 +CONFIG_SND_USB_AUDIO=m
2581 +CONFIG_SND_USB_UA101=m
2582 +CONFIG_SND_USB_CAIAQ=m
2583 +CONFIG_SND_USB_6FIRE=m
2584 +CONFIG_SOUND_PRIME=m
2586 +CONFIG_USB_HIDDEV=y
2587 +CONFIG_HID_A4TECH=m
2590 +CONFIG_HID_BELKIN=m
2591 +CONFIG_HID_CHERRY=m
2592 +CONFIG_HID_CHICONY=m
2593 +CONFIG_HID_CYPRESS=m
2594 +CONFIG_HID_DRAGONRISE=m
2595 +CONFIG_HID_EMS_FF=m
2596 +CONFIG_HID_ELECOM=m
2598 +CONFIG_HID_HOLTEK=m
2599 +CONFIG_HID_KEYTOUCH=m
2601 +CONFIG_HID_UCLOGIC=m
2602 +CONFIG_HID_WALTOP=m
2603 +CONFIG_HID_GYRATION=m
2604 +CONFIG_HID_TWINHAN=m
2605 +CONFIG_HID_KENSINGTON=m
2606 +CONFIG_HID_LCPOWER=m
2607 +CONFIG_HID_LOGITECH=m
2608 +CONFIG_HID_MAGICMOUSE=m
2609 +CONFIG_HID_MICROSOFT=m
2610 +CONFIG_HID_MONTEREY=m
2611 +CONFIG_HID_MULTITOUCH=m
2614 +CONFIG_HID_PANTHERLORD=m
2615 +CONFIG_HID_PETALYNX=m
2616 +CONFIG_HID_PICOLCD=m
2617 +CONFIG_HID_QUANTA=m
2618 +CONFIG_HID_ROCCAT=m
2619 +CONFIG_HID_SAMSUNG=m
2621 +CONFIG_HID_SPEEDLINK=m
2622 +CONFIG_HID_SUNPLUS=m
2623 +CONFIG_HID_GREENASIA=m
2624 +CONFIG_HID_SMARTJOYPLUS=m
2625 +CONFIG_HID_TOPSEED=m
2626 +CONFIG_HID_THRUSTMASTER=m
2628 +CONFIG_HID_WIIMOTE=m
2629 +CONFIG_HID_ZEROPLUS=m
2630 +CONFIG_HID_ZYDACRON=m
2632 +CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
2634 +CONFIG_USB_DWCOTG=y
2635 +CONFIG_USB_STORAGE=y
2636 +CONFIG_USB_STORAGE_REALTEK=m
2637 +CONFIG_USB_STORAGE_DATAFAB=m
2638 +CONFIG_USB_STORAGE_FREECOM=m
2639 +CONFIG_USB_STORAGE_ISD200=m
2640 +CONFIG_USB_STORAGE_USBAT=m
2641 +CONFIG_USB_STORAGE_SDDR09=m
2642 +CONFIG_USB_STORAGE_SDDR55=m
2643 +CONFIG_USB_STORAGE_JUMPSHOT=m
2644 +CONFIG_USB_STORAGE_ALAUDA=m
2645 +CONFIG_USB_STORAGE_ONETOUCH=m
2646 +CONFIG_USB_STORAGE_KARMA=m
2647 +CONFIG_USB_STORAGE_CYPRESS_ATACB=m
2648 +CONFIG_USB_STORAGE_ENE_UB6250=m
2650 +CONFIG_USB_LIBUSUAL=y
2651 +CONFIG_USB_MDC800=m
2652 +CONFIG_USB_MICROTEK=m
2653 +CONFIG_USB_SERIAL=m
2654 +CONFIG_USB_SERIAL_GENERIC=y
2655 +CONFIG_USB_SERIAL_AIRCABLE=m
2656 +CONFIG_USB_SERIAL_ARK3116=m
2657 +CONFIG_USB_SERIAL_BELKIN=m
2658 +CONFIG_USB_SERIAL_CH341=m
2659 +CONFIG_USB_SERIAL_WHITEHEAT=m
2660 +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
2661 +CONFIG_USB_SERIAL_CP210X=m
2662 +CONFIG_USB_SERIAL_CYPRESS_M8=m
2663 +CONFIG_USB_SERIAL_EMPEG=m
2664 +CONFIG_USB_SERIAL_FTDI_SIO=m
2665 +CONFIG_USB_SERIAL_FUNSOFT=m
2666 +CONFIG_USB_SERIAL_VISOR=m
2667 +CONFIG_USB_SERIAL_IPAQ=m
2668 +CONFIG_USB_SERIAL_IR=m
2669 +CONFIG_USB_SERIAL_EDGEPORT=m
2670 +CONFIG_USB_SERIAL_EDGEPORT_TI=m
2671 +CONFIG_USB_SERIAL_GARMIN=m
2672 +CONFIG_USB_SERIAL_IPW=m
2673 +CONFIG_USB_SERIAL_IUU=m
2674 +CONFIG_USB_SERIAL_KEYSPAN_PDA=m
2675 +CONFIG_USB_SERIAL_KEYSPAN=m
2676 +CONFIG_USB_SERIAL_KLSI=m
2677 +CONFIG_USB_SERIAL_KOBIL_SCT=m
2678 +CONFIG_USB_SERIAL_MCT_U232=m
2679 +CONFIG_USB_SERIAL_MOS7720=m
2680 +CONFIG_USB_SERIAL_MOS7840=m
2681 +CONFIG_USB_SERIAL_MOTOROLA=m
2682 +CONFIG_USB_SERIAL_NAVMAN=m
2683 +CONFIG_USB_SERIAL_PL2303=m
2684 +CONFIG_USB_SERIAL_OTI6858=m
2685 +CONFIG_USB_SERIAL_QCAUX=m
2686 +CONFIG_USB_SERIAL_QUALCOMM=m
2687 +CONFIG_USB_SERIAL_SPCP8X5=m
2688 +CONFIG_USB_SERIAL_HP4X=m
2689 +CONFIG_USB_SERIAL_SAFE=m
2690 +CONFIG_USB_SERIAL_SIEMENS_MPI=m
2691 +CONFIG_USB_SERIAL_SIERRAWIRELESS=m
2692 +CONFIG_USB_SERIAL_SYMBOL=m
2693 +CONFIG_USB_SERIAL_TI=m
2694 +CONFIG_USB_SERIAL_CYBERJACK=m
2695 +CONFIG_USB_SERIAL_XIRCOM=m
2696 +CONFIG_USB_SERIAL_OPTION=m
2697 +CONFIG_USB_SERIAL_OMNINET=m
2698 +CONFIG_USB_SERIAL_OPTICON=m
2699 +CONFIG_USB_SERIAL_VIVOPAY_SERIAL=m
2700 +CONFIG_USB_SERIAL_ZIO=m
2701 +CONFIG_USB_SERIAL_SSU100=m
2702 +CONFIG_USB_SERIAL_DEBUG=m
2705 +CONFIG_USB_ADUTUX=m
2706 +CONFIG_USB_SEVSEG=m
2707 +CONFIG_USB_RIO500=m
2708 +CONFIG_USB_LEGOTOWER=m
2711 +CONFIG_USB_CYPRESS_CY7C63=m
2712 +CONFIG_USB_CYTHERM=m
2713 +CONFIG_USB_IDMOUSE=m
2714 +CONFIG_USB_FTDI_ELAN=m
2715 +CONFIG_USB_APPLEDISPLAY=m
2717 +CONFIG_USB_TRANCEVIBRATOR=m
2718 +CONFIG_USB_IOWARRIOR=m
2720 +CONFIG_USB_ISIGHTFW=m
2724 +CONFIG_MMC_SDHCI_PLTFM=y
2725 +CONFIG_MMC_SDHCI_BCM2708=y
2726 +CONFIG_MMC_SDHCI_BCM2708_DMA=y
2728 +CONFIG_LEDS_TRIGGER_TIMER=m
2729 +CONFIG_LEDS_TRIGGER_HEARTBEAT=m
2730 +CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
2733 +CONFIG_UIO_PDRV_GENIRQ=m
2734 +# CONFIG_IOMMU_SUPPORT is not set
2736 +CONFIG_EXT4_FS_POSIX_ACL=y
2737 +CONFIG_EXT4_FS_SECURITY=y
2738 +CONFIG_REISERFS_FS=m
2739 +CONFIG_REISERFS_FS_XATTR=y
2740 +CONFIG_REISERFS_FS_POSIX_ACL=y
2741 +CONFIG_REISERFS_FS_SECURITY=y
2743 +CONFIG_JFS_POSIX_ACL=y
2744 +CONFIG_JFS_SECURITY=y
2745 +CONFIG_JFS_STATISTICS=y
2748 +CONFIG_XFS_POSIX_ACL=y
2753 +CONFIG_BTRFS_FS_POSIX_ACL=y
2756 +CONFIG_AUTOFS4_FS=y
2760 +CONFIG_FSCACHE_STATS=y
2761 +CONFIG_FSCACHE_HISTOGRAM=y
2762 +CONFIG_CACHEFILES=y
2763 +CONFIG_ISO9660_FS=m
2769 +CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
2772 +CONFIG_TMPFS_POSIX_ACL=y
2773 +CONFIG_CONFIGFS_FS=y
2775 +CONFIG_SQUASHFS_XATTR=y
2776 +CONFIG_SQUASHFS_LZO=y
2777 +CONFIG_SQUASHFS_XZ=y
2780 +CONFIG_NFS_V3_ACL=y
2783 +CONFIG_NFS_FSCACHE=y
2785 +CONFIG_CIFS_WEAK_PW_HASH=y
2786 +CONFIG_CIFS_XATTR=y
2787 +CONFIG_CIFS_POSIX=y
2789 +CONFIG_9P_FS_POSIX_ACL=y
2790 +CONFIG_PARTITION_ADVANCED=y
2791 +CONFIG_MAC_PARTITION=y
2792 +CONFIG_EFI_PARTITION=y
2793 +CONFIG_NLS_DEFAULT="utf8"
2794 +CONFIG_NLS_CODEPAGE_437=y
2795 +CONFIG_NLS_CODEPAGE_737=m
2796 +CONFIG_NLS_CODEPAGE_775=m
2797 +CONFIG_NLS_CODEPAGE_850=m
2798 +CONFIG_NLS_CODEPAGE_852=m
2799 +CONFIG_NLS_CODEPAGE_855=m
2800 +CONFIG_NLS_CODEPAGE_857=m
2801 +CONFIG_NLS_CODEPAGE_860=m
2802 +CONFIG_NLS_CODEPAGE_861=m
2803 +CONFIG_NLS_CODEPAGE_862=m
2804 +CONFIG_NLS_CODEPAGE_863=m
2805 +CONFIG_NLS_CODEPAGE_864=m
2806 +CONFIG_NLS_CODEPAGE_865=m
2807 +CONFIG_NLS_CODEPAGE_866=m
2808 +CONFIG_NLS_CODEPAGE_869=m
2809 +CONFIG_NLS_CODEPAGE_936=m
2810 +CONFIG_NLS_CODEPAGE_950=m
2811 +CONFIG_NLS_CODEPAGE_932=m
2812 +CONFIG_NLS_CODEPAGE_949=m
2813 +CONFIG_NLS_CODEPAGE_874=m
2814 +CONFIG_NLS_ISO8859_8=m
2815 +CONFIG_NLS_CODEPAGE_1250=m
2816 +CONFIG_NLS_CODEPAGE_1251=m
2818 +CONFIG_NLS_ISO8859_1=m
2819 +CONFIG_NLS_ISO8859_2=m
2820 +CONFIG_NLS_ISO8859_3=m
2821 +CONFIG_NLS_ISO8859_4=m
2822 +CONFIG_NLS_ISO8859_5=m
2823 +CONFIG_NLS_ISO8859_6=m
2824 +CONFIG_NLS_ISO8859_7=m
2825 +CONFIG_NLS_ISO8859_9=m
2826 +CONFIG_NLS_ISO8859_13=m
2827 +CONFIG_NLS_ISO8859_14=m
2828 +CONFIG_NLS_ISO8859_15=m
2829 +CONFIG_NLS_KOI8_R=m
2830 +CONFIG_NLS_KOI8_U=m
2832 +CONFIG_PRINTK_TIME=y
2833 +CONFIG_DETECT_HUNG_TASK=y
2834 +CONFIG_TIMER_STATS=y
2835 +CONFIG_DEBUG_STACK_USAGE=y
2836 +CONFIG_DEBUG_INFO=y
2837 +CONFIG_DEBUG_MEMORY_INIT=y
2838 +CONFIG_BOOT_PRINTK_DELAY=y
2839 +CONFIG_LATENCYTOP=y
2840 +CONFIG_SYSCTL_SYSCALL_CHECK=y
2841 +CONFIG_IRQSOFF_TRACER=y
2842 +CONFIG_SCHED_TRACER=y
2843 +CONFIG_STACK_TRACER=y
2844 +CONFIG_BLK_DEV_IO_TRACE=y
2845 +CONFIG_FUNCTION_PROFILER=y
2848 +CONFIG_KDB_KEYBOARD=y
2849 +CONFIG_STRICT_DEVMEM=y
2850 +CONFIG_CRYPTO_AUTHENC=m
2851 +CONFIG_CRYPTO_SEQIV=m
2852 +CONFIG_CRYPTO_CBC=y
2853 +CONFIG_CRYPTO_HMAC=y
2854 +CONFIG_CRYPTO_XCBC=m
2855 +CONFIG_CRYPTO_MD5=y
2856 +CONFIG_CRYPTO_SHA1=y
2857 +CONFIG_CRYPTO_SHA256=m
2858 +CONFIG_CRYPTO_SHA512=m
2859 +CONFIG_CRYPTO_TGR192=m
2860 +CONFIG_CRYPTO_WP512=m
2861 +CONFIG_CRYPTO_CAST5=m
2862 +CONFIG_CRYPTO_DES=y
2863 +CONFIG_CRYPTO_DEFLATE=m
2864 +# CONFIG_CRYPTO_ANSI_CPRNG is not set
2865 +# CONFIG_CRYPTO_HW is not set
2868 --- a/arch/arm/mach-bcm2708/Kconfig
2869 +++ b/arch/arm/mach-bcm2708/Kconfig
2870 @@ -22,4 +22,11 @@ config BCM2708_VCMEM
2872 Helper for videocore memory access and total size allocation.
2874 +config BCM2708_NOL2CACHE
2875 + bool "Videocore L2 cache disable"
2876 + depends on MACH_BCM2708
2879 + Do not allow ARM to use GPU's L2 cache. Requires disable_l2cache in config.txt.
2882 --- a/arch/arm/mach-bcm2708/bcm2708.c
2883 +++ b/arch/arm/mach-bcm2708/bcm2708.c
2885 #include <linux/clockchips.h>
2886 #include <linux/cnt32_to_63.h>
2887 #include <linux/io.h>
2888 +#include <linux/module.h>
2890 #include <linux/version.h>
2891 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
2894 #define DMA_MASK_BITS_COMMON 32
2896 +/* command line parameters */
2897 +static unsigned boardrev, serial;
2899 static void __init bcm2708_init_led(void);
2901 void __init bcm2708_init_irq(void)
2902 @@ -77,58 +81,57 @@ void __init bcm2708_init_irq(void)
2904 static struct map_desc bcm2708_io_desc[] __initdata = {
2906 - .virtual = IO_ADDRESS(ARMCTRL_BASE),
2907 - .pfn = __phys_to_pfn(ARMCTRL_BASE),
2911 - .virtual = IO_ADDRESS(UART0_BASE),
2912 - .pfn = __phys_to_pfn(UART0_BASE),
2916 - .virtual = IO_ADDRESS(UART1_BASE),
2917 - .pfn = __phys_to_pfn(UART1_BASE),
2921 -#ifdef CONFIG_MMC_BCM2708 /* broadcom legacy SD */
2922 - .virtual = IO_ADDRESS(MMCI0_BASE),
2923 - .pfn = __phys_to_pfn(MMCI0_BASE),
2928 - .virtual = IO_ADDRESS(DMA_BASE),
2929 - .pfn = __phys_to_pfn(DMA_BASE),
2933 - .virtual = IO_ADDRESS(MCORE_BASE),
2934 - .pfn = __phys_to_pfn(MCORE_BASE),
2938 - .virtual = IO_ADDRESS(ST_BASE),
2939 - .pfn = __phys_to_pfn(ST_BASE),
2943 - .virtual = IO_ADDRESS(USB_BASE),
2944 - .pfn = __phys_to_pfn(USB_BASE),
2945 - .length = SZ_128K,
2948 - .virtual = IO_ADDRESS(PM_BASE),
2949 - .pfn = __phys_to_pfn(PM_BASE),
2953 - .virtual = IO_ADDRESS(GPIO_BASE),
2954 - .pfn = __phys_to_pfn(GPIO_BASE),
2958 + .virtual = IO_ADDRESS(ARMCTRL_BASE),
2959 + .pfn = __phys_to_pfn(ARMCTRL_BASE),
2961 + .type = MT_DEVICE},
2963 + .virtual = IO_ADDRESS(UART0_BASE),
2964 + .pfn = __phys_to_pfn(UART0_BASE),
2966 + .type = MT_DEVICE},
2968 + .virtual = IO_ADDRESS(UART1_BASE),
2969 + .pfn = __phys_to_pfn(UART1_BASE),
2971 + .type = MT_DEVICE},
2972 +#ifdef CONFIG_MMC_BCM2708 /* broadcom legacy SD */
2974 + .virtual = IO_ADDRESS(MMCI0_BASE),
2975 + .pfn = __phys_to_pfn(MMCI0_BASE),
2977 + .type = MT_DEVICE},
2980 + .virtual = IO_ADDRESS(DMA_BASE),
2981 + .pfn = __phys_to_pfn(DMA_BASE),
2983 + .type = MT_DEVICE},
2985 + .virtual = IO_ADDRESS(MCORE_BASE),
2986 + .pfn = __phys_to_pfn(MCORE_BASE),
2988 + .type = MT_DEVICE},
2990 + .virtual = IO_ADDRESS(ST_BASE),
2991 + .pfn = __phys_to_pfn(ST_BASE),
2993 + .type = MT_DEVICE},
2995 + .virtual = IO_ADDRESS(USB_BASE),
2996 + .pfn = __phys_to_pfn(USB_BASE),
2997 + .length = SZ_128K,
2998 + .type = MT_DEVICE},
3000 + .virtual = IO_ADDRESS(PM_BASE),
3001 + .pfn = __phys_to_pfn(PM_BASE),
3003 + .type = MT_DEVICE},
3005 + .virtual = IO_ADDRESS(GPIO_BASE),
3006 + .pfn = __phys_to_pfn(GPIO_BASE),
3008 + .type = MT_DEVICE}
3011 void __init bcm2708_map_io(void)
3012 @@ -136,74 +139,91 @@ void __init bcm2708_map_io(void)
3013 iotable_init(bcm2708_io_desc, ARRAY_SIZE(bcm2708_io_desc));
3016 -unsigned long frc_clock_ticks32(void)
3017 +// The STC is a free running counter that increments at the rate of 1MHz
3018 +#define STC_FREQ_HZ 1000000
3020 +static cycle_t stc_read_cycles(struct clocksource *cs)
3022 /* STC: a free running counter that increments at the rate of 1MHz */
3023 - return readl(__io_address(ST_BASE+0x04));
3024 + return (cycle_t) readl(__io_address(ST_BASE + 0x04));
3027 -unsigned long long frc_clock_ticks63(void)
3028 +static struct clocksource clocksource_stc = {
3031 + .read = stc_read_cycles,
3032 + .mask = CLOCKSOURCE_MASK(32),
3033 + .flags = CLOCK_SOURCE_IS_CONTINUOUS,
3036 +unsigned long frc_clock_ticks32(void)
3038 - unsigned long t = frc_clock_ticks32();
3039 - /* For cnt32_to_63 to work correctly we MUST call this routine
3040 - * at least once every half-32-bit-wraparound period - that's once
3041 - * every 35minutes or so - using it in sched_clock() should ensure this
3043 - return cnt32_to_63(t);
3044 + return (unsigned long)stc_read_cycles(&clocksource_stc);
3047 +static void __init bcm2708_clocksource_init(void)
3049 + // calculate .shift and .mult values and register clocksource
3050 + if (clocksource_register_hz(&clocksource_stc, STC_FREQ_HZ)) {
3051 + printk(KERN_ERR "timer: failed to initialize clock "
3052 + "source %s\n", clocksource_stc.name);
3056 unsigned long long sched_clock(void)
3058 - return 1000ull * frc_clock_ticks63();
3059 + return clocksource_cyc2ns(clocksource_stc.read(&clocksource_stc),
3060 + clocksource_stc.mult, clocksource_stc.shift);
3064 * These are fixed clocks.
3066 static struct clk ref24_clk = {
3067 - .rate = 3000000, /* The UART is clocked at 3MHz via APB_CLK */
3068 + .rate = 3000000, /* The UART is clocked at 3MHz via APB_CLK */
3071 static struct clk osc_clk = {
3072 #ifdef CONFIG_ARCH_BCM2708_CHIPIT
3076 - .rate = 500000000, /* ARM clock is set from the VideoCore booter */
3077 + .rate = 500000000, /* ARM clock is set from the VideoCore booter */
3081 /* warning - the USB needs a clock > 34MHz */
3083 #ifdef CONFIG_MMC_BCM2708
3084 static struct clk sdhost_clk = {
3085 #ifdef CONFIG_ARCH_BCM2708_CHIPIT
3086 - .rate = 4000000, /* 4MHz */
3087 + .rate = 4000000, /* 4MHz */
3089 - .rate = 250000000, /* 250MHz */
3090 + .rate = 250000000, /* 250MHz */
3095 static struct clk_lookup lookups[] = {
3097 - .dev_id = "dev:f1",
3098 - .clk = &ref24_clk,
3101 - .dev_id = "bcm2708_usb",
3104 + .dev_id = "dev:f1",
3105 + .clk = &ref24_clk,
3108 + .dev_id = "bcm2708_usb",
3110 #ifdef CONFIG_MMC_BCM2708
3113 - .dev_id = "bcm2708_mci.0",
3114 - .clk = &sdhost_clk,
3117 + .dev_id = "bcm2708_mci.0",
3118 + .clk = &sdhost_clk,
3125 #define UART0_IRQ { IRQ_UART, NO_IRQ }
3126 #define UART0_DMA { 15, 14 }
3128 -AMBA_DEVICE(uart0, "dev:f1", UART0, NULL);
3129 +AMBA_DEVICE(uart0, "dev:f1", UART0, NULL);
3131 static struct amba_device *amba_devs[] __initdata = {
3133 @@ -211,262 +231,232 @@ static struct amba_device *amba_devs[] _
3135 static struct resource bcm2708_dmaman_resources[] = {
3137 - .start = DMA_BASE,
3138 - .end = DMA_BASE + SZ_4K - 1,
3139 - .flags = IORESOURCE_MEM,
3141 + .start = DMA_BASE,
3142 + .end = DMA_BASE + SZ_4K - 1,
3143 + .flags = IORESOURCE_MEM,
3147 static struct platform_device bcm2708_dmaman_device = {
3148 - .name = BCM_DMAMAN_DRIVER_NAME,
3149 - .id = 0, /* first bcm2708_dma */
3150 - .resource = bcm2708_dmaman_resources,
3151 - .num_resources = ARRAY_SIZE(bcm2708_dmaman_resources),
3152 + .name = BCM_DMAMAN_DRIVER_NAME,
3153 + .id = 0, /* first bcm2708_dma */
3154 + .resource = bcm2708_dmaman_resources,
3155 + .num_resources = ARRAY_SIZE(bcm2708_dmaman_resources),
3158 #ifdef CONFIG_MMC_BCM2708
3159 static struct resource bcm2708_mci_resources[] = {
3161 - .start = MMCI0_BASE,
3162 - .end = MMCI0_BASE + SZ_4K - 1,
3163 - .flags = IORESOURCE_MEM,
3165 - .start = IRQ_SDIO,
3167 - .flags = IORESOURCE_IRQ,
3169 + .start = MMCI0_BASE,
3170 + .end = MMCI0_BASE + SZ_4K - 1,
3171 + .flags = IORESOURCE_MEM,
3174 + .start = IRQ_SDIO,
3176 + .flags = IORESOURCE_IRQ,
3181 static struct platform_device bcm2708_mci_device = {
3182 - .name = "bcm2708_mci",
3183 - .id = 0, /* first bcm2708_mci */
3184 - .resource = bcm2708_mci_resources,
3185 - .num_resources = ARRAY_SIZE(bcm2708_mci_resources),
3187 - .coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
3189 + .name = "bcm2708_mci",
3190 + .id = 0, /* first bcm2708_mci */
3191 + .resource = bcm2708_mci_resources,
3192 + .num_resources = ARRAY_SIZE(bcm2708_mci_resources),
3194 + .coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
3197 #endif /* CONFIG_MMC_BCM2708 */
3200 static u64 fb_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);
3202 static struct platform_device bcm2708_fb_device = {
3203 - .name = "bcm2708_fb",
3204 - .id = -1, /* only one bcm2708_fb */
3206 - .num_resources = 0,
3208 - .dma_mask = &fb_dmamask,
3209 - .coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
3211 + .name = "bcm2708_fb",
3212 + .id = -1, /* only one bcm2708_fb */
3214 + .num_resources = 0,
3216 + .dma_mask = &fb_dmamask,
3217 + .coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
3221 static struct plat_serial8250_port bcm2708_uart1_platform_data[] = {
3223 - .mapbase = UART1_BASE + 0x40,
3225 - .uartclk = 125000000,
3227 - .iotype = UPIO_MEM,
3228 - .flags = UPF_FIXED_TYPE | UPF_IOREMAP | UPF_SKIP_TEST,
3229 - .type = PORT_8250,
3232 + .mapbase = UART1_BASE + 0x40,
3234 + .uartclk = 125000000,
3236 + .iotype = UPIO_MEM,
3237 + .flags = UPF_FIXED_TYPE | UPF_IOREMAP | UPF_SKIP_TEST,
3238 + .type = PORT_8250,
3243 static struct platform_device bcm2708_uart1_device = {
3244 - .name = "serial8250",
3245 - .id = PLAT8250_DEV_PLATFORM,
3247 - .platform_data = bcm2708_uart1_platform_data,
3249 + .name = "serial8250",
3250 + .id = PLAT8250_DEV_PLATFORM,
3252 + .platform_data = bcm2708_uart1_platform_data,
3256 static struct resource bcm2708_usb_resources[] = {
3258 - .start = USB_BASE,
3259 - .end = USB_BASE + SZ_128K - 1,
3260 - .flags = IORESOURCE_MEM,
3265 - .flags = IORESOURCE_IRQ,
3268 + .start = USB_BASE,
3269 + .end = USB_BASE + SZ_128K - 1,
3270 + .flags = IORESOURCE_MEM,
3275 + .flags = IORESOURCE_IRQ,
3279 static u64 usb_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);
3281 static struct platform_device bcm2708_usb_device = {
3282 - .name = "bcm2708_usb",
3283 - .id = -1, /* only one bcm2708_usb */
3284 - .resource = bcm2708_usb_resources,
3285 - .num_resources = ARRAY_SIZE(bcm2708_usb_resources),
3287 - .dma_mask = &usb_dmamask,
3288 - .coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
3290 + .name = "bcm2708_usb",
3291 + .id = -1, /* only one bcm2708_usb */
3292 + .resource = bcm2708_usb_resources,
3293 + .num_resources = ARRAY_SIZE(bcm2708_usb_resources),
3295 + .dma_mask = &usb_dmamask,
3296 + .coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
3300 static struct resource bcm2708_vcio_resources[] = {
3301 - [0] = { /* mailbox/semaphore/doorbell access */
3302 - .start = MCORE_BASE,
3303 - .end = MCORE_BASE + SZ_4K - 1,
3304 - .flags = IORESOURCE_MEM,
3306 + [0] = { /* mailbox/semaphore/doorbell access */
3307 + .start = MCORE_BASE,
3308 + .end = MCORE_BASE + SZ_4K - 1,
3309 + .flags = IORESOURCE_MEM,
3313 static u64 vcio_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);
3315 static struct platform_device bcm2708_vcio_device = {
3316 - .name = BCM_VCIO_DRIVER_NAME,
3317 - .id = -1, /* only one VideoCore I/O area */
3318 - .resource = bcm2708_vcio_resources,
3319 - .num_resources = ARRAY_SIZE(bcm2708_vcio_resources),
3321 - .dma_mask = &vcio_dmamask,
3322 - .coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
3324 + .name = BCM_VCIO_DRIVER_NAME,
3325 + .id = -1, /* only one VideoCore I/O area */
3326 + .resource = bcm2708_vcio_resources,
3327 + .num_resources = ARRAY_SIZE(bcm2708_vcio_resources),
3329 + .dma_mask = &vcio_dmamask,
3330 + .coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
3334 #ifdef CONFIG_BCM2708_GPIO
3335 #define BCM_GPIO_DRIVER_NAME "bcm2708_gpio"
3337 static struct resource bcm2708_gpio_resources[] = {
3338 - [0] = { /* general purpose I/O */
3339 - .start = GPIO_BASE,
3340 - .end = GPIO_BASE + SZ_4K - 1,
3341 - .flags = IORESOURCE_MEM,
3343 + [0] = { /* general purpose I/O */
3344 + .start = GPIO_BASE,
3345 + .end = GPIO_BASE + SZ_4K - 1,
3346 + .flags = IORESOURCE_MEM,
3350 static u64 gpio_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);
3352 static struct platform_device bcm2708_gpio_device = {
3353 - .name = BCM_GPIO_DRIVER_NAME,
3354 - .id = -1, /* only one VideoCore I/O area */
3355 - .resource = bcm2708_gpio_resources,
3356 - .num_resources = ARRAY_SIZE(bcm2708_gpio_resources),
3358 - .dma_mask = &gpio_dmamask,
3359 - .coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
3364 -#ifdef CONFIG_BCM2708_BUTTONS
3365 -static struct resource bcm2708_vcbuttons_resources[] = {
3368 -static u64 vcbuttons_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);
3370 -static struct platform_device bcm2708_vcbuttons_device = {
3371 - .name = "bcm2708_vcbuttons",
3372 - .id = -1, /* only one VideoCore I/O area */
3373 - .resource = bcm2708_vcbuttons_resources,
3374 - .num_resources = ARRAY_SIZE(bcm2708_vcbuttons_resources),
3376 - .dma_mask = &vcbuttons_dmamask,
3377 - .coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
3382 -#ifdef CONFIG_BCM2708_TOUCHSCREEN
3383 -static struct resource bcm2708_vctouch_resources[] = {
3386 -static u64 vctouch_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);
3388 -static struct platform_device bcm2708_vctouch_device = {
3389 - .name = "bcm2708_vctouch",
3390 - .id = -1, /* only one VideoCore I/O area */
3391 - .resource = bcm2708_vctouch_resources,
3392 - .num_resources = ARRAY_SIZE(bcm2708_vctouch_resources),
3394 - .dma_mask = &vctouch_dmamask,
3395 - .coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
3397 + .name = BCM_GPIO_DRIVER_NAME,
3398 + .id = -1, /* only one VideoCore I/O area */
3399 + .resource = bcm2708_gpio_resources,
3400 + .num_resources = ARRAY_SIZE(bcm2708_gpio_resources),
3402 + .dma_mask = &gpio_dmamask,
3403 + .coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
3408 static struct resource bcm2708_systemtimer_resources[] = {
3409 - [0] = { /* system timer access */
3411 - .end = ST_BASE + SZ_4K - 1,
3412 - .flags = IORESOURCE_MEM,
3414 - .start = IRQ_TIMER3,
3415 - .end = IRQ_TIMER3,
3416 - .flags = IORESOURCE_IRQ,
3419 + [0] = { /* system timer access */
3421 + .end = ST_BASE + SZ_4K - 1,
3422 + .flags = IORESOURCE_MEM,
3425 + .start = IRQ_TIMER3,
3426 + .end = IRQ_TIMER3,
3427 + .flags = IORESOURCE_IRQ,
3432 static u64 systemtimer_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);
3434 static struct platform_device bcm2708_systemtimer_device = {
3435 - .name = "bcm2708_systemtimer",
3436 - .id = -1, /* only one VideoCore I/O area */
3437 - .resource = bcm2708_systemtimer_resources,
3438 - .num_resources = ARRAY_SIZE(bcm2708_systemtimer_resources),
3440 - .dma_mask = &systemtimer_dmamask,
3441 - .coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
3443 + .name = "bcm2708_systemtimer",
3444 + .id = -1, /* only one VideoCore I/O area */
3445 + .resource = bcm2708_systemtimer_resources,
3446 + .num_resources = ARRAY_SIZE(bcm2708_systemtimer_resources),
3448 + .dma_mask = &systemtimer_dmamask,
3449 + .coherent_dma_mask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON),
3453 -#ifdef CONFIG_MMC_SDHCI_BCM2708 /* Arasan emmc SD */
3454 +#ifdef CONFIG_MMC_SDHCI_BCM2708 /* Arasan emmc SD */
3455 static struct resource bcm2708_emmc_resources[] = {
3457 - .start = EMMC_BASE,
3458 - .end = EMMC_BASE + SZ_256 - 1, /* we only need this area */
3459 - /* the memory map actually makes SZ_4K available */
3460 - .flags = IORESOURCE_MEM,
3462 + .start = EMMC_BASE,
3463 + .end = EMMC_BASE + SZ_256 - 1, /* we only need this area */
3464 + /* the memory map actually makes SZ_4K available */
3465 + .flags = IORESOURCE_MEM,
3468 - .start = IRQ_ARASANSDIO,
3469 - .end = IRQ_ARASANSDIO,
3470 - .flags = IORESOURCE_IRQ,
3472 + .start = IRQ_ARASANSDIO,
3473 + .end = IRQ_ARASANSDIO,
3474 + .flags = IORESOURCE_IRQ,
3478 static u64 bcm2708_emmc_dmamask = 0xffffffffUL;
3480 struct platform_device bcm2708_emmc_device = {
3481 - .name = "bcm2708_sdhci",
3483 - .num_resources = ARRAY_SIZE(bcm2708_emmc_resources),
3484 - .resource = bcm2708_emmc_resources,
3486 - .dma_mask = &bcm2708_emmc_dmamask,
3487 - .coherent_dma_mask = 0xffffffffUL
3489 + .name = "bcm2708_sdhci",
3491 + .num_resources = ARRAY_SIZE(bcm2708_emmc_resources),
3492 + .resource = bcm2708_emmc_resources,
3494 + .dma_mask = &bcm2708_emmc_dmamask,
3495 + .coherent_dma_mask = 0xffffffffUL},
3497 #endif /* CONFIG_MMC_SDHCI_BCM2708 */
3499 static struct resource bcm2708_powerman_resources[] = {
3502 - .end = PM_BASE + SZ_256 - 1,
3503 - .flags = IORESOURCE_MEM,
3506 + .end = PM_BASE + SZ_256 - 1,
3507 + .flags = IORESOURCE_MEM,
3511 static u64 powerman_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);
3513 struct platform_device bcm2708_powerman_device = {
3514 - .name = "bcm2708_powerman",
3516 - .num_resources = ARRAY_SIZE(bcm2708_powerman_resources),
3517 - .resource = bcm2708_powerman_resources,
3519 - .dma_mask = &powerman_dmamask,
3520 - .coherent_dma_mask = 0xffffffffUL
3522 + .name = "bcm2708_powerman",
3524 + .num_resources = ARRAY_SIZE(bcm2708_powerman_resources),
3525 + .resource = bcm2708_powerman_resources,
3527 + .dma_mask = &powerman_dmamask,
3528 + .coherent_dma_mask = 0xffffffffUL},
3531 +static struct platform_device bcm2708_alsa_devices[] = {
3533 + .name = "bcm2835_AUD0",
3534 + .id = 0, /* first audio device */
3536 + .num_resources = 0,
3540 int __init bcm_register_device(struct platform_device *pdev)
3541 @@ -500,30 +490,29 @@ void __init bcm2708_init(void)
3542 bcm_register_device(&bcm2708_fb_device);
3543 bcm_register_device(&bcm2708_usb_device);
3544 bcm_register_device(&bcm2708_uart1_device);
3545 -#ifdef CONFIG_BCM2708_BUTTONS
3546 - bcm_register_device(&bcm2708_vcbuttons_device);
3548 -#ifdef CONFIG_BCM2708_TOUCHSCREEN
3549 - bcm_register_device(&bcm2708_vctouch_device);
3551 bcm_register_device(&bcm2708_powerman_device);
3552 #ifdef CONFIG_MMC_SDHCI_BCM2708
3553 bcm_register_device(&bcm2708_emmc_device);
3555 - bcm2708_init_led();
3556 + bcm2708_init_led();
3557 + for (i = 0; i < ARRAY_SIZE(bcm2708_alsa_devices); i++)
3558 + bcm_register_device(&bcm2708_alsa_devices[i]);
3560 #ifdef CONFIG_BCM2708_VCMEM
3562 - extern void vc_mem_connected_init(void);
3563 - vc_mem_connected_init();
3566 + extern void vc_mem_connected_init(void);
3567 + vc_mem_connected_init();
3570 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
3571 struct amba_device *d = amba_devs[i];
3572 amba_device_register(d, &iomem_resource);
3574 + system_rev = boardrev;
3575 + system_serial_low = serial;
3578 -#define TIMER_PERIOD 10000 /* HZ in microsecs */
3579 +#define TIMER_PERIOD 10000 /* HZ in microsecs */
3581 static void timer_set_mode(enum clock_event_mode mode,
3582 struct clock_event_device *clk)
3583 @@ -532,37 +521,36 @@ static void timer_set_mode(enum clock_ev
3586 case CLOCK_EVT_MODE_PERIODIC:
3587 - stc = readl(__io_address(ST_BASE+0x04));
3588 - writel(stc + TIMER_PERIOD,
3589 - __io_address(ST_BASE+0x18));/* stc3 */
3590 + stc = readl(__io_address(ST_BASE + 0x04));
3591 + writel(stc + TIMER_PERIOD, __io_address(ST_BASE + 0x18)); /* stc3 */
3593 case CLOCK_EVT_MODE_ONESHOT:
3594 case CLOCK_EVT_MODE_UNUSED:
3595 case CLOCK_EVT_MODE_SHUTDOWN:
3597 printk(KERN_ERR "timer_set_mode: unhandled mode:%d\n",
3605 -static int timer_set_next_event(unsigned long evt,
3606 +static int timer_set_next_event(unsigned long cycles,
3607 struct clock_event_device *unused)
3611 - stc = readl(__io_address(ST_BASE + 0x04));
3612 - writel(stc + TIMER_PERIOD, __io_address(ST_BASE+0x18)); /* stc3 */
3613 + stc = readl(__io_address(ST_BASE + 0x04));
3614 + writel(stc + cycles, __io_address(ST_BASE + 0x18)); /* stc3 */
3618 -static struct clock_event_device timer0_clockevent = {
3621 - .features = CLOCK_EVT_FEAT_ONESHOT,
3622 - .set_mode = timer_set_mode,
3623 - .set_next_event = timer_set_next_event,
3624 +static struct clock_event_device timer0_clockevent = {
3627 + .features = CLOCK_EVT_FEAT_ONESHOT,
3628 + .set_mode = timer_set_mode,
3629 + .set_next_event = timer_set_next_event,
3633 @@ -572,7 +560,7 @@ static irqreturn_t bcm2708_timer_interru
3635 struct clock_event_device *evt = &timer0_clockevent;
3637 - writel(1<<3, __io_address(ST_BASE+0x00)); /* stcs clear timer int */
3638 + writel(1 << 3, __io_address(ST_BASE + 0x00)); /* stcs clear timer int */
3640 evt->event_handler(evt);
3642 @@ -580,9 +568,9 @@ static irqreturn_t bcm2708_timer_interru
3645 static struct irqaction bcm2708_timer_irq = {
3646 - .name = "BCM2708 Timer Tick",
3647 - .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
3648 - .handler = bcm2708_timer_interrupt,
3649 + .name = "BCM2708 Timer Tick",
3650 + .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
3651 + .handler = bcm2708_timer_interrupt,
3655 @@ -590,6 +578,9 @@ static struct irqaction bcm2708_timer_ir
3657 static void __init bcm2708_timer_init(void)
3659 + /* init high res timer */
3660 + bcm2708_clocksource_init();
3663 * Initialise to a known state (all timers off)
3665 @@ -600,18 +591,18 @@ static void __init bcm2708_timer_init(vo
3666 setup_irq(IRQ_TIMER3, &bcm2708_timer_irq);
3668 timer0_clockevent.mult =
3669 - div_sc(1000000, NSEC_PER_SEC, timer0_clockevent.shift);
3670 + div_sc(STC_FREQ_HZ, NSEC_PER_SEC, timer0_clockevent.shift);
3671 timer0_clockevent.max_delta_ns =
3672 - clockevent_delta2ns(0xffffffff, &timer0_clockevent);
3673 + clockevent_delta2ns(0xffffffff, &timer0_clockevent);
3674 timer0_clockevent.min_delta_ns =
3675 - clockevent_delta2ns(0xf, &timer0_clockevent);
3676 + clockevent_delta2ns(0xf, &timer0_clockevent);
3678 timer0_clockevent.cpumask = cpumask_of(0);
3679 clockevents_register_device(&timer0_clockevent);
3682 struct sys_timer bcm2708_timer = {
3683 - .init = bcm2708_timer_init,
3684 + .init = bcm2708_timer_init,
3687 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
3688 @@ -619,24 +610,24 @@ struct sys_timer bcm2708_timer = {
3690 static struct gpio_led bcm2708_leds[] = {
3694 - .default_trigger = "mmc0",
3699 + .default_trigger = "mmc0",
3704 static struct gpio_led_platform_data bcm2708_led_pdata = {
3705 - .num_leds = ARRAY_SIZE(bcm2708_leds),
3706 - .leds = bcm2708_leds,
3707 + .num_leds = ARRAY_SIZE(bcm2708_leds),
3708 + .leds = bcm2708_leds,
3711 static struct platform_device bcm2708_led_device = {
3712 - .name = "leds-gpio",
3715 - .platform_data = &bcm2708_led_pdata,
3717 + .name = "leds-gpio",
3720 + .platform_data = &bcm2708_led_pdata,
3724 static void __init bcm2708_init_led(void)
3725 @@ -644,14 +635,14 @@ static void __init bcm2708_init_led(void
3726 platform_device_register(&bcm2708_led_device);
3729 -static inline void bcm2708_init_led(void) {}
3730 +static inline void bcm2708_init_led(void)
3736 MACHINE_START(BCM2708, "BCM2708")
3737 - /* Maintainer: Broadcom Europe Ltd. */
3738 - .map_io = bcm2708_map_io,
3739 - .init_irq = bcm2708_init_irq,
3740 - .timer = &bcm2708_timer,
3741 - .init_machine = bcm2708_init,
3743 + /* Maintainer: Broadcom Europe Ltd. */
3744 + .map_io = bcm2708_map_io,.init_irq = bcm2708_init_irq,.timer =
3745 + &bcm2708_timer,.init_machine =
3746 + bcm2708_init, MACHINE_END module_param(boardrev, uint, 0644);
3747 +module_param(serial, uint, 0644);
3748 --- a/arch/arm/mach-bcm2708/include/mach/memory.h
3749 +++ b/arch/arm/mach-bcm2708/include/mach/memory.h
3752 * Physical DRAM offset.
3754 -#define PHYS_OFFSET UL(0x00000000)
3755 +#define PLAT_PHYS_OFFSET UL(0x00000000)
3756 #define ARMMEM_OFFSET UL(0x00000000) /* offset in VC of ARM memory */
3757 -#define _REAL_BUS_OFFSET UL(0xC0000000) /* don't use L1 or L2 caches */
3759 +#ifdef CONFIG_BCM2708_NOL2CACHE
3760 + #define _REAL_BUS_OFFSET UL(0xC0000000) /* don't use L1 or L2 caches */
3762 + #define _REAL_BUS_OFFSET UL(0x40000000) /* use L2 cache */
3765 /* We're using the memory at 64M in the VideoCore for Linux - this adjustment
3766 * will provide the offset into this area as well as setting the bits that
3768 #define BUS_OFFSET (ARMMEM_OFFSET + _REAL_BUS_OFFSET)
3769 #define __virt_to_bus(x) ((x) + (BUS_OFFSET - PAGE_OFFSET))
3770 #define __bus_to_virt(x) ((x) - (BUS_OFFSET - PAGE_OFFSET))
3771 -#define __pfn_to_bus(x) (__pfn_to_phys(x) + (BUS_OFFSET - PHYS_OFFSET))
3772 -#define __bus_to_pfn(x) __phys_to_pfn((x) - (BUS_OFFSET - PHYS_OFFSET))
3773 +#define __pfn_to_bus(x) (__pfn_to_phys(x) + (BUS_OFFSET - PLAT_PHYS_OFFSET))
3774 +#define __bus_to_pfn(x) __phys_to_pfn((x) - (BUS_OFFSET - PLAT_PHYS_OFFSET))
3777 * Consistent DMA area set to 2M. Framebuffer now allocated on host
3778 --- a/arch/arm/mach-bcm2708/include/mach/vc_mem.h
3779 +++ b/arch/arm/mach-bcm2708/include/mach/vc_mem.h
3782 #define VC_MEM_IOC_MEM_PHYS_ADDR _IOR( VC_MEM_IOC_MAGIC, 0, unsigned long )
3783 #define VC_MEM_IOC_MEM_SIZE _IOR( VC_MEM_IOC_MAGIC, 1, unsigned int )
3784 +#define VC_MEM_IOC_MEM_BASE _IOR( VC_MEM_IOC_MAGIC, 2, unsigned int )
3786 #if defined( __KERNEL__ )
3787 #define VC_MEM_TO_ARM_ADDR_MASK 0x3FFFFFFF
3788 --- a/arch/arm/mach-bcm2708/power.c
3789 +++ b/arch/arm/mach-bcm2708/power.c
3791 #include <linux/module.h>
3792 #include <linux/semaphore.h>
3793 #include <linux/bug.h>
3794 +#include <linux/delay.h>
3795 #include <mach/power.h>
3796 #include <mach/vcio.h>
3797 #include <mach/arm_power.h>
3798 @@ -96,7 +97,6 @@ int bcm_power_request(BCM_POWER_HANDLE_T
3799 bcm_mailbox_write(MBOX_CHAN_POWER,
3800 global_request << 4);
3802 - /* Wait for a response during power-up */
3803 if (global_request & ~g_state.global_request) {
3804 rc = bcm_mailbox_read(MBOX_CHAN_POWER,
3806 @@ -111,14 +111,14 @@ int bcm_power_request(BCM_POWER_HANDLE_T
3809 if (actual != global_request) {
3811 - "%s: prev global %x, new global %x, actual %x, request %x, others_request %x\n",
3813 + "%s: Fail: prev global %x, new global %x, actual %x request %x, others_request %x\n",
3815 g_state.global_request,
3816 global_request, actual, request, others_request);
3818 - BUG_ON((others_request & actual)
3819 - != others_request);
3820 + // BUG_ON((others_request & actual)
3821 + // != others_request);
3825 @@ -161,6 +161,7 @@ static int __init bcm_power_init(void)
3828 printk(KERN_INFO "bcm_power: Broadcom power driver\n");
3829 + bcm_mailbox_write(MBOX_CHAN_POWER, 0);
3831 for (i = 0; i < BCM_POWER_MAXCLIENTS; i++)
3832 g_state.client_request[i] = BCM_POWER_NOCLIENT;
3833 --- a/arch/arm/mach-bcm2708/vc_mem.c
3834 +++ b/arch/arm/mach-bcm2708/vc_mem.c
3835 @@ -85,9 +85,11 @@ unsigned long mm_vc_mem_phys_addr = MM_A
3838 unsigned int mm_vc_mem_size = 0;
3839 +unsigned int mm_vc_mem_base = 0;
3841 EXPORT_SYMBOL(mm_vc_mem_phys_addr);
3842 EXPORT_SYMBOL(mm_vc_mem_size);
3843 +EXPORT_SYMBOL(mm_vc_mem_base);
3845 /****************************************************************************
3847 @@ -132,36 +134,19 @@ vc_mem_release(struct inode *inode, stru
3849 vc_mem_get_size(void)
3851 -#ifdef CONFIG_ARCH_BCM2708
3852 mm_vc_mem_size = 256 * 1024 * 1024; // Static for now
3854 - CHAL_IPC_HANDLE ipc_handle;
3855 - uint32_t wakeup_register;
3857 - // Get the videocore memory size from the IPC mailbox if not yet
3859 - if (mm_vc_mem_size == 0) {
3860 - ipc_handle = chal_ipc_config(NULL);
3861 - if (ipc_handle == NULL) {
3862 - LOG_ERR("%s: failed to get IPC handlle", __func__);
3867 - chal_ipc_query_wakeup_vc(ipc_handle, &wakeup_register);
3868 - if ((wakeup_register & ~1) == 0) {
3869 - LOG_DBG("%s: videocore not yet loaded, skipping...",
3872 - if (chal_ipc_read_mailbox(ipc_handle,
3874 - &mm_vc_mem_size) !=
3876 - LOG_ERR("%s: failed to read from IPC mailbox",
3882 +/****************************************************************************
3886 +***************************************************************************/
3889 +vc_mem_get_base(void)
3891 + mm_vc_mem_base = 128 * 1024 * 1024; // Static for now
3894 /****************************************************************************
3895 @@ -220,6 +205,20 @@ vc_mem_ioctl(struct file *file, unsigned
3900 + case VC_MEM_IOC_MEM_BASE:
3902 + // Get the videocore memory base
3903 + vc_mem_get_base();
3905 + LOG_DBG("%s: VC_MEM_IOC_MEM_BASE=%u", __func__,
3908 + if (copy_to_user((void *) arg, &mm_vc_mem_base,
3909 + sizeof (mm_vc_mem_base)) != 0) {
3916 --- a/arch/arm/mach-bcm2708/vcio.c
3917 +++ b/arch/arm/mach-bcm2708/vcio.c
3918 @@ -119,8 +119,7 @@ static int mbox_read(struct vc_mailbox *
3919 if (mbox->magic != MBOX_MAGIC)
3922 - if (mbox->msg[chan] ||
3923 - (down_interruptible(&mbox->sema[chan]) == 0)) {
3924 + if (down_interruptible(&mbox->sema[chan]) == 0) {
3925 *data28 = MBOX_DATA28(mbox->msg[chan]);
3926 mbox->msg[chan] = 0;
3928 --- a/drivers/misc/vc04_services/Makefile
3929 +++ b/drivers/misc/vc04_services/Makefile
3930 @@ -2,6 +2,8 @@ obj-$(CONFIG_BCM2708_VCHIQ) += vchiq.o
3933 interface/vchiq_arm/vchiq_core.o \
3934 + interface/vchiq_arm/vchiq_shim.o \
3935 + interface/vchiq_arm/vchiq_util.o \
3936 interface/vchiq_arm/vchiq_arm.o \
3937 interface/vchiq_arm/vchiq_kern_lib.o \
3938 interface/vchiq_arm/vchiq_2835_arm.o \
3939 @@ -13,7 +15,7 @@ vchiq-objs := \
3940 interface/vcos/generic/vcos_mem_from_malloc.o \
3941 interface/vcos/generic/vcos_cmd.o
3943 -EXTRA_CFLAGS += -DVCOS_VERIFY_BKPTS=1 -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel
3944 +EXTRA_CFLAGS += -DVCOS_VERIFY_BKPTS=1 -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel
3949 +++ b/drivers/misc/vc04_services/interface/vchi/connections/connection.h
3952 + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved.
3954 + * This program is free software; you can redistribute it and/or modify
3955 + * it under the terms of the GNU General Public License as published by
3956 + * the Free Software Foundation; either version 2 of the License, or
3957 + * (at your option) any later version.
3959 + * This program is distributed in the hope that it will be useful,
3960 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3961 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3962 + * GNU General Public License for more details.
3964 + * You should have received a copy of the GNU General Public License
3965 + * along with this program; if not, write to the Free Software
3966 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3969 +#ifndef CONNECTION_H_
3970 +#define CONNECTION_H_
3972 +#include "interface/vchi/vchi_cfg_internal.h"
3973 +#include "interface/vchi/vchi_common.h"
3974 +#include "interface/vchi/message_drivers/message.h"
3976 +/******************************************************************************
3978 + *****************************************************************************/
3980 +// Opaque handle for a connection / service pair
3981 +typedef struct opaque_vchi_connection_connected_service_handle_t *VCHI_CONNECTION_SERVICE_HANDLE_T;
3983 +// opaque handle to the connection state information
3984 +typedef struct opaque_vchi_connection_info_t VCHI_CONNECTION_STATE_T;
3986 +typedef struct vchi_connection_t VCHI_CONNECTION_T;
3989 +/******************************************************************************
3991 + *****************************************************************************/
3993 +// Routine to init a connection with a particular low level driver
3994 +typedef VCHI_CONNECTION_STATE_T * (*VCHI_CONNECTION_INIT_T)( struct vchi_connection_t * connection,
3995 + const VCHI_MESSAGE_DRIVER_T * driver );
3997 +// Routine to control CRC enabling at a connection level
3998 +typedef int32_t (*VCHI_CONNECTION_CRC_CONTROL_T)( VCHI_CONNECTION_STATE_T *state_handle,
3999 + VCHI_CRC_CONTROL_T control );
4001 +// Routine to create a service
4002 +typedef int32_t (*VCHI_CONNECTION_SERVICE_CONNECT_T)( VCHI_CONNECTION_STATE_T *state_handle,
4003 + vcos_fourcc_t service_id,
4004 + uint32_t rx_fifo_size,
4005 + uint32_t tx_fifo_size,
4007 + VCHI_CALLBACK_T callback,
4008 + void *callback_param,
4009 + vcos_bool_t want_crc,
4010 + vcos_bool_t want_unaligned_bulk_rx,
4011 + vcos_bool_t want_unaligned_bulk_tx,
4012 + VCHI_CONNECTION_SERVICE_HANDLE_T *service_handle );
4014 +// Routine to close a service
4015 +typedef int32_t (*VCHI_CONNECTION_SERVICE_DISCONNECT_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle );
4017 +// Routine to queue a message
4018 +typedef int32_t (*VCHI_CONNECTION_SERVICE_QUEUE_MESSAGE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle,
4020 + uint32_t data_size,
4021 + VCHI_FLAGS_T flags,
4022 + void *msg_handle );
4024 +// scatter-gather (vector) message queueing
4025 +typedef int32_t (*VCHI_CONNECTION_SERVICE_QUEUE_MESSAGEV_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle,
4026 + VCHI_MSG_VECTOR_T *vector,
4028 + VCHI_FLAGS_T flags,
4029 + void *msg_handle );
4031 +// Routine to dequeue a message
4032 +typedef int32_t (*VCHI_CONNECTION_SERVICE_DEQUEUE_MESSAGE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle,
4034 + uint32_t max_data_size_to_read,
4035 + uint32_t *actual_msg_size,
4036 + VCHI_FLAGS_T flags );
4038 +// Routine to peek at a message
4039 +typedef int32_t (*VCHI_CONNECTION_SERVICE_PEEK_MESSAGE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle,
4041 + uint32_t *msg_size,
4042 + VCHI_FLAGS_T flags );
4044 +// Routine to hold a message
4045 +typedef int32_t (*VCHI_CONNECTION_SERVICE_HOLD_MESSAGE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle,
4047 + uint32_t *msg_size,
4048 + VCHI_FLAGS_T flags,
4049 + void **message_handle );
4051 +// Routine to initialise a received message iterator
4052 +typedef int32_t (*VCHI_CONNECTION_SERVICE_LOOKAHEAD_MESSAGE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle,
4053 + VCHI_MSG_ITER_T *iter,
4054 + VCHI_FLAGS_T flags );
4056 +// Routine to release a held message
4057 +typedef int32_t (*VCHI_CONNECTION_HELD_MSG_RELEASE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle,
4058 + void *message_handle );
4060 +// Routine to get info on a held message
4061 +typedef int32_t (*VCHI_CONNECTION_HELD_MSG_INFO_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle,
4062 + void *message_handle,
4064 + int32_t *msg_size,
4065 + uint32_t *tx_timestamp,
4066 + uint32_t *rx_timestamp );
4068 +// Routine to check whether the iterator has a next message
4069 +typedef vcos_bool_t (*VCHI_CONNECTION_MSG_ITER_HAS_NEXT_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service,
4070 + const VCHI_MSG_ITER_T *iter );
4072 +// Routine to advance the iterator
4073 +typedef int32_t (*VCHI_CONNECTION_MSG_ITER_NEXT_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service,
4074 + VCHI_MSG_ITER_T *iter,
4076 + uint32_t *msg_size );
4078 +// Routine to remove the last message returned by the iterator
4079 +typedef int32_t (*VCHI_CONNECTION_MSG_ITER_REMOVE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service,
4080 + VCHI_MSG_ITER_T *iter );
4082 +// Routine to hold the last message returned by the iterator
4083 +typedef int32_t (*VCHI_CONNECTION_MSG_ITER_HOLD_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service,
4084 + VCHI_MSG_ITER_T *iter,
4085 + void **msg_handle );
4087 +// Routine to transmit bulk data
4088 +typedef int32_t (*VCHI_CONNECTION_BULK_QUEUE_TRANSMIT_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle,
4089 + const void *data_src,
4090 + uint32_t data_size,
4091 + VCHI_FLAGS_T flags,
4092 + void *bulk_handle );
4094 +// Routine to receive data
4095 +typedef int32_t (*VCHI_CONNECTION_BULK_QUEUE_RECEIVE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle,
4097 + uint32_t data_size,
4098 + VCHI_FLAGS_T flags,
4099 + void *bulk_handle );
4101 +// Routine to report if a server is available
4102 +typedef int32_t (*VCHI_CONNECTION_SERVER_PRESENT)( VCHI_CONNECTION_STATE_T *state, vcos_fourcc_t service_id, int32_t peer_flags );
4104 +// Routine to report the number of RX slots available
4105 +typedef int (*VCHI_CONNECTION_RX_SLOTS_AVAILABLE)( const VCHI_CONNECTION_STATE_T *state );
4107 +// Routine to report the RX slot size
4108 +typedef uint32_t (*VCHI_CONNECTION_RX_SLOT_SIZE)( const VCHI_CONNECTION_STATE_T *state );
4110 +// Callback to indicate that the other side has added a buffer to the rx bulk DMA FIFO
4111 +typedef void (*VCHI_CONNECTION_RX_BULK_BUFFER_ADDED)(VCHI_CONNECTION_STATE_T *state,
4112 + vcos_fourcc_t service,
4114 + MESSAGE_TX_CHANNEL_T channel,
4115 + uint32_t channel_params,
4116 + uint32_t data_length,
4117 + uint32_t data_offset);
4119 +// Callback to inform a service that a Xon or Xoff message has been received
4120 +typedef void (*VCHI_CONNECTION_FLOW_CONTROL)(VCHI_CONNECTION_STATE_T *state, vcos_fourcc_t service_id, int32_t xoff);
4122 +// Callback to inform a service that a server available reply message has been received
4123 +typedef void (*VCHI_CONNECTION_SERVER_AVAILABLE_REPLY)(VCHI_CONNECTION_STATE_T *state, vcos_fourcc_t service_id, uint32_t flags);
4125 +// Callback to indicate that bulk auxiliary messages have arrived
4126 +typedef void (*VCHI_CONNECTION_BULK_AUX_RECEIVED)(VCHI_CONNECTION_STATE_T *state);
4128 +// Callback to indicate that bulk auxiliary messages have arrived
4129 +typedef void (*VCHI_CONNECTION_BULK_AUX_TRANSMITTED)(VCHI_CONNECTION_STATE_T *state, void *handle);
4131 +// Callback with all the connection info you require
4132 +typedef void (*VCHI_CONNECTION_INFO)(VCHI_CONNECTION_STATE_T *state, uint32_t protocol_version, uint32_t slot_size, uint32_t num_slots, uint32_t min_bulk_size);
4134 +// Callback to inform of a disconnect
4135 +typedef void (*VCHI_CONNECTION_DISCONNECT)(VCHI_CONNECTION_STATE_T *state, uint32_t flags);
4137 +// Callback to inform of a power control request
4138 +typedef void (*VCHI_CONNECTION_POWER_CONTROL)(VCHI_CONNECTION_STATE_T *state, MESSAGE_TX_CHANNEL_T channel, vcos_bool_t enable);
4140 +// allocate memory suitably aligned for this connection
4141 +typedef void * (*VCHI_BUFFER_ALLOCATE)(VCHI_CONNECTION_SERVICE_HANDLE_T service_handle, uint32_t * length);
4143 +// free memory allocated by buffer_allocate
4144 +typedef void (*VCHI_BUFFER_FREE)(VCHI_CONNECTION_SERVICE_HANDLE_T service_handle, void * address);
4147 +/******************************************************************************
4148 + System driver struct
4149 + *****************************************************************************/
4151 +struct opaque_vchi_connection_api_t
4153 + // Routine to init the connection
4154 + VCHI_CONNECTION_INIT_T init;
4156 + // Connection-level CRC control
4157 + VCHI_CONNECTION_CRC_CONTROL_T crc_control;
4159 + // Routine to connect to or create service
4160 + VCHI_CONNECTION_SERVICE_CONNECT_T service_connect;
4162 + // Routine to disconnect from a service
4163 + VCHI_CONNECTION_SERVICE_DISCONNECT_T service_disconnect;
4165 + // Routine to queue a message
4166 + VCHI_CONNECTION_SERVICE_QUEUE_MESSAGE_T service_queue_msg;
4168 + // scatter-gather (vector) message queue
4169 + VCHI_CONNECTION_SERVICE_QUEUE_MESSAGEV_T service_queue_msgv;
4171 + // Routine to dequeue a message
4172 + VCHI_CONNECTION_SERVICE_DEQUEUE_MESSAGE_T service_dequeue_msg;
4174 + // Routine to peek at a message
4175 + VCHI_CONNECTION_SERVICE_PEEK_MESSAGE_T service_peek_msg;
4177 + // Routine to hold a message
4178 + VCHI_CONNECTION_SERVICE_HOLD_MESSAGE_T service_hold_msg;
4180 + // Routine to initialise a received message iterator
4181 + VCHI_CONNECTION_SERVICE_LOOKAHEAD_MESSAGE_T service_look_ahead_msg;
4183 + // Routine to release a message
4184 + VCHI_CONNECTION_HELD_MSG_RELEASE_T held_msg_release;
4186 + // Routine to get information on a held message
4187 + VCHI_CONNECTION_HELD_MSG_INFO_T held_msg_info;
4189 + // Routine to check for next message on iterator
4190 + VCHI_CONNECTION_MSG_ITER_HAS_NEXT_T msg_iter_has_next;
4192 + // Routine to get next message on iterator
4193 + VCHI_CONNECTION_MSG_ITER_NEXT_T msg_iter_next;
4195 + // Routine to remove the last message returned by iterator
4196 + VCHI_CONNECTION_MSG_ITER_REMOVE_T msg_iter_remove;
4198 + // Routine to hold the last message returned by iterator
4199 + VCHI_CONNECTION_MSG_ITER_HOLD_T msg_iter_hold;
4201 + // Routine to transmit bulk data
4202 + VCHI_CONNECTION_BULK_QUEUE_TRANSMIT_T bulk_queue_transmit;
4204 + // Routine to receive data
4205 + VCHI_CONNECTION_BULK_QUEUE_RECEIVE_T bulk_queue_receive;
4207 + // Routine to report the available servers
4208 + VCHI_CONNECTION_SERVER_PRESENT server_present;
4210 + // Routine to report the number of RX slots available
4211 + VCHI_CONNECTION_RX_SLOTS_AVAILABLE connection_rx_slots_available;
4213 + // Routine to report the RX slot size
4214 + VCHI_CONNECTION_RX_SLOT_SIZE connection_rx_slot_size;
4216 + // Callback to indicate that the other side has added a buffer to the rx bulk DMA FIFO
4217 + VCHI_CONNECTION_RX_BULK_BUFFER_ADDED rx_bulk_buffer_added;
4219 + // Callback to inform a service that a Xon or Xoff message has been received
4220 + VCHI_CONNECTION_FLOW_CONTROL flow_control;
4222 + // Callback to inform a service that a server available reply message has been received
4223 + VCHI_CONNECTION_SERVER_AVAILABLE_REPLY server_available_reply;
4225 + // Callback to indicate that bulk auxiliary messages have arrived
4226 + VCHI_CONNECTION_BULK_AUX_RECEIVED bulk_aux_received;
4228 + // Callback to indicate that a bulk auxiliary message has been transmitted
4229 + VCHI_CONNECTION_BULK_AUX_TRANSMITTED bulk_aux_transmitted;
4231 + // Callback to provide information about the connection
4232 + VCHI_CONNECTION_INFO connection_info;
4234 + // Callback to notify that peer has requested disconnect
4235 + VCHI_CONNECTION_DISCONNECT disconnect;
4237 + // Callback to notify that peer has requested power change
4238 + VCHI_CONNECTION_POWER_CONTROL power_control;
4240 + // allocate memory suitably aligned for this connection
4241 + VCHI_BUFFER_ALLOCATE buffer_allocate;
4243 + // free memory allocated by buffer_allocate
4244 + VCHI_BUFFER_FREE buffer_free;
4248 +struct vchi_connection_t {
4249 + const VCHI_CONNECTION_API_T *api;
4250 + VCHI_CONNECTION_STATE_T *state;
4251 +#ifdef VCHI_COARSE_LOCKING
4252 + VCOS_SEMAPHORE_T sem;
4257 +#endif /* CONNECTION_H_ */
4259 +/****************************** End of file **********************************/
4261 +++ b/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h
4264 + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved.
4266 + * This program is free software; you can redistribute it and/or modify
4267 + * it under the terms of the GNU General Public License as published by
4268 + * the Free Software Foundation; either version 2 of the License, or
4269 + * (at your option) any later version.
4271 + * This program is distributed in the hope that it will be useful,
4272 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4273 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4274 + * GNU General Public License for more details.
4276 + * You should have received a copy of the GNU General Public License
4277 + * along with this program; if not, write to the Free Software
4278 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4281 +#ifndef _VCHI_MESSAGE_H_
4282 +#define _VCHI_MESSAGE_H_
4284 +#include "interface/vchi/vchi_cfg_internal.h"
4285 +#include "interface/vcos/vcos.h"
4286 +#include "interface/vchi/vchi_common.h"
4289 +typedef enum message_event_type {
4290 + MESSAGE_EVENT_NONE,
4291 + MESSAGE_EVENT_NOP,
4292 + MESSAGE_EVENT_MESSAGE,
4293 + MESSAGE_EVENT_SLOT_COMPLETE,
4294 + MESSAGE_EVENT_RX_BULK_PAUSED,
4295 + MESSAGE_EVENT_RX_BULK_COMPLETE,
4296 + MESSAGE_EVENT_TX_COMPLETE,
4297 + MESSAGE_EVENT_MSG_DISCARDED
4298 +} MESSAGE_EVENT_TYPE_T;
4300 +typedef enum vchi_msg_flags
4302 + VCHI_MSG_FLAGS_NONE = 0x0,
4303 + VCHI_MSG_FLAGS_TERMINATE_DMA = 0x1
4304 +} VCHI_MSG_FLAGS_T;
4306 +typedef enum message_tx_channel
4308 + MESSAGE_TX_CHANNEL_MESSAGE = 0,
4309 + MESSAGE_TX_CHANNEL_BULK = 1 // drivers may provide multiple bulk channels, from 1 upwards
4310 +} MESSAGE_TX_CHANNEL_T;
4312 +// Macros used for cycling through bulk channels
4313 +#define MESSAGE_TX_CHANNEL_BULK_PREV(c) (MESSAGE_TX_CHANNEL_BULK+((c)-MESSAGE_TX_CHANNEL_BULK+VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION-1)%VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION)
4314 +#define MESSAGE_TX_CHANNEL_BULK_NEXT(c) (MESSAGE_TX_CHANNEL_BULK+((c)-MESSAGE_TX_CHANNEL_BULK+1)%VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION)
4316 +typedef enum message_rx_channel
4318 + MESSAGE_RX_CHANNEL_MESSAGE = 0,
4319 + MESSAGE_RX_CHANNEL_BULK = 1 // drivers may provide multiple bulk channels, from 1 upwards
4320 +} MESSAGE_RX_CHANNEL_T;
4322 +// Message receive slot information
4323 +typedef struct rx_msg_slot_info {
4325 + struct rx_msg_slot_info *next;
4326 + //struct slot_info *prev;
4327 +#if !defined VCHI_COARSE_LOCKING
4328 + VCOS_SEMAPHORE_T sem;
4331 + uint8_t *addr; // base address of slot
4332 + uint32_t len; // length of slot in bytes
4334 + uint32_t write_ptr; // hardware causes this to advance
4335 + uint32_t read_ptr; // this module does the reading
4336 + int active; // is this slot in the hardware dma fifo?
4337 + uint32_t msgs_parsed; // count how many messages are in this slot
4338 + uint32_t msgs_released; // how many messages have been released
4339 + void *state; // connection state information
4340 + uint8_t ref_count[VCHI_MAX_SERVICES_PER_CONNECTION]; // reference count for slots held by services
4341 +} RX_MSG_SLOTINFO_T;
4343 +// The message driver no longer needs to know about the fields of RX_BULK_SLOTINFO_T - sort this out.
4344 +// In particular, it mustn't use addr and len - they're the client buffer, but the message
4345 +// driver will be tasked with sending the aligned core section.
4346 +typedef struct rx_bulk_slotinfo_t {
4347 + struct rx_bulk_slotinfo_t *next;
4349 + VCOS_SEMAPHORE_T *blocking;
4355 + // needed for the callback
4358 + VCHI_FLAGS_T flags;
4359 +} RX_BULK_SLOTINFO_T;
4362 +/* ----------------------------------------------------------------------
4363 + * each connection driver will have a pool of the following struct.
4365 + * the pool will be managed by vchi_qman_*
4366 + * this means there will be multiple queues (single linked lists)
4367 + * a given struct message_info will be on exactly one of these queues
4369 + * -------------------------------------------------------------------- */
4370 +typedef struct rx_message_info {
4372 + struct message_info *next;
4373 + //struct message_info *prev;
4377 + RX_MSG_SLOTINFO_T *slot; // points to whichever slot contains this message
4378 + uint32_t tx_timestamp;
4379 + uint32_t rx_timestamp;
4381 +} RX_MESSAGE_INFO_T;
4384 + MESSAGE_EVENT_TYPE_T type;
4388 + void *addr; // address of message
4389 + uint16_t slot_delta; // whether this message indicated slot delta
4390 + uint32_t len; // length of message
4391 + RX_MSG_SLOTINFO_T *slot; // slot this message is in
4392 + vcos_fourcc_t service; // service id this message is destined for
4393 + uint32_t tx_timestamp; // timestamp from the header
4394 + uint32_t rx_timestamp; // timestamp when we parsed it
4397 + // FIXME: cleanup slot reporting...
4398 + RX_MSG_SLOTINFO_T *rx_msg;
4399 + RX_BULK_SLOTINFO_T *rx_bulk;
4401 + MESSAGE_TX_CHANNEL_T tx_channel;
4407 +typedef void VCHI_MESSAGE_DRIVER_EVENT_CALLBACK_T( void *state );
4410 + VCHI_MESSAGE_DRIVER_EVENT_CALLBACK_T *event_callback;
4411 +} VCHI_MESSAGE_DRIVER_OPEN_T;
4414 +// handle to this instance of message driver (as returned by ->open)
4415 +typedef struct opaque_mhandle_t *VCHI_MDRIVER_HANDLE_T;
4417 +struct opaque_vchi_message_driver_t {
4418 + VCHI_MDRIVER_HANDLE_T *(*open)( VCHI_MESSAGE_DRIVER_OPEN_T *params, void *state );
4419 + int32_t (*suspending)( VCHI_MDRIVER_HANDLE_T *handle );
4420 + int32_t (*resumed)( VCHI_MDRIVER_HANDLE_T *handle );
4421 + int32_t (*power_control)( VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T, vcos_bool_t enable );
4422 + int32_t (*add_msg_rx_slot)( VCHI_MDRIVER_HANDLE_T *handle, RX_MSG_SLOTINFO_T *slot ); // rx message
4423 + int32_t (*add_bulk_rx)( VCHI_MDRIVER_HANDLE_T *handle, void *data, uint32_t len, RX_BULK_SLOTINFO_T *slot ); // rx data (bulk)
4424 + int32_t (*send)( VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T channel, const void *data, uint32_t len, VCHI_MSG_FLAGS_T flags, void *send_handle ); // tx (message & bulk)
4425 + void (*next_event)( VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_EVENT_T *event ); // get the next event from message_driver
4426 + int32_t (*enable)( VCHI_MDRIVER_HANDLE_T *handle );
4427 + int32_t (*form_message)( VCHI_MDRIVER_HANDLE_T *handle, vcos_fourcc_t service_id, VCHI_MSG_VECTOR_T *vector, uint32_t count, void
4428 + *address, uint32_t length_avail, uint32_t max_total_length, vcos_bool_t pad_to_fill, vcos_bool_t allow_partial );
4430 + int32_t (*update_message)( VCHI_MDRIVER_HANDLE_T *handle, void *dest, int16_t *slot_count );
4431 + int32_t (*buffer_aligned)( VCHI_MDRIVER_HANDLE_T *handle, int tx, int uncached, const void *address, const uint32_t length );
4432 + void * (*allocate_buffer)( VCHI_MDRIVER_HANDLE_T *handle, uint32_t *length );
4433 + void (*free_buffer)( VCHI_MDRIVER_HANDLE_T *handle, void *address );
4434 + int (*rx_slot_size)( VCHI_MDRIVER_HANDLE_T *handle, int msg_size );
4435 + int (*tx_slot_size)( VCHI_MDRIVER_HANDLE_T *handle, int msg_size );
4437 + vcos_bool_t (*tx_supports_terminate)( const VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T channel );
4438 + uint32_t (*tx_bulk_chunk_size)( const VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T channel );
4439 + int (*tx_alignment)( const VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T channel );
4440 + int (*rx_alignment)( const VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_RX_CHANNEL_T channel );
4441 + void (*form_bulk_aux)( VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T channel, const void *data, uint32_t len, uint32_t chunk_size, const void **aux_data, int32_t *aux_len );
4442 + void (*debug)( VCHI_MDRIVER_HANDLE_T *handle );
4446 +#endif // _VCHI_MESSAGE_H_
4448 +/****************************** End of file ***********************************/
4450 +++ b/drivers/misc/vc04_services/interface/vchi/vchi.h
4453 + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved.
4455 + * This program is free software; you can redistribute it and/or modify
4456 + * it under the terms of the GNU General Public License as published by
4457 + * the Free Software Foundation; either version 2 of the License, or
4458 + * (at your option) any later version.
4460 + * This program is distributed in the hope that it will be useful,
4461 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4462 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4463 + * GNU General Public License for more details.
4465 + * You should have received a copy of the GNU General Public License
4466 + * along with this program; if not, write to the Free Software
4467 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4470 +/*=============================================================================
4471 +Contains the protypes for the vchi functions.
4472 +=============================================================================*/
4477 +#include "interface/vcos/vcos.h"
4478 +#include "interface/vchi/vchi_cfg.h"
4479 +#include "interface/vchi/vchi_common.h"
4480 +#include "interface/vchi/connections/connection.h"
4481 +#include "vchi_mh.h"
4484 +/******************************************************************************
4486 + *****************************************************************************/
4488 +#define VCHI_BULK_ROUND_UP(x) ((((unsigned long)(x))+VCHI_BULK_ALIGN-1) & ~(VCHI_BULK_ALIGN-1))
4489 +#define VCHI_BULK_ROUND_DOWN(x) (((unsigned long)(x)) & ~(VCHI_BULK_ALIGN-1))
4490 +#define VCHI_BULK_ALIGN_NBYTES(x) (VCHI_BULK_ALIGNED(x) ? 0 : (VCHI_BULK_ALIGN - ((unsigned long)(x) & (VCHI_BULK_ALIGN-1))))
4492 +#ifdef USE_VCHIQ_ARM
4493 +#define VCHI_BULK_ALIGNED(x) 1
4495 +#define VCHI_BULK_ALIGNED(x) (((unsigned long)(x) & (VCHI_BULK_ALIGN-1)) == 0)
4504 +} VCHI_MSG_VECTOR_TYPE_T;
4506 +typedef struct vchi_msg_vector_ex {
4508 + VCHI_MSG_VECTOR_TYPE_T type;
4511 + // a memory handle
4514 + VCHI_MEM_HANDLE_T handle;
4519 + // an ordinary data pointer
4522 + const void *vec_base;
4526 + // a nested vector list
4529 + struct vchi_msg_vector_ex *vec;
4533 +} VCHI_MSG_VECTOR_EX_T;
4536 +// Construct an entry in a msg vector for a pointer (p) of length (l)
4537 +#define VCHI_VEC_POINTER(p,l) VCHI_VEC_POINTER, { { (VCHI_MEM_HANDLE_T)(p), (l) } }
4539 +// Construct an entry in a msg vector for a message handle (h), starting at offset (o) of length (l)
4540 +#define VCHI_VEC_HANDLE(h,o,l) VCHI_VEC_HANDLE, { { (h), (o), (l) } }
4542 +// Macros to manipulate fourcc_t values
4543 +#define MAKE_FOURCC(x) ((fourcc_t)( (x[0] << 24) | (x[1] << 16) | (x[2] << 8) | x[3] ))
4544 +#define FOURCC_TO_CHAR(x) (x >> 24) & 0xFF,(x >> 16) & 0xFF,(x >> 8) & 0xFF, x & 0xFF
4547 +// Opaque service information
4548 +struct opaque_vchi_service_t;
4550 +// Descriptor for a held message. Allocated by client, initialised by vchi_msg_hold,
4551 +// vchi_msg_iter_hold or vchi_msg_iter_hold_next. Fields are for internal VCHI use only.
4554 + struct opaque_vchi_service_t *service;
4560 +// structure used to provide the information needed to open a server or a client
4562 + vcos_fourcc_t service_id;
4563 + VCHI_CONNECTION_T *connection;
4564 + uint32_t rx_fifo_size;
4565 + uint32_t tx_fifo_size;
4566 + VCHI_CALLBACK_T callback;
4567 + void *callback_param;
4568 + vcos_bool_t want_unaligned_bulk_rx; // client intends to receive bulk transfers of odd lengths or into unaligned buffers
4569 + vcos_bool_t want_unaligned_bulk_tx; // client intends to transmit bulk transfers of odd lengths or out of unaligned buffers
4570 + vcos_bool_t want_crc; // client wants to check CRCs on (bulk) transfers. Only needs to be set at 1 end - will do both directions.
4571 +} SERVICE_CREATION_T;
4573 +// Opaque handle for a VCHI instance
4574 +typedef struct opaque_vchi_instance_handle_t *VCHI_INSTANCE_T;
4576 +// Opaque handle for a server or client
4577 +typedef struct opaque_vchi_service_handle_t *VCHI_SERVICE_HANDLE_T;
4579 +// Service registration & startup
4580 +typedef void (*VCHI_SERVICE_INIT)(VCHI_INSTANCE_T initialise_instance, VCHI_CONNECTION_T **connections, uint32_t num_connections);
4582 +typedef struct service_info_tag {
4583 + const char * const vll_filename; /* VLL to load to start this service. This is an empty string if VLL is "static" */
4584 + VCHI_SERVICE_INIT init; /* Service initialisation function */
4585 + void *vll_handle; /* VLL handle; NULL when unloaded or a "static VLL" in build */
4588 +/******************************************************************************
4589 + Global funcs - implementation is specific to which side you are on (local / remote)
4590 + *****************************************************************************/
4596 +extern /*@observer@*/ VCHI_CONNECTION_T * vchi_create_connection( const VCHI_CONNECTION_API_T * function_table,
4597 + const VCHI_MESSAGE_DRIVER_T * low_level);
4600 +// Routine used to initialise the vchi on both local + remote connections
4601 +extern int32_t vchi_initialise( VCHI_INSTANCE_T *instance_handle );
4603 +extern int32_t vchi_exit( void );
4605 +extern int32_t vchi_connect( VCHI_CONNECTION_T **connections,
4606 + const uint32_t num_connections,
4607 + VCHI_INSTANCE_T instance_handle );
4609 +//When this is called, ensure that all services have no data pending.
4610 +//Bulk transfers can remain 'queued'
4611 +extern int32_t vchi_disconnect( VCHI_INSTANCE_T instance_handle );
4613 +// Global control over bulk CRC checking
4614 +extern int32_t vchi_crc_control( VCHI_CONNECTION_T *connection,
4615 + VCHI_CRC_CONTROL_T control );
4617 +// helper functions
4618 +extern void * vchi_allocate_buffer(VCHI_SERVICE_HANDLE_T handle, uint32_t *length);
4619 +extern void vchi_free_buffer(VCHI_SERVICE_HANDLE_T handle, void *address);
4620 +extern uint32_t vchi_current_time(VCHI_INSTANCE_T instance_handle);
4623 +/******************************************************************************
4624 + Global service API
4625 + *****************************************************************************/
4626 +// Routine to create a named service
4627 +extern int32_t vchi_service_create( VCHI_INSTANCE_T instance_handle,
4628 + SERVICE_CREATION_T *setup,
4629 + VCHI_SERVICE_HANDLE_T *handle );
4631 +// Routine to destory a service
4632 +extern int32_t vchi_service_destroy( const VCHI_SERVICE_HANDLE_T handle );
4634 +// Routine to open a named service
4635 +extern int32_t vchi_service_open( VCHI_INSTANCE_T instance_handle,
4636 + SERVICE_CREATION_T *setup,
4637 + VCHI_SERVICE_HANDLE_T *handle);
4639 +// Routine to close a named service
4640 +extern int32_t vchi_service_close( const VCHI_SERVICE_HANDLE_T handle );
4642 +// Routine to increment ref count on a named service
4643 +extern int32_t vchi_service_use( const VCHI_SERVICE_HANDLE_T handle );
4645 +// Routine to decrement ref count on a named service
4646 +extern int32_t vchi_service_release( const VCHI_SERVICE_HANDLE_T handle );
4648 +// Routine to send a message accross a service
4649 +extern int32_t vchi_msg_queue( VCHI_SERVICE_HANDLE_T handle,
4651 + uint32_t data_size,
4652 + VCHI_FLAGS_T flags,
4653 + void *msg_handle );
4655 +// scatter-gather (vector) and send message
4656 +int32_t vchi_msg_queuev_ex( VCHI_SERVICE_HANDLE_T handle,
4657 + VCHI_MSG_VECTOR_EX_T *vector,
4659 + VCHI_FLAGS_T flags,
4660 + void *msg_handle );
4662 +// legacy scatter-gather (vector) and send message, only handles pointers
4663 +int32_t vchi_msg_queuev( VCHI_SERVICE_HANDLE_T handle,
4664 + VCHI_MSG_VECTOR_T *vector,
4666 + VCHI_FLAGS_T flags,
4667 + void *msg_handle );
4669 +// Routine to receive a msg from a service
4670 +// Dequeue is equivalent to hold, copy into client buffer, release
4671 +extern int32_t vchi_msg_dequeue( VCHI_SERVICE_HANDLE_T handle,
4673 + uint32_t max_data_size_to_read,
4674 + uint32_t *actual_msg_size,
4675 + VCHI_FLAGS_T flags );
4677 +// Routine to look at a message in place.
4678 +// The message is not dequeued, so a subsequent call to peek or dequeue
4679 +// will return the same message.
4680 +extern int32_t vchi_msg_peek( VCHI_SERVICE_HANDLE_T handle,
4682 + uint32_t *msg_size,
4683 + VCHI_FLAGS_T flags );
4685 +// Routine to remove a message after it has been read in place with peek
4686 +// The first message on the queue is dequeued.
4687 +extern int32_t vchi_msg_remove( VCHI_SERVICE_HANDLE_T handle );
4689 +// Routine to look at a message in place.
4690 +// The message is dequeued, so the caller is left holding it; the descriptor is
4691 +// filled in and must be released when the user has finished with the message.
4692 +extern int32_t vchi_msg_hold( VCHI_SERVICE_HANDLE_T handle,
4693 + void **data, // } may be NULL, as info can be
4694 + uint32_t *msg_size, // } obtained from HELD_MSG_T
4695 + VCHI_FLAGS_T flags,
4696 + VCHI_HELD_MSG_T *message_descriptor );
4698 +// Initialise an iterator to look through messages in place
4699 +extern int32_t vchi_msg_look_ahead( VCHI_SERVICE_HANDLE_T handle,
4700 + VCHI_MSG_ITER_T *iter,
4701 + VCHI_FLAGS_T flags );
4703 +/******************************************************************************
4704 + Global service support API - operations on held messages and message iterators
4705 + *****************************************************************************/
4707 +// Routine to get the address of a held message
4708 +extern void *vchi_held_msg_ptr( const VCHI_HELD_MSG_T *message );
4710 +// Routine to get the size of a held message
4711 +extern int32_t vchi_held_msg_size( const VCHI_HELD_MSG_T *message );
4713 +// Routine to get the transmit timestamp as written into the header by the peer
4714 +extern uint32_t vchi_held_msg_tx_timestamp( const VCHI_HELD_MSG_T *message );
4716 +// Routine to get the reception timestamp, written as we parsed the header
4717 +extern uint32_t vchi_held_msg_rx_timestamp( const VCHI_HELD_MSG_T *message );
4719 +// Routine to release a held message after it has been processed
4720 +extern int32_t vchi_held_msg_release( VCHI_HELD_MSG_T *message );
4722 +// Indicates whether the iterator has a next message.
4723 +extern vcos_bool_t vchi_msg_iter_has_next( const VCHI_MSG_ITER_T *iter );
4725 +// Return the pointer and length for the next message and advance the iterator.
4726 +extern int32_t vchi_msg_iter_next( VCHI_MSG_ITER_T *iter,
4728 + uint32_t *msg_size );
4730 +// Remove the last message returned by vchi_msg_iter_next.
4731 +// Can only be called once after each call to vchi_msg_iter_next.
4732 +extern int32_t vchi_msg_iter_remove( VCHI_MSG_ITER_T *iter );
4734 +// Hold the last message returned by vchi_msg_iter_next.
4735 +// Can only be called once after each call to vchi_msg_iter_next.
4736 +extern int32_t vchi_msg_iter_hold( VCHI_MSG_ITER_T *iter,
4737 + VCHI_HELD_MSG_T *message );
4739 +// Return information for the next message, and hold it, advancing the iterator.
4740 +extern int32_t vchi_msg_iter_hold_next( VCHI_MSG_ITER_T *iter,
4741 + void **data, // } may be NULL
4742 + uint32_t *msg_size, // }
4743 + VCHI_HELD_MSG_T *message );
4746 +/******************************************************************************
4748 + *****************************************************************************/
4750 +// Routine to prepare interface for a transfer from the other side
4751 +extern int32_t vchi_bulk_queue_receive( VCHI_SERVICE_HANDLE_T handle,
4753 + uint32_t data_size,
4754 + VCHI_FLAGS_T flags,
4755 + void *transfer_handle );
4758 +// Prepare interface for a transfer from the other side into relocatable memory.
4759 +int32_t vchi_bulk_queue_receive_reloc( const VCHI_SERVICE_HANDLE_T handle,
4760 + VCHI_MEM_HANDLE_T h_dst,
4762 + uint32_t data_size,
4763 + const VCHI_FLAGS_T flags,
4764 + void * const bulk_handle );
4766 +// Routine to queue up data ready for transfer to the other (once they have signalled they are ready)
4767 +extern int32_t vchi_bulk_queue_transmit( VCHI_SERVICE_HANDLE_T handle,
4768 + const void *data_src,
4769 + uint32_t data_size,
4770 + VCHI_FLAGS_T flags,
4771 + void *transfer_handle );
4774 +/******************************************************************************
4775 + Configuration plumbing
4776 + *****************************************************************************/
4778 +// function prototypes for the different mid layers (the state info gives the different physical connections)
4779 +extern const VCHI_CONNECTION_API_T *single_get_func_table( void );
4780 +//extern const VCHI_CONNECTION_API_T *local_server_get_func_table( void );
4781 +//extern const VCHI_CONNECTION_API_T *local_client_get_func_table( void );
4783 +// declare all message drivers here
4784 +const VCHI_MESSAGE_DRIVER_T *vchi_mphi_message_driver_func_table( void );
4790 +extern int32_t vchi_bulk_queue_transmit_reloc( VCHI_SERVICE_HANDLE_T handle,
4791 + VCHI_MEM_HANDLE_T h_src,
4793 + uint32_t data_size,
4794 + VCHI_FLAGS_T flags,
4795 + void *transfer_handle );
4796 +#endif /* VCHI_H_ */
4798 +/****************************** End of file **********************************/
4800 +++ b/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h
4803 + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved.
4805 + * This program is free software; you can redistribute it and/or modify
4806 + * it under the terms of the GNU General Public License as published by
4807 + * the Free Software Foundation; either version 2 of the License, or
4808 + * (at your option) any later version.
4810 + * This program is distributed in the hope that it will be useful,
4811 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4812 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4813 + * GNU General Public License for more details.
4815 + * You should have received a copy of the GNU General Public License
4816 + * along with this program; if not, write to the Free Software
4817 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4820 +/*=============================================================================
4821 +Contains the #defines for the number of servers / clients etc, these can be
4822 +over-ridden from the platform makefile if needed
4823 +=============================================================================*/
4825 +#ifndef VCHI_CFG_H_
4826 +#define VCHI_CFG_H_
4828 +/****************************************************************************************
4829 + * Defines in this first section are part of the VCHI API and may be examined by VCHI
4831 + ***************************************************************************************/
4833 +/* Required alignment of base addresses for bulk transfer, if unaligned transfers are not enabled */
4834 +/* Really determined by the message driver, and should be available from a run-time call. */
4835 +#ifndef VCHI_BULK_ALIGN
4836 +# if __VCCOREVER__ >= 0x04000000
4837 +# define VCHI_BULK_ALIGN 32 // Allows for the need to do cache cleans
4839 +# define VCHI_BULK_ALIGN 16
4843 +/* Required length multiple for bulk transfers, if unaligned transfers are not enabled */
4844 +/* May be less than or greater than VCHI_BULK_ALIGN */
4845 +/* Really determined by the message driver, and should be available from a run-time call. */
4846 +#ifndef VCHI_BULK_GRANULARITY
4847 +# if __VCCOREVER__ >= 0x04000000
4848 +# define VCHI_BULK_GRANULARITY 32 // Allows for the need to do cache cleans
4850 +# define VCHI_BULK_GRANULARITY 16
4854 +/* The largest possible message to be queued with vchi_msg_queue. */
4855 +#ifndef VCHI_MAX_MSG_SIZE
4856 +# if defined VCHI_LOCAL_HOST_PORT
4857 +# define VCHI_MAX_MSG_SIZE 16384 // makes file transfers fast, but should they be using bulk?
4859 +# define VCHI_MAX_MSG_SIZE 4096 // NOTE: THIS MUST BE LARGER THAN OR EQUAL TO THE SIZE OF THE KHRONOS MERGE BUFFER!!
4863 +/******************************************************************************************
4864 + * Defines below are system configuration options, and should not be used by VCHI services.
4865 + *****************************************************************************************/
4867 +/* How many connections can we support? A localhost implementation uses 2 connections,
4868 + * 1 for host-app, 1 for VMCS, and these are hooked together by a loopback MPHI VCFW
4870 +#ifndef VCHI_MAX_NUM_CONNECTIONS
4871 +# define VCHI_MAX_NUM_CONNECTIONS 3
4874 +/* How many services can we open per connection? Extending this doesn't cost processing time, just a small
4875 + * amount of static memory. */
4876 +#ifndef VCHI_MAX_SERVICES_PER_CONNECTION
4877 +# define VCHI_MAX_SERVICES_PER_CONNECTION 36
4880 +/* Adjust if using a message driver that supports more logical TX channels */
4881 +#ifndef VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION
4882 +# define VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION 9 // 1 MPHI + 8 CCP2 logical channels
4885 +/* Adjust if using a message driver that supports more logical RX channels */
4886 +#ifndef VCHI_MAX_BULK_RX_CHANNELS_PER_CONNECTION
4887 +# define VCHI_MAX_BULK_RX_CHANNELS_PER_CONNECTION 1 // 1 MPHI
4890 +/* How many receive slots do we use. This times VCHI_MAX_MSG_SIZE gives the effective
4891 + * receive queue space, less message headers. */
4892 +#ifndef VCHI_NUM_READ_SLOTS
4893 +# if defined(VCHI_LOCAL_HOST_PORT)
4894 +# define VCHI_NUM_READ_SLOTS 4
4896 +# define VCHI_NUM_READ_SLOTS 48
4900 +/* Do we utilise overrun facility for receive message slots? Can aid peer transmit
4901 + * performance. Only define on VideoCore end, talking to host.
4903 +//#define VCHI_MSG_RX_OVERRUN
4905 +/* How many transmit slots do we use. Generally don't need many, as the hardware driver
4906 + * underneath VCHI will usually have its own buffering. */
4907 +#ifndef VCHI_NUM_WRITE_SLOTS
4908 +# define VCHI_NUM_WRITE_SLOTS 4
4911 +/* If a service has held or queued received messages in VCHI_XOFF_THRESHOLD or more slots,
4912 + * then it's taking up too much buffer space, and the peer service will be told to stop
4913 + * transmitting with an XOFF message. For this to be effective, the VCHI_NUM_READ_SLOTS
4914 + * needs to be considerably bigger than VCHI_NUM_WRITE_SLOTS, or the transmit latency
4916 +#ifndef VCHI_XOFF_THRESHOLD
4917 +# define VCHI_XOFF_THRESHOLD (VCHI_NUM_READ_SLOTS / 2)
4920 +/* After we've sent an XOFF, the peer will be told to resume transmission once the local
4921 + * service has dequeued/released enough messages that it's now occupying
4922 + * VCHI_XON_THRESHOLD slots or fewer. */
4923 +#ifndef VCHI_XON_THRESHOLD
4924 +# define VCHI_XON_THRESHOLD (VCHI_NUM_READ_SLOTS / 4)
4927 +/* A size below which a bulk transfer omits the handshake completely and always goes
4928 + * via the message channel, if bulk auxiliary is being sent on that service. (The user
4929 + * can guarantee this by enabling unaligned transmits).
4931 +#ifndef VCHI_MIN_BULK_SIZE
4932 +# define VCHI_MIN_BULK_SIZE ( VCHI_MAX_MSG_SIZE / 2 < 4096 ? VCHI_MAX_MSG_SIZE / 2 : 4096 )
4935 +/* Maximum size of bulk transmission chunks, for each interface type. A trade-off between
4936 + * speed and latency; the smaller the chunk size the better change of messages and other
4937 + * bulk transmissions getting in when big bulk transfers are happening. Set to 0 to not
4938 + * break transmissions into chunks.
4940 +#ifndef VCHI_MAX_BULK_CHUNK_SIZE_MPHI
4941 +# define VCHI_MAX_BULK_CHUNK_SIZE_MPHI (16 * 1024)
4944 +/* NB Chunked CCP2 transmissions violate the letter of the CCP2 spec by using "JPEG8" mode
4945 + * with multiple-line frames. Only use if the receiver can cope. */
4946 +#ifndef VCHI_MAX_BULK_CHUNK_SIZE_CCP2
4947 +# define VCHI_MAX_BULK_CHUNK_SIZE_CCP2 0
4950 +/* How many TX messages can we have pending in our transmit slots. Once exhausted,
4951 + * vchi_msg_queue will be blocked. */
4952 +#ifndef VCHI_TX_MSG_QUEUE_SIZE
4953 +# define VCHI_TX_MSG_QUEUE_SIZE 256
4956 +/* How many RX messages can we have parsed in the receive slots. Once exhausted, parsing
4957 + * will be suspended until older messages are dequeued/released. */
4958 +#ifndef VCHI_RX_MSG_QUEUE_SIZE
4959 +# define VCHI_RX_MSG_QUEUE_SIZE 256
4962 +/* Really should be able to cope if we run out of received message descriptors, by
4963 + * suspending parsing as the comment above says, but we don't. This sweeps the issue
4964 + * under the carpet. */
4965 +#if VCHI_RX_MSG_QUEUE_SIZE < (VCHI_MAX_MSG_SIZE/16 + 1) * VCHI_NUM_READ_SLOTS
4966 +# undef VCHI_RX_MSG_QUEUE_SIZE
4967 +# define VCHI_RX_MSG_QUEUE_SIZE (VCHI_MAX_MSG_SIZE/16 + 1) * VCHI_NUM_READ_SLOTS
4970 +/* How many bulk transmits can we have pending. Once exhausted, vchi_bulk_queue_transmit
4971 + * will be blocked. */
4972 +#ifndef VCHI_TX_BULK_QUEUE_SIZE
4973 +# define VCHI_TX_BULK_QUEUE_SIZE 64
4976 +/* How many bulk receives can we have pending. Once exhausted, vchi_bulk_queue_receive
4977 + * will be blocked. */
4978 +#ifndef VCHI_RX_BULK_QUEUE_SIZE
4979 +# define VCHI_RX_BULK_QUEUE_SIZE 64
4982 +/* A limit on how many outstanding bulk requests we expect the peer to give us. If
4983 + * the peer asks for more than this, VCHI will fail and assert. The number is determined
4984 + * by the peer's hardware - it's the number of outstanding requests that can be queued
4985 + * on all bulk channels. VC3's MPHI peripheral allows 16. */
4986 +#ifndef VCHI_MAX_PEER_BULK_REQUESTS
4987 +# define VCHI_MAX_PEER_BULK_REQUESTS 32
4990 +/* Define VCHI_CCP2TX_MANUAL_POWER if the host tells us when to turn the CCP2
4991 + * transmitter on and off.
4993 +/*#define VCHI_CCP2TX_MANUAL_POWER*/
4995 +#ifndef VCHI_CCP2TX_MANUAL_POWER
4997 +/* Timeout (in milliseconds) for putting the CCP2TX interface into IDLE state. Set
4998 + * negative for no IDLE.
5000 +# ifndef VCHI_CCP2TX_IDLE_TIMEOUT
5001 +# define VCHI_CCP2TX_IDLE_TIMEOUT 5
5004 +/* Timeout (in milliseconds) for putting the CCP2TX interface into OFF state. Set
5005 + * negative for no OFF.
5007 +# ifndef VCHI_CCP2TX_OFF_TIMEOUT
5008 +# define VCHI_CCP2TX_OFF_TIMEOUT 1000
5011 +#endif /* VCHI_CCP2TX_MANUAL_POWER */
5013 +#endif /* VCHI_CFG_H_ */
5015 +/****************************** End of file **********************************/
5017 +++ b/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h
5020 + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved.
5022 + * This program is free software; you can redistribute it and/or modify
5023 + * it under the terms of the GNU General Public License as published by
5024 + * the Free Software Foundation; either version 2 of the License, or
5025 + * (at your option) any later version.
5027 + * This program is distributed in the hope that it will be useful,
5028 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5029 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5030 + * GNU General Public License for more details.
5032 + * You should have received a copy of the GNU General Public License
5033 + * along with this program; if not, write to the Free Software
5034 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
5037 +#ifndef VCHI_CFG_INTERNAL_H_
5038 +#define VCHI_CFG_INTERNAL_H_
5040 +/****************************************************************************************
5041 + * Control optimisation attempts.
5042 + ***************************************************************************************/
5044 +// Don't use lots of short-term locks - use great long ones, reducing the overall locks-per-second
5045 +#define VCHI_COARSE_LOCKING
5047 +// Avoid lock then unlock on exit from blocking queue operations (msg tx, bulk rx/tx)
5048 +// (only relevant if VCHI_COARSE_LOCKING)
5049 +#define VCHI_ELIDE_BLOCK_EXIT_LOCK
5051 +// Avoid lock on non-blocking peek
5052 +// (only relevant if VCHI_COARSE_LOCKING)
5053 +#define VCHI_AVOID_PEEK_LOCK
5055 +// Use one slot-handler thread per connection, rather than 1 thread dealing with all connections in rotation.
5056 +#define VCHI_MULTIPLE_HANDLER_THREADS
5058 +// Put free descriptors onto the head of the free queue, rather than the tail, so that we don't thrash
5059 +// our way through the pool of descriptors.
5060 +#define VCHI_PUSH_FREE_DESCRIPTORS_ONTO_HEAD
5062 +// Don't issue a MSG_AVAILABLE callback for every single message. Possibly only safe if VCHI_COARSE_LOCKING.
5063 +#define VCHI_FEWER_MSG_AVAILABLE_CALLBACKS
5065 +// Don't use message descriptors for TX messages that don't need them
5066 +#define VCHI_MINIMISE_TX_MSG_DESCRIPTORS
5068 +// Nano-locks for multiqueue
5069 +//#define VCHI_MQUEUE_NANOLOCKS
5071 +// Lock-free(er) dequeuing
5072 +//#define VCHI_RX_NANOLOCKS
5074 +#endif /*VCHI_CFG_INTERNAL_H_*/
5076 +++ b/drivers/misc/vc04_services/interface/vchi/vchi_common.h
5079 + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved.
5081 + * This program is free software; you can redistribute it and/or modify
5082 + * it under the terms of the GNU General Public License as published by
5083 + * the Free Software Foundation; either version 2 of the License, or
5084 + * (at your option) any later version.
5086 + * This program is distributed in the hope that it will be useful,
5087 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5088 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5089 + * GNU General Public License for more details.
5091 + * You should have received a copy of the GNU General Public License
5092 + * along with this program; if not, write to the Free Software
5093 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
5096 +/*=============================================================================
5097 +Contains global defs used by submodules within vchi.
5098 +=============================================================================*/
5100 +#ifndef VCHI_COMMON_H_
5101 +#define VCHI_COMMON_H_
5104 +//flags used when sending messages (must be bitmapped)
5107 + VCHI_FLAGS_NONE = 0x0,
5108 + VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE = 0x1, // waits for message to be received, or sent (NB. not the same as being seen on other side)
5109 + VCHI_FLAGS_CALLBACK_WHEN_OP_COMPLETE = 0x2, // run a callback when message sent
5110 + VCHI_FLAGS_BLOCK_UNTIL_QUEUED = 0x4, // return once the transfer is in a queue ready to go
5111 + VCHI_FLAGS_ALLOW_PARTIAL = 0x8,
5112 + VCHI_FLAGS_BLOCK_UNTIL_DATA_READ = 0x10,
5113 + VCHI_FLAGS_CALLBACK_WHEN_DATA_READ = 0x20,
5115 + VCHI_FLAGS_ALIGN_SLOT = 0x000080, // internal use only
5116 + VCHI_FLAGS_BULK_AUX_QUEUED = 0x010000, // internal use only
5117 + VCHI_FLAGS_BULK_AUX_COMPLETE = 0x020000, // internal use only
5118 + VCHI_FLAGS_BULK_DATA_QUEUED = 0x040000, // internal use only
5119 + VCHI_FLAGS_BULK_DATA_COMPLETE = 0x080000, // internal use only
5120 + VCHI_FLAGS_INTERNAL = 0xFF0000
5123 +// constants for vchi_crc_control()
5125 + VCHI_CRC_NOTHING = -1,
5126 + VCHI_CRC_PER_SERVICE = 0,
5127 + VCHI_CRC_EVERYTHING = 1,
5128 +} VCHI_CRC_CONTROL_T;
5130 +//callback reasons when an event occurs on a service
5133 + VCHI_CALLBACK_REASON_MIN,
5135 + //This indicates that there is data available
5136 + //handle is the msg id that was transmitted with the data
5137 + // When a message is received and there was no FULL message available previously, send callback
5138 + // Tasks get kicked by the callback, reset their event and try and read from the fifo until it fails
5139 + VCHI_CALLBACK_MSG_AVAILABLE,
5140 + VCHI_CALLBACK_MSG_SENT,
5141 + VCHI_CALLBACK_MSG_SPACE_AVAILABLE, // XXX not yet implemented
5143 + // This indicates that a transfer from the other side has completed
5144 + VCHI_CALLBACK_BULK_RECEIVED,
5145 + //This indicates that data queued up to be sent has now gone
5146 + //handle is the msg id that was used when sending the data
5147 + VCHI_CALLBACK_BULK_SENT,
5148 + VCHI_CALLBACK_BULK_RX_SPACE_AVAILABLE, // XXX not yet implemented
5149 + VCHI_CALLBACK_BULK_TX_SPACE_AVAILABLE, // XXX not yet implemented
5151 + VCHI_CALLBACK_SERVICE_CLOSED,
5153 + // this side has sent XOFF to peer due to lack of data consumption by service
5154 + // (suggests the service may need to take some recovery action if it has
5155 + // been deliberately holding off consuming data)
5156 + VCHI_CALLBACK_SENT_XOFF,
5157 + VCHI_CALLBACK_SENT_XON,
5159 + // indicates that a bulk transfer has finished reading the source buffer
5160 + VCHI_CALLBACK_BULK_DATA_READ,
5162 + // power notification events (currently host side only)
5163 + VCHI_CALLBACK_PEER_OFF,
5164 + VCHI_CALLBACK_PEER_SUSPENDED,
5165 + VCHI_CALLBACK_PEER_ON,
5166 + VCHI_CALLBACK_PEER_RESUMED,
5167 + VCHI_CALLBACK_FORCED_POWER_OFF,
5169 +#ifdef USE_VCHIQ_ARM
5170 + // some extra notifications provided by vchiq_arm
5171 + VCHI_CALLBACK_SERVICE_OPENED,
5172 + VCHI_CALLBACK_BULK_RECEIVE_ABORTED,
5173 + VCHI_CALLBACK_BULK_TRANSMIT_ABORTED,
5176 + VCHI_CALLBACK_REASON_MAX
5177 +} VCHI_CALLBACK_REASON_T;
5179 +//Calback used by all services / bulk transfers
5180 +typedef void (*VCHI_CALLBACK_T)( void *callback_param, //my service local param
5181 + VCHI_CALLBACK_REASON_T reason,
5182 + void *handle ); //for transmitting msg's only
5187 + * Define vector struct for scatter-gather (vector) operations
5188 + * Vectors can be nested - if a vector element has negative length, then
5189 + * the data pointer is treated as pointing to another vector array, with
5190 + * '-vec_len' elements. Thus to append a header onto an existing vector,
5191 + * you can do this:
5193 + * void foo(const VCHI_MSG_VECTOR_T *v, int n)
5195 + * VCHI_MSG_VECTOR_T nv[2];
5196 + * nv[0].vec_base = my_header;
5197 + * nv[0].vec_len = sizeof my_header;
5198 + * nv[1].vec_base = v;
5199 + * nv[1].vec_len = -n;
5203 +typedef struct vchi_msg_vector {
5204 + const void *vec_base;
5206 +} VCHI_MSG_VECTOR_T;
5208 +// Opaque type for a connection API
5209 +typedef struct opaque_vchi_connection_api_t VCHI_CONNECTION_API_T;
5211 +// Opaque type for a message driver
5212 +typedef struct opaque_vchi_message_driver_t VCHI_MESSAGE_DRIVER_T;
5215 +// Iterator structure for reading ahead through received message queue. Allocated by client,
5216 +// initialised by vchi_msg_look_ahead. Fields are for internal VCHI use only.
5217 +// Iterates over messages in queue at the instant of the call to vchi_msg_lookahead -
5218 +// will not proceed to messages received since. Behaviour is undefined if an iterator
5219 +// is used again after messages for that service are removed/dequeued by any
5220 +// means other than vchi_msg_iter_... calls on the iterator itself.
5222 + struct opaque_vchi_service_t *service;
5229 +#endif // VCHI_COMMON_H_
5230 --- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
5231 +++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
5233 #define TOTAL_SLOTS (VCHIQ_SLOT_ZERO_SLOTS + 2 * 32)
5235 #define VCHIQ_DOORBELL_IRQ IRQ_ARM_DOORBELL_0
5236 -#define VCHIQ_ARM_ADDRESS(x) __virt_to_bus(x)
5237 +#define VCHIQ_ARM_ADDRESS(x) ((void *)__virt_to_bus((unsigned)x))
5239 #include "vchiq_arm.h"
5240 #include "vchiq_2835.h"
5241 @@ -182,7 +182,15 @@ remote_event_signal(REMOTE_EVENT_T *even
5243 vchiq_copy_from_user(void *dst, const void *src, int size)
5245 - return copy_from_user(dst, src, size);
5246 + if ( (uint32_t)src < TASK_SIZE)
5248 + return copy_from_user(dst, src, size);
5252 + memcpy( dst, src, size );
5258 @@ -239,6 +247,22 @@ vchiq_dump_platform_state(void *dump_con
5259 vchiq_dump(dump_context, buf, len + 1);
5263 +vchiq_platform_suspend(VCHIQ_STATE_T *state)
5265 + vcos_unused(state);
5266 + vcos_assert_msg(0, "Suspend/resume not supported");
5267 + return VCHIQ_ERROR;
5271 +vchiq_platform_resume(VCHIQ_STATE_T *state)
5273 + vcos_unused(state);
5274 + vcos_assert_msg(0, "Suspend/resume not supported");
5275 + return VCHIQ_ERROR;
5279 vchiq_platform_paused(VCHIQ_STATE_T *state)
5281 @@ -253,33 +277,40 @@ vchiq_platform_resumed(VCHIQ_STATE_T *st
5282 vcos_assert_msg(0, "Suspend/resume not supported");
5286 -vchiq_use_service(VCHIQ_SERVICE_HANDLE_T handle)
5288 +vchiq_platform_videocore_wanted(VCHIQ_STATE_T* state)
5290 - VCHIQ_SERVICE_T *service = (VCHIQ_SERVICE_T *)handle;
5292 - return VCHIQ_ERROR;
5293 - return VCHIQ_SUCCESS;
5294 + vcos_unused(state);
5295 + return 1; // autosuspend not supported - videocore always wanted
5299 -vchiq_release_service(VCHIQ_SERVICE_HANDLE_T handle)
5300 +#if VCOS_HAVE_TIMER
5302 +vchiq_platform_use_suspend_timer(void)
5304 - VCHIQ_SERVICE_T *service = (VCHIQ_SERVICE_T *)handle;
5306 - return VCHIQ_ERROR;
5307 - return VCHIQ_SUCCESS;
5312 +vchiq_dump_platform_use_state(VCHIQ_STATE_T *state)
5314 + vcos_unused(state);
5318 -vchiq_check_service(VCHIQ_SERVICE_HANDLE_T handle)
5319 +vchiq_platform_init_state(VCHIQ_STATE_T *state)
5321 - VCHIQ_SERVICE_T *service = (VCHIQ_SERVICE_T *)handle;
5323 - return VCHIQ_ERROR;
5324 + vcos_unused(state);
5325 return VCHIQ_SUCCESS;
5329 +vchiq_platform_get_arm_state(VCHIQ_STATE_T *state)
5331 + vcos_unused(state);
5338 @@ -479,9 +510,3 @@ free_pagelist(PAGELIST_T *pagelist, int
5343 -vchiq_platform_suspend(VCHIQ_STATE_T *state)
5345 - vcos_unused(state);
5346 - return VCHIQ_ERROR;
5348 --- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c
5349 +++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c
5351 #include <linux/cdev.h>
5352 #include <linux/fs.h>
5353 #include <linux/device.h>
5354 +#include <linux/mm.h>
5355 +#include <linux/highmem.h>
5356 +#include <linux/pagemap.h>
5358 #include "vchiq_core.h"
5359 #include "vchiq_ioctl.h"
5362 #define VCOS_LOG_CATEGORY (&vchiq_arm_log_category)
5364 +#define VCHIQ_ARM_VCSUSPEND_TASK_STACK 4096
5366 +#if VCOS_HAVE_TIMER
5367 +#define SUSPEND_TIMER_TIMEOUT_MS 100
5368 +static VCOS_TIMER_T g_suspend_timer;
5369 +static void suspend_timer_callback(void *context);
5373 typedef struct client_service_struct {
5374 VCHIQ_SERVICE_T *service;
5376 @@ -106,10 +118,17 @@ static const char *ioctl_names[] =
5381 + "RELEASE_SERVICE",
5382 + "SET_SERVICE_OPTION",
5386 -VCOS_LOG_LEVEL_T vchiq_default_arm_log_level = VCOS_LOG_WARN;
5387 +vcos_static_assert(vcos_countof(ioctl_names) == (VCHIQ_IOC_MAX + 1));
5389 +VCOS_LOG_LEVEL_T vchiq_default_arm_log_level = VCOS_LOG_ERROR;
5392 +dump_phys_mem( void *virt_addr, uint32_t num_bytes );
5394 /****************************************************************************
5396 @@ -118,7 +137,7 @@ VCOS_LOG_LEVEL_T vchiq_default_arm_log_l
5397 ***************************************************************************/
5399 static inline USER_SERVICE_T *find_service_by_handle(
5400 - VCHIQ_INSTANCE_T instance, int handle )
5401 + VCHIQ_INSTANCE_T instance, int handle )
5403 USER_SERVICE_T *user_service;
5405 @@ -524,7 +543,7 @@ vchiq_ioctl(struct file *file, unsigned
5406 status = (cmd == VCHIQ_IOC_USE_SERVICE) ? vchiq_use_service(&user_service->service->base) : vchiq_release_service(&user_service->service->base);
5407 if (status != VCHIQ_SUCCESS)
5409 - ret = -EINVAL; // ???
5410 + ret = -EINVAL; /* ??? */
5414 @@ -872,6 +891,21 @@ vchiq_ioctl(struct file *file, unsigned
5418 + case VCHIQ_IOC_DUMP_PHYS_MEM:
5420 + VCHIQ_DUMP_MEM_T args;
5422 + if (copy_from_user
5423 + (&args, (const void __user *)arg,
5424 + sizeof(args)) != 0) {
5428 + dump_phys_mem( args.virt_addr, args.num_bytes );
5436 @@ -1060,7 +1094,7 @@ vchiq_dump(void *dump_context, const cha
5438 if (copy_to_user(context->buf + context->actual - 1, &cr, 1))
5440 - context->actual = -EFAULT;
5441 + context->actual = -EFAULT;
5445 @@ -1153,6 +1187,88 @@ vchiq_dump_platform_service_state(void *
5447 /****************************************************************************
5451 +***************************************************************************/
5454 +dump_phys_mem( void *virt_addr, uint32_t num_bytes )
5457 + uint8_t *end_virt_addr = virt_addr + num_bytes;
5463 + struct page *page;
5464 + struct page **pages;
5465 + uint8_t *kmapped_virt_ptr;
5467 + // Align virtAddr and endVirtAddr to 16 byte boundaries.
5469 + virt_addr = (void *)((unsigned long)virt_addr & ~0x0fuL );
5470 + end_virt_addr = (void *)(( (unsigned long)end_virt_addr + 15uL ) & ~0x0fuL);
5472 + offset = (int)(long)virt_addr & ( PAGE_SIZE - 1 );
5473 + end_offset = (int)(long)end_virt_addr & ( PAGE_SIZE - 1 );
5475 + num_pages = (offset + num_bytes + PAGE_SIZE - 1) / PAGE_SIZE;
5477 + if (( pages = kmalloc( sizeof( struct page *) * num_pages, GFP_KERNEL )) == NULL )
5479 + printk( KERN_ERR "Unable to allocation memory for %d pages\n", num_pages );
5483 + down_read( ¤t->mm->mmap_sem );
5484 + rc = get_user_pages( current, /* task */
5485 + current->mm, /* mm */
5486 + (unsigned long)virt_addr, /* start */
5487 + num_pages, /* len */
5490 + pages, /* pages (array of pointers to page) */
5491 + NULL ); /* vmas */
5492 + up_read( ¤t->mm->mmap_sem );
5497 + while ( offset < end_offset ) {
5499 + int page_offset = offset % PAGE_SIZE;
5500 + page_idx = offset / PAGE_SIZE;
5502 + if ( page_idx != prev_idx ) {
5504 + if (page != NULL) {
5507 + page = pages[page_idx];
5508 + kmapped_virt_ptr = kmap( page );
5510 + prev_idx = page_idx;
5513 + vcos_log_dump_mem_impl( &vchiq_arm_log_category, "ph",
5514 + (uint32_t)(unsigned long)&kmapped_virt_ptr[page_offset],
5515 + &kmapped_virt_ptr[page_offset], 16 );
5519 + if (page != NULL) {
5523 + for ( page_idx = 0; page_idx < num_pages; page_idx++ ) {
5524 + page_cache_release( pages[page_idx] );
5529 +/****************************************************************************
5533 ***************************************************************************/
5534 @@ -1204,6 +1320,505 @@ vchiq_fops = {
5539 + * Autosuspend related functionality
5542 +static int vchiq_videocore_wanted(VCHIQ_STATE_T* state)
5544 + VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state);
5546 + { // autosuspend not supported - always return wanted
5549 + else if(!arm_state->videocore_use_count)
5550 + { // usage count zero - check for override
5551 + return vchiq_platform_videocore_wanted(state);
5554 + { // non-zero usage count - videocore still required
5560 +/* Called by the lp thread */
5564 + VCHIQ_STATE_T *state = (VCHIQ_STATE_T *) v;
5565 + VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state);
5568 + vcos_event_wait(&arm_state->lp_evt);
5570 + vcos_mutex_lock(&arm_state->use_count_mutex);
5571 + if (!vchiq_videocore_wanted(state))
5573 + arm_state->suspend_pending = 1;
5575 + vcos_mutex_unlock(&arm_state->use_count_mutex);
5577 + vchiq_arm_vcsuspend(state);
5581 +/* Called by the hp thread */
5585 + VCHIQ_STATE_T *state = (VCHIQ_STATE_T *) v;
5586 + VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state);
5590 + vcos_event_wait(&arm_state->hp_evt);
5594 + vcos_mutex_lock(&arm_state->use_count_mutex);
5595 + if (vchiq_videocore_wanted(state))
5597 + vchiq_arm_vcresume(state);
5599 + if(arm_state->use_notify_pending)
5601 + send_pending = arm_state->use_notify_pending;
5602 + arm_state->use_notify_pending=0;
5604 + vcos_mutex_unlock(&arm_state->use_count_mutex);
5605 + while(send_pending--)
5607 + vcos_log_info( "%s sending VCHIQ_MSG_REMOTE_USE_ACTIVE", __func__);
5608 + if ( vchiq_send_remote_use_active(state) != VCHIQ_SUCCESS)
5610 + BUG(); /* vc should be resumed, so shouldn't be a problem sending message */
5618 +vchiq_arm_init_state(VCHIQ_STATE_T* state, VCHIQ_ARM_STATE_T *arm_state)
5620 + VCHIQ_STATUS_T status = VCHIQ_SUCCESS;
5621 + VCOS_THREAD_ATTR_T attrs;
5622 + char threadname[10];
5626 + vcos_mutex_create(&arm_state->use_count_mutex, "v.use_count_mutex");
5627 + vcos_mutex_create(&arm_state->suspend_resume_mutex, "v.susp_res_mutex");
5629 + vcos_event_create(&arm_state->lp_evt, "LP_EVT");
5630 + vcos_event_create(&arm_state->hp_evt, "HP_EVT");
5632 + vcos_thread_attr_init(&attrs);
5633 + vcos_thread_attr_setstacksize(&attrs, VCHIQ_ARM_VCSUSPEND_TASK_STACK);
5634 + vcos_thread_attr_setpriority(&attrs, VCOS_THREAD_PRI_LOWEST);
5635 + vcos_snprintf(threadname, sizeof(threadname), "VCHIQl-%d", state->id);
5636 + if(vcos_thread_create(&arm_state->lp_thread, threadname, &attrs, lp_func, state) != VCOS_SUCCESS)
5638 + vcos_log_error("vchiq: FATAL: couldn't create thread %s", threadname);
5639 + status = VCHIQ_ERROR;
5643 + vcos_thread_attr_init(&attrs);
5644 + vcos_thread_attr_setstacksize(&attrs, VCHIQ_ARM_VCSUSPEND_TASK_STACK);
5645 + vcos_thread_attr_setpriority(&attrs, VCOS_THREAD_PRI_HIGHEST);
5646 + vcos_snprintf(threadname, sizeof(threadname), "VCHIQh-%d", state->id);
5648 + if(vcos_thread_create(&arm_state->hp_thread, threadname, &attrs, hp_func, state) != VCOS_SUCCESS)
5650 + vcos_log_error("vchiq: FATAL: couldn't create thread %s", threadname);
5651 + status = VCHIQ_ERROR;
5660 +vchiq_arm_vcsuspend(VCHIQ_STATE_T *state)
5662 + VCHIQ_STATUS_T status = VCHIQ_SUCCESS;
5663 + VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state);
5665 + if (state->conn_state != VCHIQ_CONNSTATE_CONNECTED)
5666 + return VCHIQ_ERROR;
5668 + if(arm_state->suspend_pending)
5670 + vcos_mutex_lock(&arm_state->suspend_resume_mutex);
5671 + if(arm_state->videocore_suspended)
5673 + vcos_log_info("%s - already suspended", __func__);
5677 + vcos_log_info("%s - suspending", __func__);
5679 + status = vchiq_platform_suspend(state);
5680 + arm_state->videocore_suspended = (status == VCHIQ_SUCCESS) ? 1 : 0;
5682 + vcos_mutex_unlock(&arm_state->suspend_resume_mutex);
5684 + vcos_mutex_lock(&arm_state->use_count_mutex);
5685 + if(!arm_state->suspend_pending)
5686 + { /* Something has changed the suspend_pending state while we were suspending.
5687 + Run the HP task to check if we need to resume */
5688 + vcos_log_info( "%s trigger HP task to check resume", __func__);
5689 + vcos_event_signal(&arm_state->hp_evt);
5691 + arm_state->suspend_pending = 0;
5692 + vcos_mutex_unlock(&arm_state->use_count_mutex);
5697 + vchiq_check_resume(state);
5704 +vchiq_arm_vcresume(VCHIQ_STATE_T *state)
5706 + VCHIQ_STATUS_T status = VCHIQ_SUCCESS;
5707 + VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state);
5708 + vcos_mutex_lock(&arm_state->suspend_resume_mutex);
5710 + status = vchiq_platform_resume(state);
5711 + arm_state->videocore_suspended = (status == VCHIQ_RETRY) ? 1 : 0;
5713 + vcos_mutex_unlock(&arm_state->suspend_resume_mutex);
5719 +vchiq_check_resume(VCHIQ_STATE_T* state)
5721 + VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state);
5722 + vcos_mutex_lock(&arm_state->use_count_mutex);
5724 + if (arm_state->videocore_suspended && vchiq_videocore_wanted(state))
5725 + { /* signal high priority task to resume vc */
5726 + vcos_event_signal(&arm_state->hp_evt);
5729 + vcos_mutex_unlock(&arm_state->use_count_mutex);
5733 +vchiq_check_suspend(VCHIQ_STATE_T* state)
5735 + VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state);
5737 + vcos_mutex_lock(&arm_state->use_count_mutex);
5739 + if (!arm_state->videocore_suspended && !vchiq_videocore_wanted(state))
5740 + { /* signal low priority task to suspend vc */
5741 + vcos_event_signal(&arm_state->lp_evt);
5744 + vcos_mutex_unlock(&arm_state->use_count_mutex);
5749 +static VCHIQ_STATUS_T
5750 +vchiq_use_internal(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service, int block_while_resume)
5752 + VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state);
5753 + VCHIQ_STATUS_T ret = VCHIQ_SUCCESS;
5759 + vcos_mutex_lock(&arm_state->use_count_mutex);
5763 + sprintf(entity, "%c%c%c%c:%03d",VCHIQ_FOURCC_AS_4CHARS(service->base.fourcc), service->client_id);
5764 + entity_uc = &service->service_use_count;
5768 + sprintf(entity, "PEER: ");
5769 + entity_uc = &arm_state->peer_use_count;
5772 + if (!arm_state->videocore_suspended && !vchiq_videocore_wanted(state))
5774 +#if VCOS_HAVE_TIMER
5775 + if (vchiq_platform_use_suspend_timer())
5777 + vcos_log_trace( "%s %s - cancel suspend timer", __func__, entity);
5779 + vcos_timer_cancel(&g_suspend_timer);
5783 + arm_state->videocore_use_count++;
5785 + arm_state->suspend_pending = 0;
5787 + if (arm_state->videocore_suspended && vchiq_videocore_wanted(state))
5789 + vcos_log_info( "%s %s count %d, state count %d", __func__, entity, *entity_uc, arm_state->videocore_use_count);
5790 + if(block_while_resume)
5792 + ret = vchiq_arm_vcresume(state);
5796 + vcos_log_info( "%s trigger HP task to do resume", __func__); /* triggering is done below */
5801 + vcos_log_trace( "%s %s count %d, state count %d", __func__, entity, *entity_uc, arm_state->videocore_use_count);
5803 + if(!block_while_resume)
5805 + arm_state->use_notify_pending++;
5806 + vcos_event_signal(&arm_state->hp_evt); /* hp task will check if we need to resume and also send use notify */
5809 + if (ret == VCHIQ_RETRY)
5810 + { /* if we're told to retry, decrement the counters. VCHIQ_ERROR probably means we're already resumed. */
5812 + arm_state->videocore_use_count--;
5815 + vcos_mutex_unlock(&arm_state->use_count_mutex);
5820 +static VCHIQ_STATUS_T
5821 +vchiq_release_internal(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service)
5823 + VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state);
5824 + VCHIQ_STATUS_T ret = VCHIQ_SUCCESS;
5830 + vcos_mutex_lock(&arm_state->use_count_mutex);
5834 + sprintf(entity, "%c%c%c%c:%03d",VCHIQ_FOURCC_AS_4CHARS(service->base.fourcc), service->client_id);
5835 + entity_uc = &service->service_use_count;
5839 + sprintf(entity, "PEER: ");
5840 + entity_uc = &arm_state->peer_use_count;
5843 + if (*entity_uc && arm_state->videocore_use_count)
5845 + arm_state->videocore_use_count--;
5848 + if (!vchiq_videocore_wanted(state))
5850 +#if VCOS_HAVE_TIMER
5851 + if (vchiq_platform_use_suspend_timer())
5853 + vcos_log_trace( "%s %s count %d, state count %d - starting suspend timer", __func__, entity, *entity_uc, arm_state->videocore_use_count);
5854 + vcos_timer_cancel(&g_suspend_timer);
5855 + vcos_timer_set(&g_suspend_timer, SUSPEND_TIMER_TIMEOUT_MS);
5860 + vcos_log_info( "%s %s count %d, state count %d - suspend pending", __func__, entity, *entity_uc, arm_state->videocore_use_count);
5861 + vcos_event_signal(&arm_state->lp_evt); /* kick the lp thread to do the suspend */
5866 + vcos_log_trace( "%s %s count %d, state count %d", __func__, entity, *entity_uc, arm_state->videocore_use_count);
5871 + vcos_log_error( "%s %s ERROR releasing service; count %d, state count %d", __func__, entity, *entity_uc, arm_state->videocore_use_count);
5872 + ret = VCHIQ_ERROR;
5875 + vcos_mutex_unlock(&arm_state->use_count_mutex);
5881 +vchiq_on_remote_use(VCHIQ_STATE_T *state)
5883 + vcos_log_info("%s state %p", __func__, state);
5884 + return state ? vchiq_use_internal(state, NULL, 0) : VCHIQ_ERROR;
5888 +vchiq_on_remote_release(VCHIQ_STATE_T *state)
5890 + vcos_log_info("%s state %p", __func__, state);
5891 + return state ? vchiq_release_internal(state, NULL) : VCHIQ_ERROR;
5895 +vchiq_use_service_internal(VCHIQ_SERVICE_T *service)
5897 + VCHIQ_STATE_T* state = NULL;
5901 + state = service->state;
5904 + if (!service || !state)
5906 + return VCHIQ_ERROR;
5908 + return vchiq_use_internal(state, service, 1);
5912 +vchiq_release_service_internal(VCHIQ_SERVICE_T *service)
5914 + VCHIQ_STATE_T* state = NULL;
5918 + state = service->state;
5921 + if (!service || !state)
5923 + return VCHIQ_ERROR;
5925 + return vchiq_release_internal(state, service);
5929 +#if VCOS_HAVE_TIMER
5930 +static void suspend_timer_callback(void* context)
5932 + VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state((VCHIQ_STATE_T*)context);
5933 + vcos_log_info( "%s - suspend pending", __func__);
5934 + vcos_event_signal(&arm_state->lp_evt);
5939 +vchiq_use_service(VCHIQ_SERVICE_HANDLE_T handle)
5941 + VCHIQ_STATUS_T ret = VCHIQ_ERROR;
5942 + VCHIQ_SERVICE_T *service = (VCHIQ_SERVICE_T *) handle;
5945 + ret = vchiq_use_service_internal(service);
5951 +vchiq_release_service(VCHIQ_SERVICE_HANDLE_T handle)
5953 + VCHIQ_STATUS_T ret = VCHIQ_ERROR;
5954 + VCHIQ_SERVICE_T *service = (VCHIQ_SERVICE_T *) handle;
5957 + ret = vchiq_release_service_internal(service);
5963 +vchiq_dump_service_use_state(VCHIQ_STATE_T *state)
5965 + VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state);
5969 + vcos_mutex_lock(&arm_state->suspend_resume_mutex);
5970 + if (arm_state->videocore_suspended)
5972 + vcos_log_warn("--VIDEOCORE SUSPENDED--");
5976 + vcos_log_warn("--VIDEOCORE AWAKE--");
5978 + for (i = 0; i < state->unused_service; i++) {
5979 + VCHIQ_SERVICE_T *service_ptr = state->services[i];
5980 + if (service_ptr && (service_ptr->srvstate != VCHIQ_SRVSTATE_FREE))
5982 + if (service_ptr->service_use_count)
5983 + vcos_log_error("----- %c%c%c%c:%d service count %d <-- preventing suspend", VCHIQ_FOURCC_AS_4CHARS(service_ptr->base.fourcc), service_ptr->client_id, service_ptr->service_use_count);
5985 + vcos_log_warn("----- %c%c%c%c:%d service count 0", VCHIQ_FOURCC_AS_4CHARS(service_ptr->base.fourcc), service_ptr->client_id);
5988 + vcos_log_warn("----- PEER use count count %d", arm_state->peer_use_count);
5989 + vcos_log_warn("--- Overall vchiq instance use count %d", arm_state->videocore_use_count);
5991 + vchiq_dump_platform_use_state(state);
5993 + vcos_mutex_unlock(&arm_state->suspend_resume_mutex);
5998 +vchiq_check_service(VCHIQ_SERVICE_T * service)
6000 + VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(service->state);
6001 + VCHIQ_STATUS_T ret = VCHIQ_ERROR;
6002 + /* on 2835 vchiq does not have an arm_state */
6004 + return VCHIQ_SUCCESS;
6005 + if (service && arm_state)
6007 + vcos_mutex_lock(&arm_state->use_count_mutex);
6008 + if (!service->service_use_count)
6010 + vcos_log_error( "%s ERROR - %c%c%c%c:%d service count %d, state count %d, videocore_suspended %d", __func__,VCHIQ_FOURCC_AS_4CHARS(service->base.fourcc), service->client_id, service->service_use_count, arm_state->videocore_use_count, arm_state->videocore_suspended);
6011 + vchiq_dump_service_use_state(service->state);
6012 + vcos_assert(0); // vcos_assert should kill the calling thread, so a user thread shouldn't be able to kill the kernel.
6016 + ret = VCHIQ_SUCCESS;
6018 + vcos_mutex_unlock(&arm_state->use_count_mutex);
6023 +/* stub functions */
6024 +void vchiq_on_remote_use_active(VCHIQ_STATE_T *state)
6026 + vcos_unused(state);
6029 +void vchiq_platform_conn_state_changed(VCHIQ_STATE_T *state, VCHIQ_CONNSTATE_T oldstate, VCHIQ_CONNSTATE_T newstate)
6031 + vcos_unused(state);
6032 + vcos_unused(oldstate);
6033 + vcos_unused(oldstate);
6037 /****************************************************************************
6039 * vchiq_init - called when the module is loaded.
6040 @@ -1250,6 +1865,10 @@ vchiq_init(void)
6042 goto failed_platform_init;
6044 +#if VCOS_HAVE_TIMER
6045 + vcos_timer_create( &g_suspend_timer, "suspend_timer", suspend_timer_callback, (void*)(&g_state));
6048 vcos_log_error("vchiq: initialised - version %d (min %d), device %d.%d",
6049 VCHIQ_VERSION, VCHIQ_VERSION_MIN,
6050 MAJOR(vchiq_devid), MINOR(vchiq_devid));
6051 --- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h
6052 +++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h
6055 #include "vchiq_core.h"
6058 +typedef struct vchiq_arm_state_struct {
6060 + VCOS_THREAD_T lp_thread; /* processes low priority messages (eg suspend) */
6061 + VCOS_THREAD_T hp_thread; /* processes high priority messages (eg resume) */
6063 + VCOS_EVENT_T lp_evt;
6064 + VCOS_EVENT_T hp_evt;
6066 + VCOS_MUTEX_T use_count_mutex;
6067 + VCOS_MUTEX_T suspend_resume_mutex;
6069 + int suspend_pending;
6071 + /* Global use count for videocore.
6072 + * This is equal to the sum of the use counts for all services. When this hits
6073 + * zero the videocore suspend procedure will be initiated. */
6074 + int videocore_use_count;
6076 + /* Use count to track requests from videocore peer.
6077 + * This use count is not associated with a service, so needs to be tracked separately
6080 + int peer_use_count;
6082 + /* Flag to indicate whether videocore is currently suspended */
6083 + int videocore_suspended;
6085 + /* Flag to indicate whether a notification is pending back to videocore that it's
6086 + * "remote use request" has been actioned */
6087 + int use_notify_pending;
6088 +} VCHIQ_ARM_STATE_T;
6091 extern VCOS_LOG_CAT_T vchiq_arm_log_category;
6094 @@ -35,4 +69,50 @@ vchiq_platform_exit(VCHIQ_STATE_T *state
6095 extern VCHIQ_STATE_T *
6096 vchiq_get_state(void);
6098 +extern VCHIQ_STATUS_T
6099 +vchiq_arm_vcsuspend(VCHIQ_STATE_T *state);
6101 +extern VCHIQ_STATUS_T
6102 +vchiq_arm_vcresume(VCHIQ_STATE_T *state);
6104 +extern VCHIQ_STATUS_T
6105 +vchiq_arm_init_state(VCHIQ_STATE_T *state, VCHIQ_ARM_STATE_T *arm_state);
6108 +vchiq_check_resume(VCHIQ_STATE_T* state);
6111 +vchiq_check_suspend(VCHIQ_STATE_T* state);
6113 +extern VCHIQ_STATUS_T
6114 +vchiq_use_service(VCHIQ_SERVICE_HANDLE_T handle);
6116 +extern VCHIQ_STATUS_T
6117 +vchiq_release_service(VCHIQ_SERVICE_HANDLE_T handle);
6119 +extern VCHIQ_STATUS_T
6120 +vchiq_check_service(VCHIQ_SERVICE_T * service);
6122 +extern VCHIQ_STATUS_T
6123 +vchiq_platform_suspend(VCHIQ_STATE_T *state);
6125 +extern VCHIQ_STATUS_T
6126 +vchiq_platform_resume(VCHIQ_STATE_T *state);
6129 +vchiq_platform_videocore_wanted(VCHIQ_STATE_T* state);
6132 +vchiq_platform_use_suspend_timer(void);
6135 +vchiq_dump_platform_use_state(VCHIQ_STATE_T *state);
6138 +vchiq_dump_service_use_state(VCHIQ_STATE_T *state);
6140 +extern VCHIQ_ARM_STATE_T*
6141 +vchiq_platform_get_arm_state(VCHIQ_STATE_T *state);
6144 #endif /* VCHIQ_ARM_H */
6145 --- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c
6146 +++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c
6149 #define BULK_INDEX(x) (x & (VCHIQ_NUM_SERVICE_BULKS - 1))
6152 +/* Used to check use counts allow vchiq use. */
6153 +extern VCHIQ_STATUS_T vchiq_check_service(VCHIQ_SERVICE_T * service);
6156 typedef struct bulk_waiter_struct
6159 @@ -114,6 +119,13 @@ vchiq_set_service_state(VCHIQ_SERVICE_T
6160 service->srvstate = newstate;
6164 +is_valid_service(VCHIQ_SERVICE_T *service)
6166 + return ((service != NULL) &&
6167 + (service->srvstate != VCHIQ_SRVSTATE_FREE));
6170 static inline VCHIQ_STATUS_T
6171 make_service_callback(VCHIQ_SERVICE_T *service, VCHIQ_REASON_T reason,
6172 VCHIQ_HEADER_T *header, void *bulk_userdata)
6173 @@ -127,10 +139,12 @@ make_service_callback(VCHIQ_SERVICE_T *s
6175 vchiq_set_conn_state(VCHIQ_STATE_T *state, VCHIQ_CONNSTATE_T newstate)
6177 + VCHIQ_CONNSTATE_T oldstate = state->conn_state;
6178 vcos_log_info("%d: %s->%s", state->id,
6179 - conn_state_names[state->conn_state],
6180 + conn_state_names[oldstate],
6181 conn_state_names[newstate]);
6182 state->conn_state = newstate;
6183 + vchiq_platform_conn_state_changed(state, oldstate, newstate);
6187 @@ -323,7 +337,7 @@ process_free_queue(VCHIQ_STATE_T *state)
6189 while (slot_queue_available != local->slot_queue_recycle)
6193 int slot_index = local->slot_queue[slot_queue_available++ & VCHIQ_SLOT_QUEUE_MASK];
6194 char *data = (char *)SLOT_DATA_FROM_INDEX(state, slot_index);
6196 @@ -343,17 +357,37 @@ process_free_queue(VCHIQ_STATE_T *state)
6197 if (VCHIQ_MSG_TYPE(msgid) == VCHIQ_MSG_DATA)
6199 int port = VCHIQ_MSG_SRCPORT(msgid);
6200 + VCHIQ_SERVICE_QUOTA_T *service_quota =
6201 + &state->service_quotas[port];
6203 + count = service_quota->message_use_count;
6206 + service_quota->message_use_count = count - 1;
6207 + if (count == service_quota->message_quota)
6209 + /* Signal the service that it has dropped below its quota */
6210 + vcos_event_signal(&service_quota->quota_event);
6215 + vcos_log_error("service %d message_use_count=%d (header %x,"
6216 + " msgid %x, header->msgid %x, header->size %x)",
6217 + port, service_quota->message_use_count,
6218 + (unsigned int)header, msgid, header->msgid,
6222 if (!BITSET_IS_SET(service_found, port))
6224 - VCHIQ_SERVICE_QUOTA_T *service_quota =
6225 - &state->service_quotas[port];
6227 /* Set the found bit for this service */
6228 BITSET_SET(service_found, port);
6230 - if (service_quota->slot_use_count > 0)
6231 + count = service_quota->slot_use_count;
6234 - service_quota->slot_use_count--;
6235 + service_quota->slot_use_count = count - 1;
6236 /* Signal the service in case it has dropped below its quota */
6237 vcos_event_signal(&service_quota->quota_event);
6238 vcos_log_trace("%d: pfq:%d %x@%x - slot_use->%d",
6239 @@ -376,7 +410,7 @@ process_free_queue(VCHIQ_STATE_T *state)
6240 pos += calc_stride(header->size);
6241 if (pos > VCHIQ_SLOT_SIZE)
6243 - vcos_log_error("pos %x: header %x, msgid %x, header->msgid %x, header->size %x",
6244 + vcos_log_error("pfq - pos %x: header %x, msgid %x, header->msgid %x, header->size %x",
6245 pos, (unsigned int)header, msgid, header->msgid, header->size);
6248 @@ -431,20 +465,21 @@ queue_message(VCHIQ_STATE_T *state, VCHI
6250 service_quota = &state->service_quotas[service->localport];
6252 - /* ...ensure it doesn't use more than its quota of slots */
6253 - while ((tx_end_index != service_quota->previous_tx_index) &&
6254 - (service_quota->slot_use_count == service_quota->slot_quota))
6255 + /* ...ensure it doesn't use more than its quota of messages or slots */
6256 + while ((service_quota->message_use_count == service_quota->message_quota) ||
6257 + ((tx_end_index != service_quota->previous_tx_index) &&
6258 + (service_quota->slot_use_count == service_quota->slot_quota)))
6260 - vcos_log_trace("%d: qm:%d %s,%x - quota stall",
6261 + vcos_log_trace("%d: qm:%d %s,%x - quota stall (msg %d, slot %d)",
6262 state->id, service->localport,
6263 - msg_type_str(VCHIQ_MSG_TYPE(msgid)), size);
6264 + msg_type_str(VCHIQ_MSG_TYPE(msgid)), size,
6265 + service_quota->message_use_count, service_quota->slot_use_count);
6266 VCHIQ_SERVICE_STATS_INC(service, quota_stalls);
6267 vcos_mutex_unlock(&state->slot_mutex);
6268 if (vcos_event_wait(&service_quota->quota_event) != VCOS_SUCCESS)
6270 if (vcos_mutex_lock(&state->slot_mutex) != VCOS_SUCCESS)
6272 - vcos_assert(service_quota->slot_use_count <= service_quota->slot_quota);
6273 tx_end_index = SLOT_QUEUE_INDEX_FROM_POS(state->local_tx_pos + stride - 1);
6276 @@ -498,6 +533,7 @@ queue_message(VCHIQ_STATE_T *state, VCHI
6279 service_quota->previous_tx_index = tx_end_index;
6280 + service_quota->message_use_count++;
6281 VCHIQ_SERVICE_STATS_INC(service, ctrl_tx_count);
6282 VCHIQ_SERVICE_STATS_ADD(service, ctrl_tx_bytes, size);
6284 @@ -1232,6 +1268,17 @@ parse_rx_slots(VCHIQ_STATE_T *state)
6285 vchiq_set_conn_state(state, VCHIQ_CONNSTATE_CONNECTED);
6286 vchiq_platform_resumed(state);
6289 + case VCHIQ_MSG_REMOTE_USE:
6290 + vchiq_on_remote_use(state);
6292 + case VCHIQ_MSG_REMOTE_RELEASE:
6293 + vchiq_on_remote_release(state);
6295 + case VCHIQ_MSG_REMOTE_USE_ACTIVE:
6296 + vchiq_on_remote_use_active(state);
6300 vcos_log_error("%d: prs invalid msgid %x@%x,%x",
6301 state->id, msgid, (unsigned int)header, size);
6302 @@ -1326,8 +1373,6 @@ slot_handler_func(void *v)
6306 -extern VCHIQ_STATUS_T
6307 -vchiq_platform_suspend(VCHIQ_STATE_T *state);
6309 /* Called by the recycle thread */
6311 @@ -1348,23 +1393,6 @@ recycle_func(void *v)
6315 -/* Called by the lp thread */
6319 - VCHIQ_STATE_T *state = (VCHIQ_STATE_T *) v;
6322 - vcos_event_wait(&state->lp_evt);
6323 - vcos_mutex_lock(&state->use_count_mutex);
6324 - if (state->videocore_use_count == 0)
6326 - vchiq_platform_suspend(state);
6328 - vcos_mutex_unlock(&state->use_count_mutex);
6334 init_bulk_queue(VCHIQ_BULK_QUEUE_T *queue)
6335 @@ -1417,6 +1445,7 @@ vchiq_init_state(VCHIQ_STATE_T *state, V
6336 VCHIQ_SHARED_STATE_T *local;
6337 VCHIQ_SHARED_STATE_T *remote;
6338 VCOS_THREAD_ATTR_T attrs;
6339 + VCHIQ_STATUS_T status;
6340 char threadname[10];
6343 @@ -1426,7 +1455,7 @@ vchiq_init_state(VCHIQ_STATE_T *state, V
6344 vcos_log_register("vchiq_core", &vchiq_core_log_category);
6345 vcos_log_register("vchiq_core_msg", &vchiq_core_msg_log_category);
6347 - vcos_log_warn( "%s: slot_zero = 0x%08lx, is_master = %d\n", __func__, (unsigned long)slot_zero, is_master );
6348 + vcos_log_warn( "%s: slot_zero = 0x%08lx, is_master = %d", __func__, (unsigned long)slot_zero, is_master );
6350 /* Check the input configuration */
6352 @@ -1501,6 +1530,7 @@ vchiq_init_state(VCHIQ_STATE_T *state, V
6355 memset(state, 0, sizeof(VCHIQ_STATE_T));
6356 + vcos_log_warn( "%s: called", __func__);
6358 state->is_master = is_master;
6360 @@ -1523,8 +1553,6 @@ vchiq_init_state(VCHIQ_STATE_T *state, V
6362 vcos_mutex_create(&state->slot_mutex, "v.slot_mutex");
6363 vcos_mutex_create(&state->recycle_mutex, "v.recycle_mutex");
6364 - vcos_mutex_create(&state->use_count_mutex, "v.use_count_mutex");
6365 - vcos_mutex_create(&state->suspend_resume_mutex, "v.susp_res_mutex");
6367 vcos_event_create(&state->slot_available_event, "v.slot_available_event");
6368 vcos_event_create(&state->slot_remove_event, "v.slot_remove_event");
6369 @@ -1543,6 +1571,7 @@ vchiq_init_state(VCHIQ_STATE_T *state, V
6372 state->default_slot_quota = state->slot_queue_available/2;
6373 + state->default_message_quota = vcos_min(state->default_slot_quota * 256, (unsigned short)~0);
6375 local->trigger.event = &state->trigger_event;
6376 remote_event_create(&local->trigger);
6377 @@ -1552,8 +1581,6 @@ vchiq_init_state(VCHIQ_STATE_T *state, V
6378 remote_event_create(&local->recycle);
6379 local->slot_queue_recycle = state->slot_queue_available;
6381 - vcos_event_create(&state->lp_evt, "LP_EVT");
6383 local->debug[DEBUG_ENTRIES] = DEBUG_MAX;
6386 @@ -1566,7 +1593,10 @@ vchiq_init_state(VCHIQ_STATE_T *state, V
6387 vcos_snprintf(threadname, sizeof(threadname), "VCHIQ-%d", state->id);
6388 if (vcos_thread_create(&state->slot_handler_thread, threadname,
6389 &attrs, slot_handler_func, state) != VCOS_SUCCESS)
6391 + vcos_log_error("vchiq: FATAL: couldn't create thread %s", threadname);
6395 vcos_thread_attr_init(&attrs);
6396 vcos_thread_attr_setstacksize(&attrs, VCHIQ_SLOT_HANDLER_STACK);
6397 @@ -1574,20 +1604,17 @@ vchiq_init_state(VCHIQ_STATE_T *state, V
6398 vcos_snprintf(threadname, sizeof(threadname), "VCHIQr-%d", state->id);
6399 if (vcos_thread_create(&state->recycle_thread, threadname,
6400 &attrs, recycle_func, state) != VCOS_SUCCESS)
6402 + vcos_log_error("vchiq: FATAL: couldn't create thread %s", threadname);
6406 - vcos_thread_attr_init(&attrs);
6407 - vcos_thread_attr_setstacksize(&attrs, VCHIQ_SLOT_HANDLER_STACK);
6408 - vcos_thread_attr_setpriority(&attrs, VCOS_THREAD_PRI_LOWEST);
6409 - vcos_snprintf(threadname, sizeof(threadname), "VCHIQl-%d", state->id);
6410 - if (vcos_thread_create(&state->lp_thread, threadname,
6411 - &attrs, lp_func, state) != VCOS_SUCCESS)
6412 - return VCHIQ_ERROR;
6413 + status = vchiq_platform_init_state(state);
6415 /* Indicate readiness to the other side */
6416 local->initialised = 1;
6418 - return VCHIQ_SUCCESS;
6422 /* Called from application thread when a client or server service is created. */
6423 @@ -1684,6 +1711,7 @@ vchiq_add_service_internal(VCHIQ_STATE_T
6424 init_bulk_queue(&service->bulk_tx);
6425 init_bulk_queue(&service->bulk_rx);
6426 service_quota->slot_quota = state->default_slot_quota;
6427 + service_quota->message_quota = state->default_message_quota;
6428 if (service_quota->slot_use_count == 0)
6429 service_quota->previous_tx_index =
6430 SLOT_QUEUE_INDEX_FROM_POS(state->local_tx_pos) - 1;
6431 @@ -1833,9 +1861,13 @@ vchiq_close_service_internal(VCHIQ_SERVI
6433 if (service->srvstate == VCHIQ_SRVSTATE_CLOSING)
6436 + int uc = service->service_use_count;
6437 /* Complete the close process */
6438 - vchiq_release_service(&service->base);
6440 + for( i=0; i<uc; i++)
6441 + { /* cater for cases where close is forced and the client may not close all it's handles */
6442 + vchiq_release_service_internal(service);
6444 service->client_id = 0;
6446 /* Now tell the client that the services is closed */
6447 @@ -1912,7 +1944,7 @@ vchiq_free_service_internal(VCHIQ_SERVIC
6448 if (slot_info->release_count != slot_info->use_count)
6450 char *data = (char *)SLOT_DATA_FROM_INDEX(state, i);
6452 + unsigned int pos, end;
6454 end = VCHIQ_SLOT_SIZE;
6455 if (data == state->rx_data)
6456 @@ -1938,6 +1970,12 @@ vchiq_free_service_internal(VCHIQ_SERVIC
6459 pos += calc_stride(header->size);
6460 + if (pos > VCHIQ_SLOT_SIZE)
6462 + vcos_log_error("fsi - pos %x: header %x, msgid %x, header->msgid %x, header->size %x",
6463 + pos, (unsigned int)header, msgid, header->msgid, header->size);
6469 @@ -2050,7 +2088,7 @@ vchiq_close_service(VCHIQ_SERVICE_HANDLE
6470 VCHIQ_SERVICE_T *service = (VCHIQ_SERVICE_T *) handle;
6471 VCHIQ_STATUS_T status = VCHIQ_ERROR;
6473 - if (service == NULL)
6474 + if (!is_valid_service(service))
6477 vcos_log_info("%d: close_service:%d", service->state->id, service->localport);
6478 @@ -2080,7 +2118,7 @@ vchiq_remove_service(VCHIQ_SERVICE_HANDL
6479 VCHIQ_SERVICE_T *service = (VCHIQ_SERVICE_T *) handle;
6480 VCHIQ_STATUS_T status = VCHIQ_SUCCESS;
6482 - if (service == NULL)
6483 + if (!is_valid_service(service))
6486 vcos_log_info("%d: remove_service:%d", service->state->id, service->localport);
6487 @@ -2137,15 +2175,14 @@ vchiq_bulk_transfer(VCHIQ_SERVICE_T *ser
6488 const int dir_msgtype = (dir == VCHIQ_BULK_TRANSMIT) ? VCHIQ_MSG_BULK_TX : VCHIQ_MSG_BULK_RX;
6489 VCHIQ_STATUS_T status = VCHIQ_ERROR;
6491 - if ((service == NULL) ||
6492 - ((memhandle == VCHI_MEM_HANDLE_INVALID) && (offset == NULL)))
6493 + if (!is_valid_service(service) ||
6494 + (service->srvstate != VCHIQ_SRVSTATE_OPEN) ||
6495 + ((memhandle == VCHI_MEM_HANDLE_INVALID) && (offset == NULL)) ||
6496 + (vchiq_check_service(service) != VCHIQ_SUCCESS))
6499 state = service->state;
6501 - if (service->srvstate != VCHIQ_SRVSTATE_OPEN)
6502 - return VCHIQ_ERROR; /* Must be connected */
6504 if (vcos_mutex_lock(&service->bulk_mutex) != VCOS_SUCCESS)
6507 @@ -2325,8 +2362,9 @@ vchiq_queue_message(VCHIQ_SERVICE_HANDLE
6508 unsigned int size = 0;
6511 - if ((service == NULL) ||
6512 - (service->srvstate != VCHIQ_SRVSTATE_OPEN))
6513 + if (!is_valid_service(service) ||
6514 + (service->srvstate != VCHIQ_SRVSTATE_OPEN) ||
6515 + (vchiq_check_service(service) != VCHIQ_SUCCESS))
6518 for (i = 0; i < (unsigned int)count; i++)
6519 @@ -2361,7 +2399,7 @@ vchiq_release_message(VCHIQ_SERVICE_HAND
6523 - if (service == NULL)
6524 + if (!is_valid_service(service))
6527 state = service->state;
6528 @@ -2418,7 +2456,7 @@ vchiq_set_service_option(VCHIQ_SERVICE_H
6529 VCHIQ_SERVICE_T *service = (VCHIQ_SERVICE_T *)handle;
6530 VCHIQ_STATUS_T status = VCHIQ_ERROR;
6533 + if (is_valid_service(service))
6537 @@ -2427,6 +2465,48 @@ vchiq_set_service_option(VCHIQ_SERVICE_H
6538 status = VCHIQ_SUCCESS;
6541 + case VCHIQ_SERVICE_OPTION_SLOT_QUOTA:
6543 + VCHIQ_SERVICE_QUOTA_T *service_quota =
6544 + &service->state->service_quotas[service->localport];
6546 + value = service->state->default_slot_quota;
6547 + if ((value >= service_quota->slot_use_count) &&
6548 + (value < (unsigned short)~0))
6550 + service_quota->slot_quota = value;
6551 + if ((value >= service_quota->slot_use_count) &&
6552 + (service_quota->message_quota >= service_quota->message_use_count))
6554 + /* Signal the service that it may have dropped below its quota */
6555 + vcos_event_signal(&service_quota->quota_event);
6557 + status = VCHIQ_SUCCESS;
6562 + case VCHIQ_SERVICE_OPTION_MESSAGE_QUOTA:
6564 + VCHIQ_SERVICE_QUOTA_T *service_quota =
6565 + &service->state->service_quotas[service->localport];
6567 + value = service->state->default_message_quota;
6568 + if ((value >= service_quota->message_use_count) &&
6569 + (value < (unsigned short)~0))
6571 + service_quota->message_quota = value;
6572 + if ((value >= service_quota->message_use_count) &&
6573 + (service_quota->slot_quota >= service_quota->slot_use_count))
6575 + /* Signal the service that it may have dropped below its quota */
6576 + vcos_event_signal(&service_quota->quota_event);
6578 + status = VCHIQ_SUCCESS;
6586 @@ -2568,9 +2648,11 @@ vchiq_dump_service_state(void *dump_cont
6587 vcos_strcpy(remoteport, "n/a");
6589 len += vcos_snprintf(buf + len, sizeof(buf) - len,
6590 - " '%c%c%c%c' remote %s (slot use %d/%d)",
6591 + " '%c%c%c%c' remote %s (msg use %d/%d, slot use %d/%d)",
6592 VCHIQ_FOURCC_AS_4CHARS(fourcc),
6594 + service_quota->message_use_count,
6595 + service_quota->message_quota,
6596 service_quota->slot_use_count,
6597 service_quota->slot_quota);
6599 @@ -2602,3 +2684,34 @@ vchiq_dump_service_state(void *dump_cont
6601 vchiq_dump_platform_service_state(dump_context, service);
6605 +VCHIQ_STATUS_T vchiq_send_remote_use(VCHIQ_STATE_T * state)
6607 + VCHIQ_STATUS_T status = VCHIQ_RETRY;
6608 + if(state->conn_state != VCHIQ_CONNSTATE_DISCONNECTED)
6610 + status = queue_message(state, NULL, VCHIQ_MAKE_MSG(VCHIQ_MSG_REMOTE_USE, 0, 0), NULL, 0, 0, 0);
6615 +VCHIQ_STATUS_T vchiq_send_remote_release(VCHIQ_STATE_T * state)
6617 + VCHIQ_STATUS_T status = VCHIQ_RETRY;
6618 + if(state->conn_state != VCHIQ_CONNSTATE_DISCONNECTED)
6620 + status = queue_message(state, NULL, VCHIQ_MAKE_MSG(VCHIQ_MSG_REMOTE_RELEASE, 0, 0), NULL, 0, 0, 0);
6625 +VCHIQ_STATUS_T vchiq_send_remote_use_active(VCHIQ_STATE_T * state)
6627 + VCHIQ_STATUS_T status = VCHIQ_RETRY;
6628 + if(state->conn_state != VCHIQ_CONNSTATE_DISCONNECTED)
6630 + status = queue_message(state, NULL, VCHIQ_MAKE_MSG(VCHIQ_MSG_REMOTE_USE_ACTIVE, 0, 0), NULL, 0, 0, 0);
6634 --- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h
6635 +++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h
6636 @@ -47,6 +47,9 @@ vcos_static_assert(IS_POW2(VCHIQ_MAX_SLO
6637 #define VCHIQ_MSG_BULK_TX_DONE 9 // + (srcport, dstport), actual
6638 #define VCHIQ_MSG_PAUSE 10 // -
6639 #define VCHIQ_MSG_RESUME 11 // -
6640 +#define VCHIQ_MSG_REMOTE_USE 12 // -
6641 +#define VCHIQ_MSG_REMOTE_RELEASE 13 // -
6642 +#define VCHIQ_MSG_REMOTE_USE_ACTIVE 14 // -
6644 #define VCHIQ_PORT_MAX (VCHIQ_MAX_SERVICES - 1)
6645 #define VCHIQ_PORT_FREE 0x1000
6646 @@ -194,6 +197,8 @@ typedef struct remote_event_struct {
6647 VCOS_EVENT_T * event;
6650 +typedef struct opaque_platform_state_t* VCHIQ_PLATFORM_STATE_T;
6652 typedef struct vchiq_state_struct VCHIQ_STATE_T;
6654 typedef struct vchiq_slot_struct {
6655 @@ -253,8 +258,10 @@ typedef struct vchiq_service_struct {
6656 usage is carried over between users of the same port number.
6658 typedef struct vchiq_service_quota_struct {
6660 - int slot_use_count;
6661 + unsigned short slot_quota;
6662 + unsigned short slot_use_count;
6663 + unsigned short message_quota;
6664 + unsigned short message_use_count;
6665 VCOS_EVENT_T quota_event;
6666 int previous_tx_index;
6667 } VCHIQ_SERVICE_QUOTA_T;
6668 @@ -314,7 +321,8 @@ struct vchiq_state_struct {
6669 VCHIQ_SHARED_STATE_T *remote;
6670 VCHIQ_SLOT_T *slot_data;
6672 - int default_slot_quota;
6673 + unsigned short default_slot_quota;
6674 + unsigned short default_message_quota;
6676 VCOS_EVENT_T connect; // event indicating connect message received
6677 VCOS_MUTEX_T mutex; // mutex protecting services
6678 @@ -322,7 +330,6 @@ struct vchiq_state_struct {
6680 VCOS_THREAD_T slot_handler_thread; // processes incoming messages
6681 VCOS_THREAD_T recycle_thread; // processes recycled slots
6682 - VCOS_THREAD_T lp_thread; // processes low priority messages (eg suspend)
6684 /* Local implementation of the trigger remote event */
6685 VCOS_EVENT_T trigger_event;
6686 @@ -330,8 +337,6 @@ struct vchiq_state_struct {
6687 /* Local implementation of the recycle remote event */
6688 VCOS_EVENT_T recycle_event;
6690 - VCOS_EVENT_T lp_evt;
6694 VCHIQ_SLOT_INFO_T *rx_info;
6695 @@ -340,17 +345,6 @@ struct vchiq_state_struct {
6697 VCOS_MUTEX_T recycle_mutex;
6699 - VCOS_MUTEX_T suspend_resume_mutex;
6700 - VCOS_MUTEX_T use_count_mutex;
6702 - /* Global use count for videocore.
6703 - * This is equal to the sum of the use counts for all services. When this hits
6704 - * zero the videocore suspend procedure will be initiated. */
6705 - int videocore_use_count;
6707 - /* Flag to indicate whether videocore is currently suspended */
6708 - int videocore_suspended;
6710 /* Indicates the byte position within the stream from where the next message
6711 will be read. The least significant bits are an index into the slot.
6712 The next bits are the index of the slot in remote->slot_queue. */
6713 @@ -388,6 +382,8 @@ struct vchiq_state_struct {
6714 VCHIQ_SERVICE_T *services[VCHIQ_MAX_SERVICES];
6715 VCHIQ_SERVICE_QUOTA_T service_quotas[VCHIQ_MAX_SERVICES];
6716 VCHIQ_SLOT_INFO_T slot_info[VCHIQ_MAX_SLOTS];
6718 + VCHIQ_PLATFORM_STATE_T platform_state;
6721 extern VCHIQ_SLOT_ZERO_T *
6722 @@ -477,4 +473,34 @@ extern void
6723 vchiq_dump_platform_service_state(void *dump_context,
6724 VCHIQ_SERVICE_T *service);
6726 +extern VCHIQ_STATUS_T
6727 +vchiq_use_service_internal(VCHIQ_SERVICE_T *service);
6729 +extern VCHIQ_STATUS_T
6730 +vchiq_release_service_internal(VCHIQ_SERVICE_T *service);
6732 +extern VCHIQ_STATUS_T
6733 +vchiq_on_remote_use(VCHIQ_STATE_T *state);
6735 +extern VCHIQ_STATUS_T
6736 +vchiq_on_remote_release(VCHIQ_STATE_T *state);
6738 +extern VCHIQ_STATUS_T
6739 +vchiq_platform_init_state(VCHIQ_STATE_T *state);
6742 +vchiq_on_remote_use_active(VCHIQ_STATE_T *state);
6744 +extern VCHIQ_STATUS_T
6745 +vchiq_send_remote_use(VCHIQ_STATE_T * state);
6747 +extern VCHIQ_STATUS_T
6748 +vchiq_send_remote_release(VCHIQ_STATE_T * state);
6750 +extern VCHIQ_STATUS_T
6751 +vchiq_send_remote_use_active(VCHIQ_STATE_T * state);
6754 +vchiq_platform_conn_state_changed(VCHIQ_STATE_T* state, VCHIQ_CONNSTATE_T oldstate, VCHIQ_CONNSTATE_T newstate);
6757 --- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h
6758 +++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h
6759 @@ -55,7 +55,9 @@ typedef enum
6763 - VCHIQ_SERVICE_OPTION_AUTOCLOSE
6764 + VCHIQ_SERVICE_OPTION_AUTOCLOSE,
6765 + VCHIQ_SERVICE_OPTION_SLOT_QUOTA,
6766 + VCHIQ_SERVICE_OPTION_MESSAGE_QUOTA
6767 } VCHIQ_SERVICE_OPTION_T;
6770 @@ -94,11 +96,11 @@ typedef struct vchiq_service_base_struct
6771 } VCHIQ_SERVICE_BASE_T;
6773 typedef struct vchiq_service_params_struct {
6775 - VCHIQ_CALLBACK_T callback;
6777 - short version; /* Increment for non-trivial changes */
6778 - short version_min; /* Update for incompatible changes */
6780 + VCHIQ_CALLBACK_T callback;
6782 + short version; /* Increment for non-trivial changes */
6783 + short version_min; /* Update for incompatible changes */
6784 } VCHIQ_SERVICE_PARAMS_T;
6786 typedef struct vchiq_config_struct {
6787 @@ -112,6 +114,8 @@ typedef struct vchiq_config_struct {
6790 typedef struct vchiq_instance_struct *VCHIQ_INSTANCE_T;
6791 +typedef void (*VCHIQ_REMOTE_USE_CALLBACK_T)(void* cb_arg);
6794 extern VCHIQ_STATUS_T vchiq_initialise(VCHIQ_INSTANCE_T *pinstance);
6795 extern VCHIQ_STATUS_T vchiq_shutdown(VCHIQ_INSTANCE_T instance);
6796 @@ -143,6 +147,9 @@ extern int vchiq_get_client_i
6797 extern VCHIQ_STATUS_T vchiq_get_config(VCHIQ_INSTANCE_T instance, int config_size, VCHIQ_CONFIG_T *pconfig);
6798 extern VCHIQ_STATUS_T vchiq_set_service_option(VCHIQ_SERVICE_HANDLE_T service, VCHIQ_SERVICE_OPTION_T option, int value);
6800 +extern VCHIQ_STATUS_T vchiq_remote_use(VCHIQ_INSTANCE_T instance, VCHIQ_REMOTE_USE_CALLBACK_T callback, void* cb_arg);
6801 +extern VCHIQ_STATUS_T vchiq_remote_release(VCHIQ_INSTANCE_T instance);
6803 extern VCHIQ_STATUS_T vchiq_dump_phys_mem( VCHIQ_SERVICE_HANDLE_T service, void *ptr, size_t num_bytes );
6805 #endif /* VCHIQ_IF_H */
6806 --- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h
6807 +++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h
6808 @@ -91,15 +91,15 @@ typedef struct {
6809 #define VCHIQ_IOC_QUEUE_MESSAGE _IOW(VCHIQ_IOC_MAGIC, 4, VCHIQ_QUEUE_MESSAGE_T)
6810 #define VCHIQ_IOC_QUEUE_BULK_TRANSMIT _IOW(VCHIQ_IOC_MAGIC, 5, VCHIQ_QUEUE_BULK_TRANSFER_T)
6811 #define VCHIQ_IOC_QUEUE_BULK_RECEIVE _IOW(VCHIQ_IOC_MAGIC, 6, VCHIQ_QUEUE_BULK_TRANSFER_T)
6812 -#define VCHIQ_IOC_AWAIT_COMPLETION _IOW(VCHIQ_IOC_MAGIC, 7, VCHIQ_AWAIT_COMPLETION_T)
6813 -#define VCHIQ_IOC_DEQUEUE_MESSAGE _IOW(VCHIQ_IOC_MAGIC, 8, VCHIQ_DEQUEUE_MESSAGE_T)
6814 +#define VCHIQ_IOC_AWAIT_COMPLETION _IOWR(VCHIQ_IOC_MAGIC, 7, VCHIQ_AWAIT_COMPLETION_T)
6815 +#define VCHIQ_IOC_DEQUEUE_MESSAGE _IOWR(VCHIQ_IOC_MAGIC, 8, VCHIQ_DEQUEUE_MESSAGE_T)
6816 #define VCHIQ_IOC_GET_CLIENT_ID _IO(VCHIQ_IOC_MAGIC, 9)
6817 -#define VCHIQ_IOC_GET_CONFIG _IOW(VCHIQ_IOC_MAGIC, 10, VCHIQ_GET_CONFIG_T)
6818 -#define VCHIQ_IOC_CLOSE_SERVICE _IO(VCHIQ_IOC_MAGIC, 11)
6819 -#define VCHIQ_IOC_USE_SERVICE _IO(VCHIQ_IOC_MAGIC, 12)
6820 -#define VCHIQ_IOC_RELEASE_SERVICE _IO(VCHIQ_IOC_MAGIC, 13)
6821 -#define VCHIQ_IOC_SET_SERVICE_OPTION _IOW(VCHIQ_IOC_MAGIC, 14, VCHIQ_SET_SERVICE_OPTION_T)
6822 -#define VCHIQ_IOC_DUMP_PHYS_MEM _IOW(VCHIQ_IOC_MAGIC, 15, VCHIQ_DUMP_MEM_T)
6823 +#define VCHIQ_IOC_GET_CONFIG _IOWR(VCHIQ_IOC_MAGIC, 10, VCHIQ_GET_CONFIG_T)
6824 +#define VCHIQ_IOC_CLOSE_SERVICE _IO(VCHIQ_IOC_MAGIC, 11)
6825 +#define VCHIQ_IOC_USE_SERVICE _IO(VCHIQ_IOC_MAGIC, 12)
6826 +#define VCHIQ_IOC_RELEASE_SERVICE _IO(VCHIQ_IOC_MAGIC, 13)
6827 +#define VCHIQ_IOC_SET_SERVICE_OPTION _IOW(VCHIQ_IOC_MAGIC, 14, VCHIQ_SET_SERVICE_OPTION_T)
6828 +#define VCHIQ_IOC_DUMP_PHYS_MEM _IOW(VCHIQ_IOC_MAGIC, 15, VCHIQ_DUMP_MEM_T)
6829 #define VCHIQ_IOC_MAX 15
6832 --- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib.c
6833 +++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib.c
6834 @@ -97,6 +97,12 @@ is_valid_instance(VCHIQ_INSTANCE_T insta
6835 return (instance == &vchiq_instance) && (instance->initialised > 0);
6838 +static __inline int
6839 +is_valid_service(VCHIQ_SERVICE_T *service)
6841 + return ((service != NULL) && (service->fd != VCHIQ_INVALID_HANDLE));
6847 @@ -318,6 +324,9 @@ vchiq_close_service(VCHIQ_SERVICE_HANDLE
6849 vcos_log_trace( "%s called service handle = 0x%08x", __func__, (uint32_t)handle );
6851 + if (!is_valid_service(service))
6852 + return VCHIQ_ERROR;
6854 RETRY(ret,ioctl(service->fd, VCHIQ_IOC_CLOSE_SERVICE, service->handle));
6857 @@ -335,6 +344,9 @@ vchiq_remove_service(VCHIQ_SERVICE_HANDL
6859 vcos_log_trace( "%s called service handle = 0x%08x", __func__, (uint32_t)handle );
6861 + if (!is_valid_service(service))
6862 + return VCHIQ_ERROR;
6864 RETRY(ret,ioctl(service->fd, VCHIQ_IOC_REMOVE_SERVICE, service->handle));
6867 @@ -355,6 +367,9 @@ vchiq_queue_message(VCHIQ_SERVICE_HANDLE
6869 vcos_log_trace( "%s called service handle = 0x%08x", __func__, (uint32_t)handle );
6871 + if (!is_valid_service(service))
6872 + return VCHIQ_ERROR;
6874 args.handle = service->handle;
6875 args.elements = elements;
6877 @@ -384,6 +399,9 @@ vchiq_queue_bulk_transmit(VCHIQ_SERVICE_
6879 vcos_log_trace( "%s called service handle = 0x%08x", __func__, (uint32_t)handle );
6881 + if (!is_valid_service(service))
6882 + return VCHIQ_ERROR;
6884 args.handle = service->handle;
6885 args.data = (void *)data;
6887 @@ -406,6 +424,9 @@ vchiq_queue_bulk_receive(VCHIQ_SERVICE_H
6889 vcos_log_trace( "%s called service handle = 0x%08x", __func__, (uint32_t)handle );
6891 + if (!is_valid_service(service))
6892 + return VCHIQ_ERROR;
6894 args.handle = service->handle;
6897 @@ -457,6 +478,9 @@ vchiq_bulk_transmit(VCHIQ_SERVICE_HANDLE
6899 vcos_log_trace( "%s called service handle = 0x%08x", __func__, (uint32_t)handle );
6901 + if (!is_valid_service(service))
6902 + return VCHIQ_ERROR;
6904 args.handle = service->handle;
6905 args.data = (void *)data;
6907 @@ -480,6 +504,9 @@ vchiq_bulk_receive(VCHIQ_SERVICE_HANDLE_
6909 vcos_log_trace( "%s called service handle = 0x%08x", __func__, (uint32_t)handle );
6911 + if (!is_valid_service(service))
6912 + return VCHIQ_ERROR;
6914 args.handle = service->handle;
6917 @@ -521,6 +548,9 @@ vchiq_get_client_id(VCHIQ_SERVICE_HANDLE
6919 VCHIQ_SERVICE_T *service = (VCHIQ_SERVICE_T *)handle;
6921 + if (!is_valid_service(service))
6922 + return VCHIQ_ERROR;
6924 return ioctl(service->fd, VCHIQ_IOC_GET_CLIENT_ID, service->handle);
6927 @@ -546,10 +576,14 @@ vchiq_get_config(VCHIQ_INSTANCE_T instan
6929 vchiq_use_service( const VCHIQ_SERVICE_HANDLE_T handle )
6931 - VCHIQ_SERVICE_T *service = (VCHIQ_SERVICE_T *)handle;
6933 - RETRY(ret,ioctl(service->fd, VCHIQ_IOC_USE_SERVICE, service->handle));
6935 + VCHIQ_SERVICE_T *service = (VCHIQ_SERVICE_T *)handle;
6938 + if (!is_valid_service(service))
6939 + return VCHIQ_ERROR;
6941 + RETRY(ret,ioctl(service->fd, VCHIQ_IOC_USE_SERVICE, service->handle));
6946 @@ -569,6 +603,9 @@ vchiq_set_service_option(VCHIQ_SERVICE_H
6947 VCHIQ_SERVICE_T *service = (VCHIQ_SERVICE_T *)handle;
6950 + if (!is_valid_service(service))
6951 + return VCHIQ_ERROR;
6953 args.handle = service->handle;
6954 args.option = option;
6956 @@ -633,6 +670,9 @@ vchi_msg_peek( VCHI_SERVICE_HANDLE_T han
6957 VCHI_SERVICE_T *service = (VCHI_SERVICE_T *)handle;
6960 + if (!is_valid_service(service))
6961 + return VCHIQ_ERROR;
6963 ret = fill_peek_buf(service, flags);
6966 @@ -659,6 +699,9 @@ vchi_msg_remove( VCHI_SERVICE_HANDLE_T h
6968 VCHI_SERVICE_T *service = (VCHI_SERVICE_T *)handle;
6970 + if (!is_valid_service(service))
6971 + return VCHIQ_ERROR;
6973 /* Why would you call vchi_msg_remove without calling vchi_msg_peek first? */
6974 vcos_assert(service->peek_size >= 0);
6976 @@ -697,6 +740,9 @@ vchi_msg_queue( VCHI_SERVICE_HANDLE_T ha
6977 vcos_unused(msg_handle);
6978 vcos_assert(flags == VCHI_FLAGS_BLOCK_UNTIL_QUEUED);
6980 + if (!is_valid_service(service))
6981 + return VCHIQ_ERROR;
6983 args.handle = service->handle;
6984 args.elements = &element;
6986 @@ -730,6 +776,9 @@ vchi_bulk_queue_receive( VCHI_SERVICE_HA
6987 VCHIQ_QUEUE_BULK_TRANSFER_T args;
6990 + if (!is_valid_service(service))
6991 + return VCHIQ_ERROR;
6993 switch ((int)flags) {
6994 case VCHI_FLAGS_CALLBACK_WHEN_OP_COMPLETE | VCHI_FLAGS_BLOCK_UNTIL_QUEUED:
6995 args.mode = VCHIQ_BULK_MODE_CALLBACK;
6996 @@ -780,6 +829,9 @@ vchi_bulk_queue_transmit( VCHI_SERVICE_H
6997 VCHIQ_QUEUE_BULK_TRANSFER_T args;
7000 + if (!is_valid_service(service))
7001 + return VCHIQ_ERROR;
7003 switch ((int)flags) {
7004 case VCHI_FLAGS_CALLBACK_WHEN_OP_COMPLETE | VCHI_FLAGS_BLOCK_UNTIL_QUEUED:
7005 args.mode = VCHIQ_BULK_MODE_CALLBACK;
7006 @@ -833,6 +885,9 @@ vchi_msg_dequeue( VCHI_SERVICE_HANDLE_T
7008 vcos_assert(flags == VCHI_FLAGS_NONE || flags == VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE);
7010 + if (!is_valid_service(service))
7011 + return VCHIQ_ERROR;
7013 if (service->peek_size >= 0)
7015 fprintf(stderr, "vchi_msg_dequeue -> using peek buffer\n");
7016 @@ -903,6 +958,9 @@ vchi_msg_queuev( VCHI_SERVICE_HANDLE_T h
7018 vcos_assert(flags == VCHI_FLAGS_BLOCK_UNTIL_QUEUED);
7020 + if (!is_valid_service(service))
7021 + return VCHIQ_ERROR;
7023 args.handle = service->handle;
7024 args.elements = (const VCHIQ_ELEMENT_T *)vector;
7026 @@ -961,6 +1019,9 @@ vchi_msg_hold( VCHI_SERVICE_HANDLE_T han
7027 VCHI_SERVICE_T *service = (VCHI_SERVICE_T *)handle;
7030 + if (!is_valid_service(service))
7031 + return VCHIQ_ERROR;
7033 ret = fill_peek_buf(service, flags);
7036 @@ -1116,6 +1177,10 @@ vchi_service_close( const VCHI_SERVICE_H
7038 VCHI_SERVICE_T *service = (VCHI_SERVICE_T *)handle;
7041 + if (!is_valid_service(service))
7042 + return VCHIQ_ERROR;
7044 RETRY(ret,ioctl(service->fd, VCHIQ_IOC_REMOVE_SERVICE, service->handle));
7047 @@ -1129,6 +1194,10 @@ vchi_service_destroy( const VCHI_SERVICE
7049 VCHI_SERVICE_T *service = (VCHI_SERVICE_T *)handle;
7052 + if (!is_valid_service(service))
7053 + return VCHIQ_ERROR;
7055 RETRY(ret,ioctl(service->fd, VCHIQ_IOC_REMOVE_SERVICE, service->handle));
7058 @@ -1200,6 +1269,10 @@ vchi_service_use( const VCHI_SERVICE_HAN
7060 VCHI_SERVICE_T *service = (VCHI_SERVICE_T *)handle;
7063 + if (!is_valid_service(service))
7064 + return VCHIQ_ERROR;
7066 RETRY(ret,ioctl(service->fd, VCHIQ_IOC_USE_SERVICE, service->handle));
7069 @@ -1218,10 +1291,47 @@ int32_t vchi_service_release( const VCHI
7071 VCHI_SERVICE_T *service = (VCHI_SERVICE_T *)handle;
7074 + if (!is_valid_service(service))
7075 + return VCHIQ_ERROR;
7077 RETRY(ret,ioctl(service->fd, VCHIQ_IOC_RELEASE_SERVICE, service->handle));
7081 +/***********************************************************
7082 + * Name: vchiq_dump_phys_mem
7084 + * Arguments: const VCHI_SERVICE_HANDLE_T handle
7086 + * size_t num_bytes
7088 + * Description: Dumps the physical memory associated with
7093 + ***********************************************************/
7094 +VCHIQ_STATUS_T vchiq_dump_phys_mem( VCHIQ_SERVICE_HANDLE_T handle,
7096 + size_t num_bytes )
7098 + VCHIQ_SERVICE_T *service = (VCHIQ_SERVICE_T *)handle;
7099 + VCHIQ_DUMP_MEM_T dump_mem;
7102 + if (!is_valid_service(service))
7103 + return VCHIQ_ERROR;
7105 + dump_mem.virt_addr = ptr;
7106 + dump_mem.num_bytes = num_bytes;
7108 + RETRY(ret,ioctl(service->fd, VCHIQ_IOC_DUMP_PHYS_MEM, &dump_mem));
7109 + return (ret >= 0) ? VCHIQ_SUCCESS : VCHIQ_ERROR;
7117 --- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c
7118 +++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c
7119 @@ -859,10 +859,38 @@ int32_t vchi_service_create( VCHI_INSTAN
7121 int32_t vchi_service_close( const VCHI_SERVICE_HANDLE_T handle )
7123 - vcos_unused(handle);
7125 + SHIM_SERVICE_T *service = (SHIM_SERVICE_T *)handle;
7128 + VCHIQ_STATUS_T status = vchiq_close_service(service->handle);
7129 + if (status == VCHIQ_SUCCESS)
7131 + service_free(service);
7135 + ret = vchiq_status_to_vchi( status );
7142 +int32_t vchi_service_destroy( const VCHI_SERVICE_HANDLE_T handle )
7145 + SHIM_SERVICE_T *service = (SHIM_SERVICE_T *)handle;
7148 + VCHIQ_STATUS_T status = vchiq_remove_service(service->handle);
7149 + if (status == VCHIQ_SUCCESS)
7151 + service_free(service);
7155 + ret = vchiq_status_to_vchi( status );
7160 /* ----------------------------------------------------------------------
7161 @@ -962,9 +990,12 @@ EXPORT_SYMBOL(vchi_bulk_queue_transmit);
7162 EXPORT_SYMBOL(vchi_msg_dequeue);
7163 EXPORT_SYMBOL(vchi_msg_queue);
7164 EXPORT_SYMBOL(vchi_msg_queuev);
7165 +EXPORT_SYMBOL(vchi_msg_peek);
7166 +EXPORT_SYMBOL(vchi_msg_remove);
7167 EXPORT_SYMBOL(vchi_service_close);
7168 EXPORT_SYMBOL(vchi_service_open);
7169 EXPORT_SYMBOL(vchi_service_create);
7170 +EXPORT_SYMBOL(vchi_service_destroy);
7171 EXPORT_SYMBOL(vchi_service_use);
7172 EXPORT_SYMBOL(vchi_service_release);
7174 --- a/drivers/mmc/host/sdhci-bcm2708.c
7175 +++ b/drivers/mmc/host/sdhci-bcm2708.c
7177 #include <linux/highmem.h>
7178 #include <linux/platform_device.h>
7179 #include <linux/module.h>
7180 +#include <linux/mmc/mmc.h>
7181 #include <linux/mmc/host.h>
7182 +#include <linux/mmc/sd.h>
7184 #include <linux/io.h>
7185 #include <linux/dma-mapping.h>
7187 //#define LOG_REGISTERS
7189 #define USE_SCHED_TIME
7190 +#define USE_SPACED_WRITES_2CLK 1 /* space consecutive register writes */
7191 +#define USE_SOFTWARE_TIMEOUTS 1 /* not hardware timeouts */
7192 +#define SOFTWARE_ERASE_TIMEOUT_SEC 30
7194 #define SDHCI_BCM_DMA_CHAN 4 /* this default is normally overriden */
7195 #define SDHCI_BCM_DMA_WAITS 0 /* delays slowing DMA transfers: 0-31 */
7198 #define BCM2708_SDHCI_SLEEP_TIMEOUT 1000 /* msecs */
7200 +/* Mhz clock that the EMMC core is running at. Should match the platform clockman settings */
7201 +#define BCM2708_EMMC_CLOCK_FREQ 80000000
7204 #define POWER_LAZY_OFF 1
7206 @@ -222,6 +230,12 @@ u8 sdhci_bcm2708_readb(struct sdhci_host
7208 static void sdhci_bcm2708_raw_writel(struct sdhci_host *host, u32 val, int reg)
7212 +#if USE_SPACED_WRITES_2CLK
7213 + static bool timeout_disabled = false;
7214 + unsigned int ns_2clk = 0;
7216 /* The Arasan has a bugette whereby it may lose the content of
7217 * successive writes to registers that are within two SD-card clock
7218 * cycles of each other (a clock domain crossing problem).
7219 @@ -229,12 +243,11 @@ static void sdhci_bcm2708_raw_writel(str
7220 * (Which is just as well - otherwise we'd have to nobble the DMA engine
7224 if (reg != SDHCI_BUFFER && host->clock != 0) {
7225 /* host->clock is the clock freq in Hz */
7226 static hptime_t last_write_hpt;
7227 hptime_t now = hptime();
7228 - unsigned int ns_2clk = 2000000000/host->clock;
7229 + ns_2clk = 2000000000/host->clock;
7231 if (now == last_write_hpt || now == last_write_hpt+1) {
7232 /* we can't guarantee any significant time has
7233 @@ -250,6 +263,27 @@ static void sdhci_bcm2708_raw_writel(str
7235 last_write_hpt = now;
7237 +#if USE_SOFTWARE_TIMEOUTS
7238 + /* The Arasan is clocked for timeouts using the SD clock which is too
7239 + * fast for ERASE commands and causes issues. So we disable timeouts
7241 + if (host->cmd != NULL && host->cmd->opcode == MMC_ERASE &&
7242 + reg == (SDHCI_COMMAND & ~3)) {
7243 + mod_timer(&host->timer,
7244 + jiffies + SOFTWARE_ERASE_TIMEOUT_SEC * HZ);
7245 + ier = readl(host->ioaddr + SDHCI_SIGNAL_ENABLE);
7246 + ier &= ~SDHCI_INT_DATA_TIMEOUT;
7247 + writel(ier, host->ioaddr + SDHCI_SIGNAL_ENABLE);
7248 + timeout_disabled = true;
7249 + udelay((ns_2clk+1000-1)/1000);
7250 + } else if (timeout_disabled) {
7251 + ier = readl(host->ioaddr + SDHCI_SIGNAL_ENABLE);
7252 + ier |= SDHCI_INT_DATA_TIMEOUT;
7253 + writel(ier, host->ioaddr + SDHCI_SIGNAL_ENABLE);
7254 + timeout_disabled = false;
7255 + udelay((ns_2clk+1000-1)/1000);
7258 writel(val, host->ioaddr + reg);
7260 void __iomem * regaddr = host->ioaddr + reg;
7261 @@ -325,14 +359,68 @@ void sdhci_bcm2708_writeb(struct sdhci_h
7263 static unsigned int sdhci_bcm2708_get_max_clock(struct sdhci_host *host)
7265 - return 100000000; // this value is in Hz (100MHz/4)
7266 + return 20000000; // this value is in Hz (20MHz)
7269 static unsigned int sdhci_bcm2708_get_timeout_clock(struct sdhci_host *host)
7271 - return 100000; // this value is in kHz (100MHz/4)
7273 + return (host->clock / 1000); // this value is in kHz (100MHz)
7275 + return (sdhci_bcm2708_get_max_clock(host) / 1000);
7278 +static void sdhci_bcm2708_set_clock(struct sdhci_host *host, unsigned int clock)
7282 + unsigned long timeout;
7284 + if (clock == host->clock)
7287 + sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
7292 + if (BCM2708_EMMC_CLOCK_FREQ <= clock)
7295 + for (div = 2; div < SDHCI_MAX_DIV_SPEC_300; div += 2) {
7296 + if ((BCM2708_EMMC_CLOCK_FREQ / div) <= clock)
7301 + DBG( "desired SD clock: %d, actual: %d\n",
7302 + clock, BCM2708_EMMC_CLOCK_FREQ / div);
7304 + clk |= (div & SDHCI_DIV_MASK) << SDHCI_DIVIDER_SHIFT;
7305 + clk |= ((div & SDHCI_DIV_HI_MASK) >> SDHCI_DIV_MASK_LEN)
7306 + << SDHCI_DIVIDER_HI_SHIFT;
7307 + clk |= SDHCI_CLOCK_INT_EN;
7309 + sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
7312 + while (!((clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL))
7313 + & SDHCI_CLOCK_INT_STABLE)) {
7314 + if (timeout == 0) {
7315 + printk(KERN_ERR "%s: Internal clock never "
7316 + "stabilised.\n", mmc_hostname(host->mmc));
7323 + clk |= SDHCI_CLOCK_CARD_EN;
7324 + sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
7326 + host->clock = clock;
7329 /*****************************************************************************\
7332 @@ -429,7 +517,8 @@ static void schci_bcm2708_cb_read(struct
7336 - cb->info |= BCM2708_DMA_INT_EN;
7337 + cb->info |= BCM2708_DMA_INT_EN |
7338 + BCM2708_DMA_WAIT_RESP;
7341 cb->next = host->cb_handle +
7342 @@ -460,7 +549,8 @@ static void schci_bcm2708_cb_write(struc
7346 - cb->info |= BCM2708_DMA_INT_EN;
7347 + cb->info |= BCM2708_DMA_INT_EN |
7348 + BCM2708_DMA_WAIT_RESP;
7351 cb->next = host->cb_handle +
7352 @@ -806,8 +896,7 @@ static void sdhci_bcm2708_dma_complete_i
7353 We get CRC and DEND errors unless we wait for
7354 the SD controller to finish reading/writing to the card. */
7356 - int timeout=1000000;
7357 - hptime_t now = hptime();
7360 DBG("PDMA over - sync card\n");
7361 if (data->flags & MMC_DATA_READ)
7362 @@ -815,17 +904,12 @@ static void sdhci_bcm2708_dma_complete_i
7364 state_mask = SDHCI_DOING_WRITE;
7366 - while (0 != (sdhci_bcm2708_raw_readl(host,
7367 - SDHCI_PRESENT_STATE) &
7368 - state_mask) && --timeout > 0)
7369 + while (0 != (sdhci_bcm2708_raw_readl(host, SDHCI_PRESENT_STATE)
7370 + & state_mask) && --timeout > 0)
7375 - if (1000000-timeout > 4000) /*ave. is about 3250*/
7376 - printk(KERN_INFO "%s: note - long %s sync %luns - "
7378 - mmc_hostname(host->mmc),
7379 - data->flags & MMC_DATA_READ? "read": "write",
7380 - since_ns(now), 1000000-timeout);
7383 printk(KERN_ERR"%s: final %s to SD card still "
7385 @@ -1201,6 +1285,11 @@ static unsigned int sdhci_bcm2708_uhs_br
7389 +static unsigned int sdhci_bcm2708_missing_status(struct sdhci_host *host)
7394 /***************************************************************************** \
7397 @@ -1219,7 +1308,7 @@ static struct sdhci_ops sdhci_bcm2708_op
7398 #error The BCM2708 SDHCI driver needs CONFIG_MMC_SDHCI_IO_ACCESSORS to be set
7400 //.enable_dma = NULL,
7401 - //.set_clock = NULL,
7402 + .set_clock = sdhci_bcm2708_set_clock,
7403 .get_max_clock = sdhci_bcm2708_get_max_clock,
7404 //.get_min_clock = NULL,
7405 .get_timeout_clock = sdhci_bcm2708_get_timeout_clock,
7406 @@ -1238,6 +1327,7 @@ static struct sdhci_ops sdhci_bcm2708_op
7407 .spurious_crc_acmd51 = sdhci_bcm2708_quirk_spurious_crc,
7408 .voltage_broken = sdhci_bcm2708_quirk_voltage_broken,
7409 .uhs_broken = sdhci_bcm2708_uhs_broken,
7410 + .missing_status = sdhci_bcm2708_missing_status,
7413 /*****************************************************************************\
7414 @@ -1282,7 +1372,9 @@ static int __devinit sdhci_bcm2708_probe
7415 host->irq = platform_get_irq(pdev, 0);
7417 host->quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION |
7418 - SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK;
7419 + SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
7420 + SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
7421 + SDHCI_QUIRK_NONSTANDARD_CLOCK;
7422 #ifdef CONFIG_MMC_SDHCI_BCM2708_DMA
7423 host->flags = SDHCI_USE_PLATDMA;
7425 @@ -1349,6 +1441,8 @@ static int __devinit sdhci_bcm2708_probe
7426 host_priv->cb_base, (unsigned)host_priv->cb_handle,
7427 host_priv->dma_chan, host_priv->dma_chan_base,
7428 host_priv->dma_irq);
7430 + host->mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
7433 ret = sdhci_add_host(host);
7434 --- a/drivers/mmc/host/sdhci.c
7435 +++ b/drivers/mmc/host/sdhci.c
7436 @@ -974,6 +974,12 @@ static void sdhci_send_command(struct sd
7437 if ((cmd->data != NULL) || (cmd->flags & MMC_RSP_BUSY))
7438 mask |= SDHCI_DATA_INHIBIT;
7440 + if(host->ops->missing_status && (cmd->opcode == MMC_SEND_STATUS)) {
7441 + timeout = 5000; // Really obscenely large delay to send the status, due to bug in controller
7442 + // which might cause the STATUS command to get stuck when a data operation is in flow
7443 + mask |= SDHCI_DATA_INHIBIT;
7446 /* We shouldn't wait for data inihibit for stop commands, even
7447 though they might use busy signaling */
7448 if (host->mrq->data && (cmd == host->mrq->data->stop))
7449 @@ -2098,7 +2104,7 @@ static void sdhci_timeout_timer(unsigned
7452 pr_err("%s: Timeout waiting for hardware "
7453 - "interrupt.\n", mmc_hostname(host->mmc));
7454 + "interrupt - cmd%d.\n", mmc_hostname(host->mmc), host->last_cmdop);
7455 sdhci_dumpregs(host);
7458 @@ -3065,8 +3071,11 @@ int sdhci_add_host(struct sdhci_host *ho
7459 mmc->caps |= MMC_CAP_MAX_CURRENT_200;
7462 - if(host->ops->voltage_broken)
7463 - ocr_avail |= MMC_VDD_29_30 | MMC_VDD_30_31;
7464 + if(host->ops->voltage_broken) {
7465 + ocr_avail |= MMC_VDD_32_33 | MMC_VDD_33_34;
7466 + // Cannot support UHS modes is we are stuck at 3.3V;
7467 + mmc->caps &= ~(MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50);
7470 mmc->ocr_avail = ocr_avail;
7471 mmc->ocr_avail_sdio = ocr_avail;
7472 --- a/drivers/mmc/host/sdhci.h
7473 +++ b/drivers/mmc/host/sdhci.h
7474 @@ -291,6 +291,7 @@ struct sdhci_ops {
7475 unsigned int (*spurious_crc_acmd51)(struct sdhci_host *host);
7476 unsigned int (*voltage_broken)(struct sdhci_host *host);
7477 unsigned int (*uhs_broken)(struct sdhci_host *host);
7478 + unsigned int (*missing_status)(struct sdhci_host *host);
7480 void (*hw_reset)(struct sdhci_host *host);
7482 --- a/drivers/net/usb/smsc95xx.c
7483 +++ b/drivers/net/usb/smsc95xx.c
7484 @@ -1073,6 +1073,7 @@ static int smsc95xx_bind(struct usbnet *
7485 dev->net->ethtool_ops = &smsc95xx_ethtool_ops;
7486 dev->net->flags |= IFF_MULTICAST;
7487 dev->net->hard_header_len += SMSC95XX_TX_OVERHEAD_CSUM;
7488 + dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
7492 --- a/drivers/usb/gadget/Kconfig
7493 +++ b/drivers/usb/gadget/Kconfig
7494 @@ -536,28 +536,6 @@ config USB_GADGET_SUPERSPEED
7496 depends on USB_GADGET_DUALSPEED
7498 -config USB_GADGET_SNPS_DWC_OTG
7499 - boolean "Synopsys Driver for DWC_otg Controller"
7500 - depends on USB && EXPERIMENTAL
7502 - select USB_GADGET_DUALSPEED
7504 - Selects the Synopsys Driver for the DWC_otg Controller.
7506 -config USB_DWC_OTG_LPM
7507 - boolean "Enable LPM support"
7508 - depends on USB && EXPERIMENTAL
7510 - Enables LPM support.
7512 -config USB_GADGET_SNPS_DWC_OTG
7513 - boolean "Synopsys Driver for DWC_otg Controller"
7514 - depends on USB && EXPERIMENTAL
7516 - select USB_GADGET_DUALSPEED
7518 - Selects the Synopsys Driver for the DWC_otg Controller.
7520 config USB_DWC_OTG_LPM
7521 boolean "Enable LPM support"
7522 depends on USB && EXPERIMENTAL
7523 --- a/drivers/usb/host/dwc_common_port/Makefile
7524 +++ b/drivers/usb/host/dwc_common_port/Makefile
7525 @@ -6,7 +6,9 @@ ifneq ($(KERNELRELEASE),)
7527 #CPPFLAGS += -DDEBUG_MEMORY
7529 +ifeq ($(CONFIG_USB_DEBUG),y)
7532 CPPFLAGS += -DDWC_LINUX
7534 obj-$(CONFIG_USB_DWCOTG) += dwc_common_port_lib.o
7535 --- a/drivers/usb/host/dwc_common_port/dwc_os.h
7536 +++ b/drivers/usb/host/dwc_common_port/dwc_os.h
7537 @@ -216,6 +216,7 @@ extern void __DWC_DEBUG(char *format, ..
7540 #define __DWC_DEBUG printk
7541 +#include <linux/kernel.h>
7545 --- a/drivers/usb/host/dwc_otg/Makefile
7546 +++ b/drivers/usb/host/dwc_otg/Makefile
7547 @@ -9,7 +9,9 @@ ifeq ($(BUS_INTERFACE),)
7548 BUS_INTERFACE = -DPLATFORM_INTERFACE=1
7551 -CPPFLAGS += -DDEBUG
7552 +ifeq ($(CONFIG_USB_DEBUG),y)
7553 +CPPFLAGS += -DDEBUG
7556 # Use one of the following flags to compile the software in host-only or
7558 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
7559 +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
7560 @@ -909,6 +909,10 @@ static void assign_and_init_hc(dwc_otg_h
7564 + if (((urb->actual_length < 0) || (urb->actual_length > urb->length)) && !dwc_otg_hcd_is_pipe_in(&urb->pipe_info))
7565 + urb->actual_length = urb->length;
7568 hc = DWC_CIRCLEQ_FIRST(&hcd->free_hc_list);
7570 /* Remove the host channel from the free list. */
7571 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h
7572 +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h
7573 @@ -628,7 +628,7 @@ static inline void dwc_otg_hcd_qh_remove
7574 * @return Returns the memory allocate or NULL on error. */
7575 static inline dwc_otg_qh_t *dwc_otg_hcd_qh_alloc(void)
7577 - return (dwc_otg_qh_t *) dwc_alloc(sizeof(dwc_otg_qh_t));
7578 + return (dwc_otg_qh_t *) dwc_alloc_atomic(sizeof(dwc_otg_qh_t));
7581 extern dwc_otg_qtd_t *dwc_otg_hcd_qtd_create(dwc_otg_hcd_urb_t * urb);
7582 @@ -640,7 +640,7 @@ extern int dwc_otg_hcd_qtd_add(dwc_otg_q
7583 * @return Returns the memory allocate or NULL on error. */
7584 static inline dwc_otg_qtd_t *dwc_otg_hcd_qtd_alloc(void)
7586 - return (dwc_otg_qtd_t *) dwc_alloc(sizeof(dwc_otg_qtd_t));
7587 + return (dwc_otg_qtd_t *) dwc_alloc_atomic(sizeof(dwc_otg_qtd_t));
7590 /** Frees the memory for a QTD structure. QTD should already be removed from
7591 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c
7592 +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c
7593 @@ -417,6 +417,9 @@ int hcd_init(
7595 hcd->regs = otg_dev->base;
7597 + /* Integrate TT in root hub */
7600 /* Initialize the DWC OTG HCD. */
7601 dwc_otg_hcd = dwc_otg_hcd_alloc_hcd();
7603 @@ -668,6 +671,9 @@ static int urb_enqueue(struct usb_hcd *h
7604 urb->number_of_packets,
7605 mem_flags == GFP_ATOMIC ? 1 : 0);
7607 + if(dwc_otg_urb == NULL)
7610 urb->hcpriv = dwc_otg_urb;
7612 dwc_otg_hcd_urb_set_pipeinfo(dwc_otg_urb, usb_pipedevice(urb->pipe),
7613 @@ -755,10 +761,12 @@ static int urb_dequeue(struct usb_hcd *h
7614 dump_urb_info(urb, "urb_dequeue");
7617 - dwc_otg_hcd_urb_dequeue(dwc_otg_hcd, (dwc_otg_hcd_urb_t *)urb->hcpriv);
7618 + if(urb->hcpriv != NULL) {
7619 + dwc_otg_hcd_urb_dequeue(dwc_otg_hcd, (dwc_otg_hcd_urb_t *)urb->hcpriv);
7621 - dwc_free(urb->hcpriv);
7622 - urb->hcpriv = NULL;
7623 + urb->hcpriv = NULL;
7624 + dwc_free(urb->hcpriv);
7627 /* Higher layer software sets URB status. */
7628 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30))
7629 --- a/drivers/video/bcm2708_fb.c
7630 +++ b/drivers/video/bcm2708_fb.c
7632 * License. See the file COPYING in the main directory of this archive
7635 - * Broadcom simple framebuffer driver
7636 + * Broadcom simple framebuffer driver
7638 + * This file is derived from cirrusfb.c
7639 + * Copyright 1999-2001 Jeff Garzik <jgarzik@pobox.com>
7642 #include <linux/module.h>
7643 #include <linux/kernel.h>
7644 #include <linux/errno.h>
7645 #include <linux/string.h>
7646 #include <linux/slab.h>
7647 -#include <linux/delay.h>
7648 #include <linux/mm.h>
7649 #include <linux/fb.h>
7650 #include <linux/init.h>
7652 #include <linux/list.h>
7653 #include <linux/platform_device.h>
7654 #include <linux/clk.h>
7655 +#include <linux/printk.h>
7656 +#include <linux/console.h>
7658 #include <mach/platform.h>
7659 #include <mach/vcio.h>
7660 @@ -38,26 +43,24 @@ static const char *bcm2708_name = "BCM27
7661 /* this data structure describes each frame buffer device we find */
7664 - int xres, yres, xres_virtual, yres_virtual;
7666 - int xoffset, yoffset;
7669 + u32 xres, yres, xres_virtual, yres_virtual;
7671 + u32 xoffset, yoffset;
7677 - struct fb_info fb;
7678 - struct platform_device *dev;
7679 - void __iomem *regs;
7680 - volatile struct fbinfo_s *info;
7683 + struct fb_info fb;
7684 + struct platform_device *dev;
7685 + struct fbinfo_s *info;
7690 #define to_bcm2708(info) container_of(info, struct bcm2708_fb, fb)
7693 -bcm2708_fb_set_bitfields(struct fb_var_screeninfo *var)
7694 +static int bcm2708_fb_set_bitfields(struct fb_var_screeninfo *var)
7698 @@ -72,12 +75,12 @@ bcm2708_fb_set_bitfields(struct fb_var_s
7702 - var->red.length = var->bits_per_pixel;
7703 - var->red.offset = 0;
7704 - var->green.length = var->bits_per_pixel;
7705 - var->green.offset = 0;
7706 - var->blue.length = var->bits_per_pixel;
7707 - var->blue.offset = 0;
7708 + var->red.length = var->bits_per_pixel;
7709 + var->red.offset = 0;
7710 + var->green.length = var->bits_per_pixel;
7711 + var->green.offset = 0;
7712 + var->blue.length = var->bits_per_pixel;
7713 + var->blue.offset = 0;
7716 var->red.length = 5;
7717 @@ -89,10 +92,16 @@ bcm2708_fb_set_bitfields(struct fb_var_s
7718 if (var->green.length != 5 && var->green.length != 6)
7719 var->green.length = 6;
7722 + var->red.length = 8;
7723 + var->blue.length = 8;
7724 + var->green.length = 8;
7727 - var->red.length = 8;
7728 - var->green.length = 8;
7729 - var->blue.length = 8;
7730 + var->red.length = 8;
7731 + var->green.length = 8;
7732 + var->blue.length = 8;
7733 + var->transp.length = 8;
7737 @@ -104,134 +113,148 @@ bcm2708_fb_set_bitfields(struct fb_var_s
7738 * encoded in the pixel data. Calculate their position from
7739 * the bitfield length defined above.
7741 - if (ret == 0 && var->bits_per_pixel >= 16) {
7742 + if (ret == 0 && var->bits_per_pixel >= 24) {
7743 + var->red.offset = 0;
7744 + var->green.offset = var->red.offset + var->red.length;
7745 + var->blue.offset = var->green.offset + var->green.length;
7746 + var->transp.offset = var->blue.offset + var->blue.length;
7747 + } else if (ret == 0 && var->bits_per_pixel >= 16) {
7748 var->blue.offset = 0;
7749 var->green.offset = var->blue.offset + var->blue.length;
7750 var->red.offset = var->green.offset + var->green.length;
7751 + var->transp.offset = var->red.offset + var->red.length;
7757 -static int bcm2708_fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
7758 +static int bcm2708_fb_check_var(struct fb_var_screeninfo *var,
7759 + struct fb_info *info)
7761 + /* info input, var output */
7763 + /* memory size in pixels */
7764 + unsigned pixels = info->screen_size * 8 / var->bits_per_pixel;
7766 + /* info input, var output */
7767 + pr_info("bcm2708_fb_check_var info(%p) %dx%d (%dx%d), %d, %d\n", info,
7768 + info->var.xres, info->var.yres, info->var.xres_virtual,
7769 + info->var.yres_virtual, (int)info->screen_size,
7770 + info->var.bits_per_pixel);
7771 + pr_info("bcm2708_fb_check_var var(%p) %dx%d (%dx%d), %d, %d\n", var,
7772 + var->xres, var->yres, var->xres_virtual, var->yres_virtual,
7773 + var->bits_per_pixel, pixels);
7775 + if (!var->bits_per_pixel)
7776 + var->bits_per_pixel = 16;
7778 + if (bcm2708_fb_set_bitfields(var) != 0) {
7779 + pr_err("bcm2708_fb_check_var: invalid bits_per_pixel %d\n",
7780 + var->bits_per_pixel);
7784 - // info input, var output
7786 - /* memory size in pixels */
7787 - unsigned pixels = info->screen_size * 8 / var->bits_per_pixel;
7789 - // info input, var output
7790 - printk(KERN_ERR "bcm2708_fb_check_var info(%p) %dx%d (%dx%d), %d, %d\n", info, info->var.xres, info->var.yres, info->var.xres_virtual, info->var.yres_virtual, (int)info->screen_size, info->var.bits_per_pixel );
7791 - printk(KERN_ERR "bcm2708_fb_check_var var(%p) %dx%d (%dx%d), %d, %d\n", var, var->xres, var->yres, var->xres_virtual, var->yres_virtual, var->bits_per_pixel, pixels);
7793 - if (!var->bits_per_pixel) var->bits_per_pixel = 16;
7795 - if (0 && var->bits_per_pixel != 16 && var->bits_per_pixel != 32) {
7796 - printk(KERN_ERR "bcm2708_fb_check_var: ERROR: bits_per_pixel=%d\n", var->bits_per_pixel);
7800 - bcm2708_fb_set_bitfields(var);
7802 - if (var->xres_virtual < var->xres)
7803 - var->xres_virtual = var->xres;
7804 - /* use highest possible virtual resolution */
7805 - if (var->yres_virtual == -1) {
7806 - var->yres_virtual = 480; //pixels / var->xres_virtual;
7809 - "bcm2708_fb_check_var: virtual resolution set to maximum of %dx%d\n",
7810 - var->xres_virtual, var->yres_virtual);
7812 - if (var->yres_virtual < var->yres)
7813 - var->yres_virtual = var->yres;
7816 - if (var->xres_virtual * var->yres_virtual > pixels) {
7817 - printk(KERN_ERR "bcm2708_fb_check_var: mode %dx%dx%d rejected... "
7818 - "virtual resolution too high to fit into video memory!\n",
7819 - var->xres_virtual, var->yres_virtual,
7820 - var->bits_per_pixel);
7824 - if (var->xoffset < 0)
7826 - if (var->yoffset < 0)
7829 - /* truncate xoffset and yoffset to maximum if too high */
7830 - if (var->xoffset > var->xres_virtual - var->xres)
7831 - var->xoffset = var->xres_virtual - var->xres - 1;
7832 - if (var->yoffset > var->yres_virtual - var->yres)
7833 - var->yoffset = var->yres_virtual - var->yres - 1;
7835 - var->red.msb_right =
7836 - var->green.msb_right =
7837 - var->blue.msb_right =
7838 - var->transp.offset =
7839 - var->transp.length =
7840 - var->transp.msb_right = 0;
7843 - if (var->vmode & FB_VMODE_DOUBLE)
7845 - else if (var->vmode & FB_VMODE_INTERLACED)
7846 - yres = (yres + 1) / 2;
7848 - if (yres > 1200) {
7849 - printk(KERN_ERR "bcm2708_fb_check_var: ERROR: VerticalTotal >= 1200; "
7850 - "special treatment required! (TODO)\n");
7854 - //if (cirrusfb_check_pixclock(var, info))
7855 - // return -EINVAL;
7856 + if (var->xres_virtual < var->xres)
7857 + var->xres_virtual = var->xres;
7858 + /* use highest possible virtual resolution */
7859 + if (var->yres_virtual == -1) {
7860 + var->yres_virtual = 480;
7863 + ("bcm2708_fb_check_var: virtual resolution set to maximum of %dx%d\n",
7864 + var->xres_virtual, var->yres_virtual);
7866 + if (var->yres_virtual < var->yres)
7867 + var->yres_virtual = var->yres;
7869 - //if (!is_laguna(cinfo))
7870 - // var->accel_flags = FB_ACCELF_TEXT;
7871 + if (var->xoffset < 0)
7873 + if (var->yoffset < 0)
7876 + /* truncate xoffset and yoffset to maximum if too high */
7877 + if (var->xoffset > var->xres_virtual - var->xres)
7878 + var->xoffset = var->xres_virtual - var->xres - 1;
7879 + if (var->yoffset > var->yres_virtual - var->yres)
7880 + var->yoffset = var->yres_virtual - var->yres - 1;
7883 + if (var->vmode & FB_VMODE_DOUBLE)
7885 + else if (var->vmode & FB_VMODE_INTERLACED)
7886 + yres = (yres + 1) / 2;
7888 + if (yres > 1200) {
7889 + pr_err("bcm2708_fb_check_var: ERROR: VerticalTotal >= 1200; "
7890 + "special treatment required! (TODO)\n");
7898 static int bcm2708_fb_set_par(struct fb_info *info)
7902 struct bcm2708_fb *fb = to_bcm2708(info);
7903 - volatile struct fbinfo_s *fbinfo = fb->info;
7904 - fbinfo->xres = info->var.xres;
7905 - fbinfo->yres = info->var.yres;
7906 - fbinfo->xres_virtual = info->var.xres_virtual;
7907 - fbinfo->yres_virtual = info->var.yres_virtual;
7908 - fbinfo->bpp = info->var.bits_per_pixel;
7909 - fbinfo->xoffset = info->var.xoffset;
7910 - fbinfo->yoffset = info->var.yoffset;
7911 - fbinfo->base = 0; // filled in by VC
7912 - fbinfo->pitch = 0; // filled in by VC
7913 + volatile struct fbinfo_s *fbinfo = fb->info;
7914 + fbinfo->xres = info->var.xres;
7915 + fbinfo->yres = info->var.yres;
7916 + fbinfo->xres_virtual = info->var.xres_virtual;
7917 + fbinfo->yres_virtual = info->var.yres_virtual;
7918 + fbinfo->bpp = info->var.bits_per_pixel;
7919 + fbinfo->xoffset = info->var.xoffset;
7920 + fbinfo->yoffset = info->var.yoffset;
7921 + fbinfo->base = 0; /* filled in by VC */
7922 + fbinfo->pitch = 0; /* filled in by VC */
7924 + pr_info("bcm2708_fb_set_par info(%p) %dx%d (%dx%d), %d, %d\n", info,
7925 + info->var.xres, info->var.yres, info->var.xres_virtual,
7926 + info->var.yres_virtual, (int)info->screen_size,
7927 + info->var.bits_per_pixel);
7929 - printk(KERN_ERR "bcm2708_fb_set_par info(%p) %dx%d (%dx%d), %d, %d\n", info, info->var.xres, info->var.yres, info->var.xres_virtual, info->var.yres_virtual, (int)info->screen_size, info->var.bits_per_pixel );
7930 + /* ensure last write to fbinfo is visible to GPU */
7933 - // inform vc about new framebuffer
7934 + /* inform vc about new framebuffer */
7935 bcm_mailbox_write(MBOX_CHAN_FB, fb->dma);
7937 - // wait for response
7938 - bcm_mailbox_read(MBOX_CHAN_FB, &val);
7940 - fb->fb.fix.line_length = fbinfo->pitch;
7941 + /* TODO: replace fb driver with vchiq version */
7942 + /* wait for response */
7943 + bcm_mailbox_read(MBOX_CHAN_FB, &val);
7945 + /* ensure GPU writes are visible to us */
7949 + fb->fb.fix.line_length = fbinfo->pitch;
7951 + if (info->var.bits_per_pixel <= 8)
7952 + fb->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR;
7954 + fb->fb.fix.visual = FB_VISUAL_TRUECOLOR;
7956 + fb->fb.fix.smem_start = fbinfo->base;
7957 + fb->fb.fix.smem_len = fbinfo->pitch * fbinfo->yres_virtual;
7958 + fb->fb.screen_size = fbinfo->screen_size;
7959 + if (fb->fb.screen_base)
7960 + iounmap(fb->fb.screen_base);
7961 + fb->fb.screen_base =
7962 + (void *)ioremap_wc(fb->fb.fix.smem_start, fb->fb.screen_size);
7963 + if (!fb->fb.screen_base) {
7964 + /* the console may currently be locked */
7965 + console_trylock();
7968 - if (info->var.bits_per_pixel <= 8)
7969 - fb->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR;
7971 - fb->fb.fix.visual = FB_VISUAL_TRUECOLOR;
7973 - fb->fb.fix.smem_start = fbinfo->base;
7974 - fb->fb.fix.smem_len = fbinfo->pitch * fbinfo->yres_virtual;
7975 - fb->fb.screen_size = fbinfo->screen_size;
7976 - fb->fb.screen_base = (void *)ioremap_nocache(fb->fb.fix.smem_start, fb->fb.screen_size);
7978 - printk(KERN_ERR "BCM2708FB: start = %p,%p,%p width=%d, height=%d, bpp=%d, pitch=%d\n",
7979 - (void *)fb->fb.screen_base, (void *)fb->fb.fix.smem_start, (void *)val, fbinfo->xres, fbinfo->yres, fbinfo->bpp, fbinfo->pitch);
7980 + BUG(); /* what can we do here */
7984 + ("BCM2708FB: start = %p,%p width=%d, height=%d, bpp=%d, pitch=%d size=%d success=%d\n",
7985 + (void *)fb->fb.screen_base, (void *)fb->fb.fix.smem_start,
7986 + fbinfo->xres, fbinfo->yres, fbinfo->bpp,
7987 + fbinfo->pitch, (int)fb->fb.screen_size, val);
7991 @@ -243,58 +266,62 @@ static inline u32 convert_bitfield(int v
7992 return (val >> (16 - bf->length) & mask) << bf->offset;
7995 -static int bcm2708_fb_setcolreg(unsigned int regno, unsigned int red, unsigned int green,
7996 - unsigned int blue, unsigned int transp, struct fb_info *info)
7997 +static int bcm2708_fb_setcolreg(unsigned int regno, unsigned int red,
7998 + unsigned int green, unsigned int blue,
7999 + unsigned int transp, struct fb_info *info)
8001 struct bcm2708_fb *fb = to_bcm2708(info);
8004 fb->cmap[regno] = convert_bitfield(transp, &fb->fb.var.transp) |
8005 - convert_bitfield(blue, &fb->fb.var.blue) |
8006 - convert_bitfield(green, &fb->fb.var.green) |
8007 - convert_bitfield(red, &fb->fb.var.red);
8008 + convert_bitfield(blue, &fb->fb.var.blue) |
8009 + convert_bitfield(green, &fb->fb.var.green) |
8010 + convert_bitfield(red, &fb->fb.var.red);
8015 static int bcm2708_fb_blank(int blank_mode, struct fb_info *info)
8017 -//printk(KERN_ERR "bcm2708_fb_blank\n");
8018 + /*pr_info("bcm2708_fb_blank\n"); */
8022 -static void bcm2708_fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
8023 +static void bcm2708_fb_fillrect(struct fb_info *info,
8024 + const struct fb_fillrect *rect)
8026 -// (is called) printk(KERN_ERR "bcm2708_fb_fillrect\n");
8027 + /* (is called) pr_info("bcm2708_fb_fillrect\n"); */
8028 cfb_fillrect(info, rect);
8031 -static void bcm2708_fb_copyarea(struct fb_info *info, const struct fb_copyarea *region)
8032 +static void bcm2708_fb_copyarea(struct fb_info *info,
8033 + const struct fb_copyarea *region)
8035 -//printk(KERN_ERR "bcm2708_fb_copyarea\n");
8036 + /*pr_info("bcm2708_fb_copyarea\n"); */
8037 cfb_copyarea(info, region);
8040 -static void bcm2708_fb_imageblit(struct fb_info *info, const struct fb_image *image)
8041 +static void bcm2708_fb_imageblit(struct fb_info *info,
8042 + const struct fb_image *image)
8044 -// (is called) printk(KERN_ERR "bcm2708_fb_imageblit\n");
8045 + /* (is called) pr_info("bcm2708_fb_imageblit\n"); */
8046 cfb_imageblit(info, image);
8049 static struct fb_ops bcm2708_fb_ops = {
8050 - .owner = THIS_MODULE,
8051 - .fb_check_var = bcm2708_fb_check_var,
8052 - .fb_set_par = bcm2708_fb_set_par,
8053 - .fb_setcolreg = bcm2708_fb_setcolreg,
8054 - .fb_blank = bcm2708_fb_blank,
8055 - .fb_fillrect = bcm2708_fb_fillrect,
8056 - .fb_copyarea = bcm2708_fb_copyarea,
8057 - .fb_imageblit = bcm2708_fb_imageblit,
8058 + .owner = THIS_MODULE,
8059 + .fb_check_var = bcm2708_fb_check_var,
8060 + .fb_set_par = bcm2708_fb_set_par,
8061 + .fb_setcolreg = bcm2708_fb_setcolreg,
8062 + .fb_blank = bcm2708_fb_blank,
8063 + .fb_fillrect = bcm2708_fb_fillrect,
8064 + .fb_copyarea = bcm2708_fb_copyarea,
8065 + .fb_imageblit = bcm2708_fb_imageblit,
8068 -static int FBWIDTH =800; /* module parameter */
8069 -static int FBHEIGHT =480; /* module parameter */
8071 +static int fbwidth = 800; /* module parameter */
8072 +static int fbheight = 480; /* module parameter */
8073 +static int fbdepth = 16; /* module parameter */
8075 static int bcm2708_fb_register(struct bcm2708_fb *fb)
8077 @@ -302,45 +329,47 @@ static int bcm2708_fb_register(struct bc
8081 - mem = dma_alloc_coherent(NULL, PAGE_ALIGN(sizeof(*fb->info)), &dma, GFP_KERNEL);
8083 + dma_alloc_coherent(NULL, PAGE_ALIGN(sizeof(*fb->info)), &dma,
8087 - printk(KERN_ERR ": unable to allocate fbinfo buffer\n");
8088 + pr_err(": unable to allocate fbinfo buffer\n");
8091 fb->info = (struct fbinfo_s *)mem;
8094 - fb->fb.fbops = &bcm2708_fb_ops;
8095 - fb->fb.flags = FBINFO_FLAG_DEFAULT | FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_IMAGEBLIT;
8096 - fb->fb.pseudo_palette = fb->cmap;
8099 + fb->fb.fbops = &bcm2708_fb_ops;
8100 + fb->fb.flags = FBINFO_FLAG_DEFAULT;
8101 + fb->fb.pseudo_palette = fb->cmap;
8103 strncpy(fb->fb.fix.id, bcm2708_name, sizeof(fb->fb.fix.id));
8104 - fb->fb.fix.type = FB_TYPE_PACKED_PIXELS;
8105 - fb->fb.fix.type_aux = 0;
8106 - fb->fb.fix.xpanstep = 0;
8107 - fb->fb.fix.ypanstep = 0;
8108 - fb->fb.fix.ywrapstep = 0;
8109 - fb->fb.fix.accel = FB_ACCEL_NONE;
8111 - fb->fb.var.xres = FBWIDTH;
8112 - fb->fb.var.yres = FBHEIGHT;
8113 - fb->fb.var.xres_virtual = FBWIDTH;
8114 - fb->fb.var.yres_virtual = FBHEIGHT;
8115 - fb->fb.var.bits_per_pixel = 16;
8116 - fb->fb.var.vmode = FB_VMODE_NONINTERLACED;
8117 - fb->fb.var.activate = FB_ACTIVATE_NOW;
8118 - fb->fb.var.nonstd = 0;
8119 - fb->fb.var.height = FBWIDTH;
8120 - fb->fb.var.width = FBHEIGHT;
8121 - fb->fb.var.accel_flags = 0;
8123 - fb->fb.monspecs.hfmin = 0;
8124 - fb->fb.monspecs.hfmax = 100000;
8125 - fb->fb.monspecs.vfmin = 0;
8126 - fb->fb.monspecs.vfmax = 400;
8127 + fb->fb.fix.type = FB_TYPE_PACKED_PIXELS;
8128 + fb->fb.fix.type_aux = 0;
8129 + fb->fb.fix.xpanstep = 0;
8130 + fb->fb.fix.ypanstep = 0;
8131 + fb->fb.fix.ywrapstep = 0;
8132 + fb->fb.fix.accel = FB_ACCEL_NONE;
8134 + fb->fb.var.xres = fbwidth;
8135 + fb->fb.var.yres = fbheight;
8136 + fb->fb.var.xres_virtual = fbwidth;
8137 + fb->fb.var.yres_virtual = fbheight;
8138 + fb->fb.var.bits_per_pixel = fbdepth;
8139 + fb->fb.var.vmode = FB_VMODE_NONINTERLACED;
8140 + fb->fb.var.activate = FB_ACTIVATE_NOW;
8141 + fb->fb.var.nonstd = 0;
8142 + fb->fb.var.height = fbwidth;
8143 + fb->fb.var.width = fbheight;
8144 + fb->fb.var.accel_flags = 0;
8146 + fb->fb.monspecs.hfmin = 0;
8147 + fb->fb.monspecs.hfmax = 100000;
8148 + fb->fb.monspecs.vfmin = 0;
8149 + fb->fb.monspecs.vfmax = 400;
8150 fb->fb.monspecs.dclkmin = 1000000;
8151 - fb->fb.monspecs.dclkmax = 100000000;
8152 + fb->fb.monspecs.dclkmax = 100000000;
8154 bcm2708_fb_set_bitfields(&fb->fb.var);
8156 @@ -350,17 +379,16 @@ static int bcm2708_fb_register(struct bc
8158 fb_set_var(&fb->fb, &fb->fb.var);
8160 - printk(KERN_INFO "BCM2708FB: registering framebuffer (%d, %d)\n", FBWIDTH, FBHEIGHT);
8161 + pr_info("BCM2708FB: registering framebuffer (%dx%d@%d)\n", fbwidth,
8162 + fbheight, fbdepth);
8164 ret = register_framebuffer(&fb->fb);
8165 - printk(KERN_ERR "BCM2708FB: register framebuffer (%d)\n", ret);
8166 + pr_info("BCM2708FB: register framebuffer (%d)\n", ret);
8170 - printk(KERN_ERR "BCM2708FB: cannot register framebuffer (%d)\n", ret);
8172 - iounmap(fb->regs);
8174 + pr_info("BCM2708FB: cannot register framebuffer (%d)\n", ret);
8179 @@ -371,7 +399,8 @@ static int bcm2708_fb_probe(struct platf
8181 fb = kmalloc(sizeof(struct bcm2708_fb), GFP_KERNEL);
8183 - dev_err(&dev->dev, "could not allocate new bcm2708_fb struct\n");
8184 + dev_err(&dev->dev,
8185 + "could not allocate new bcm2708_fb struct\n");
8189 @@ -386,9 +415,9 @@ static int bcm2708_fb_probe(struct platf
8195 dev_err(&dev->dev, "probe failed, err %d\n", ret);
8201 @@ -398,22 +427,24 @@ static int bcm2708_fb_remove(struct plat
8203 platform_set_drvdata(dev, NULL);
8205 + if (fb->fb.screen_base)
8206 + iounmap(fb->fb.screen_base);
8207 unregister_framebuffer(&fb->fb);
8208 - iounmap(fb->regs);
8210 - dma_free_coherent(NULL, PAGE_ALIGN(sizeof(*fb->info)), (void *)fb->info, fb->dma);
8211 + dma_free_coherent(NULL, PAGE_ALIGN(sizeof(*fb->info)), (void *)fb->info,
8218 static struct platform_driver bcm2708_fb_driver = {
8219 - .probe = bcm2708_fb_probe,
8220 - .remove = bcm2708_fb_remove,
8222 - .name = DRIVER_NAME,
8223 - .owner = THIS_MODULE,
8225 + .probe = bcm2708_fb_probe,
8226 + .remove = bcm2708_fb_remove,
8228 + .name = DRIVER_NAME,
8229 + .owner = THIS_MODULE,
8233 static int __init bcm2708_fb_init(void)
8234 @@ -430,11 +461,13 @@ static void __exit bcm2708_fb_exit(void)
8236 module_exit(bcm2708_fb_exit);
8238 -module_param(FBWIDTH, int, 0644);
8239 -module_param(FBHEIGHT, int, 0644);
8240 +module_param(fbwidth, int, 0644);
8241 +module_param(fbheight, int, 0644);
8242 +module_param(fbdepth, int, 0644);
8244 MODULE_DESCRIPTION("BCM2708 framebuffer driver");
8245 MODULE_LICENSE("GPL");
8247 -MODULE_PARM_DESC(FBWIDTH, "Width of ARM Framebuffer");
8248 -MODULE_PARM_DESC(FBHEIGHT, "Height of ARM Framebuffer");
8249 +MODULE_PARM_DESC(fbwidth, "Width of ARM Framebuffer");
8250 +MODULE_PARM_DESC(fbheight, "Height of ARM Framebuffer");
8251 +MODULE_PARM_DESC(fbdepth, "Bit depth of ARM Framebuffer");
8252 --- a/sound/arm/Kconfig
8253 +++ b/sound/arm/Kconfig
8254 @@ -39,5 +39,12 @@ config SND_PXA2XX_AC97
8255 Say Y or M if you want to support any AC97 codec attached to
8256 the PXA2xx AC97 interface.
8259 + tristate "BCM2835 ALSA driver"
8260 + depends on ARCH_BCM2708 && SND
8263 + Say Y or M if you want to support BCM2835 Alsa pcm card driver
8267 --- a/sound/arm/Makefile
8268 +++ b/sound/arm/Makefile
8269 @@ -14,3 +14,9 @@ snd-pxa2xx-lib-$(CONFIG_SND_PXA2XX_LIB_A
8271 obj-$(CONFIG_SND_PXA2XX_AC97) += snd-pxa2xx-ac97.o
8272 snd-pxa2xx-ac97-objs := pxa2xx-ac97.o
8274 +obj-$(CONFIG_SND_BCM2835) += snd-bcm2835.o
8275 +snd-bcm2835-objs := bcm2835.o bcm2835-ctl.o bcm2835-pcm.o bcm2835-vchiq.o
8277 +EXTRA_CFLAGS += -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel -D__VCCOREVER__=0x04000000
8280 +++ b/sound/arm/bcm2835-ctl.c
8282 +/*****************************************************************************
8283 +* Copyright 2011 Broadcom Corporation. All rights reserved.
8285 +* Unless you and Broadcom execute a separate written software license
8286 +* agreement governing use of this software, this software is licensed to you
8287 +* under the terms of the GNU General Public License version 2, available at
8288 +* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8290 +* Notwithstanding the above, under no circumstances may you combine this
8291 +* software in any way with any other Broadcom software provided under a
8292 +* license other than the GPL, without Broadcom's express prior written
8294 +*****************************************************************************/
8296 +#include <linux/platform_device.h>
8297 +#include <linux/init.h>
8298 +#include <linux/io.h>
8299 +#include <linux/jiffies.h>
8300 +#include <linux/slab.h>
8301 +#include <linux/time.h>
8302 +#include <linux/wait.h>
8303 +#include <linux/delay.h>
8304 +#include <linux/moduleparam.h>
8305 +#include <linux/sched.h>
8307 +#include <sound/core.h>
8308 +#include <sound/control.h>
8309 +#include <sound/pcm.h>
8310 +#include <sound/pcm_params.h>
8311 +#include <sound/rawmidi.h>
8312 +#include <sound/initval.h>
8313 +#include <sound/tlv.h>
8315 +#include "bcm2835.h"
8317 +static int snd_bcm2835_ctl_info(struct snd_kcontrol *kcontrol,
8318 + struct snd_ctl_elem_info *uinfo)
8320 + if (kcontrol->private_value == PCM_PLAYBACK_VOLUME) {
8321 + uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
8323 + uinfo->value.integer.min = -10240;
8324 + uinfo->value.integer.max = 2303;
8325 + } else if (kcontrol->private_value == PCM_PLAYBACK_MUTE) {
8326 + uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
8328 + uinfo->value.integer.min = 0;
8329 + uinfo->value.integer.max = 1;
8330 + } else if (kcontrol->private_value == PCM_PLAYBACK_DEVICE) {
8331 + uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
8333 + uinfo->value.integer.min = 0;
8334 + uinfo->value.integer.max = AUDIO_DEST_MAX-0;
8340 +static int snd_bcm2835_ctl_get(struct snd_kcontrol *kcontrol,
8341 + struct snd_ctl_elem_value *ucontrol)
8343 + struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
8345 + BUG_ON(!chip && !(chip->avail_substreams & AVAIL_SUBSTREAMS_MASK));
8347 + if (kcontrol->private_value == PCM_PLAYBACK_VOLUME)
8348 + ucontrol->value.integer.value[0] = chip->volume;
8349 + else if (kcontrol->private_value == PCM_PLAYBACK_MUTE)
8350 + ucontrol->value.integer.value[0] = chip->mute;
8351 + else if (kcontrol->private_value == PCM_PLAYBACK_DEVICE)
8352 + ucontrol->value.integer.value[0] = chip->dest;
8357 +static int snd_bcm2835_ctl_put(struct snd_kcontrol *kcontrol,
8358 + struct snd_ctl_elem_value *ucontrol)
8360 + struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
8363 + if (kcontrol->private_value == PCM_PLAYBACK_VOLUME) {
8369 + || (ucontrol->value.integer.value[0] != chip->volume)) {
8372 + chip->volume = ucontrol->value.integer.value[0];
8374 + atten = -((chip->volume << 8) / 100);
8375 + chip->volume = atten;
8378 + } else if (kcontrol->private_value == PCM_PLAYBACK_MUTE) {
8379 + /* Not implemented */
8380 + if (ucontrol->value.integer.value[0] != chip->mute) {
8381 + chip->mute = ucontrol->value.integer.value[0];
8384 + } else if (kcontrol->private_value == PCM_PLAYBACK_DEVICE) {
8385 + if (ucontrol->value.integer.value[0] != chip->dest) {
8386 + chip->dest = ucontrol->value.integer.value[0];
8392 + if (bcm2835_audio_set_ctls(chip))
8393 + printk(KERN_ERR "Failed to set ALSA controls..\n");
8399 +static DECLARE_TLV_DB_SCALE(snd_bcm2835_db_scale, -10240, 1, 1);
8401 +static struct snd_kcontrol_new snd_bcm2835_ctl[] __devinitdata = {
8403 + .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
8404 + .name = "PCM Playback Volume",
8407 + SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE,
8408 + .private_value = PCM_PLAYBACK_VOLUME,
8409 + .info = snd_bcm2835_ctl_info,
8410 + .get = snd_bcm2835_ctl_get,
8411 + .put = snd_bcm2835_ctl_put,
8413 + .tlv = {.p = snd_bcm2835_db_scale}
8416 + .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
8417 + .name = "PCM Playback Switch",
8419 + .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
8420 + .private_value = PCM_PLAYBACK_MUTE,
8421 + .info = snd_bcm2835_ctl_info,
8422 + .get = snd_bcm2835_ctl_get,
8423 + .put = snd_bcm2835_ctl_put,
8427 + .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
8428 + .name = "PCM Playback Route",
8430 + .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
8431 + .private_value = PCM_PLAYBACK_DEVICE,
8432 + .info = snd_bcm2835_ctl_info,
8433 + .get = snd_bcm2835_ctl_get,
8434 + .put = snd_bcm2835_ctl_put,
8439 +int __devinit snd_bcm2835_new_ctl(bcm2835_chip_t * chip)
8444 + strcpy(chip->card->mixername, "Broadcom Mixer");
8445 + for (idx = 0; idx < ARRAY_SIZE(snd_bcm2835_ctl); idx++) {
8447 + snd_ctl_add(chip->card,
8448 + snd_ctl_new1(&snd_bcm2835_ctl[idx], chip));
8455 +++ b/sound/arm/bcm2835-pcm.c
8457 +/*****************************************************************************
8458 +* Copyright 2011 Broadcom Corporation. All rights reserved.
8460 +* Unless you and Broadcom execute a separate written software license
8461 +* agreement governing use of this software, this software is licensed to you
8462 +* under the terms of the GNU General Public License version 2, available at
8463 +* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8465 +* Notwithstanding the above, under no circumstances may you combine this
8466 +* software in any way with any other Broadcom software provided under a
8467 +* license other than the GPL, without Broadcom's express prior written
8469 +*****************************************************************************/
8471 +#include <linux/interrupt.h>
8472 +#include <linux/slab.h>
8474 +#include "bcm2835.h"
8476 +/* hardware definition */
8477 +static struct snd_pcm_hardware snd_bcm2835_playback_hw = {
8478 + .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER),
8479 + .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
8480 + .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
8482 + .rate_max = 48000,
8483 + .channels_min = 1,
8484 + .channels_max = 2,
8485 + .buffer_bytes_max = (4 * 8 - 1) * 1024, /* Needs to be less than audioplay buffer size */
8486 + .period_bytes_min = 1 * 1024,
8487 + .period_bytes_max = (4 * 8 - 1) * 1024,
8489 + .periods_max = 4 * 8 - 1,
8492 +static void snd_bcm2835_playback_free(struct snd_pcm_runtime *runtime)
8494 + audio_info("Freeing up alsa stream here ..\n");
8495 + if (runtime->private_data)
8496 + kfree(runtime->private_data);
8497 + runtime->private_data = NULL;
8500 +static irqreturn_t bcm2835_playback_fifo_irq(int irq, void *dev_id)
8502 + bcm2835_alsa_stream_t *alsa_stream = (bcm2835_alsa_stream_t *) dev_id;
8503 + uint32_t consumed = 0;
8504 + int new_period = 0;
8506 + audio_info(" .. IN\n");
8508 + audio_info("alsa_stream=%p substream=%p\n", alsa_stream,
8509 + alsa_stream ? alsa_stream->substream : 0);
8511 + if (alsa_stream->open)
8512 + consumed = bcm2835_audio_retrieve_buffers(alsa_stream);
8514 + /* We get called only if playback was triggered, So, the number of buffers we retrieve in
8515 + * each iteration are the buffers that have been played out already
8518 + if (alsa_stream->period_size) {
8519 + if ((alsa_stream->pos / alsa_stream->period_size) !=
8520 + ((alsa_stream->pos + consumed) / alsa_stream->period_size))
8523 + audio_debug("updating pos cur: %d + %d max:%d new_period:%d\n",
8525 + (consumed /** AUDIO_IPC_BLOCK_BUFFER_SIZE*/ ),
8526 + alsa_stream->buffer_size, new_period);
8527 + if (alsa_stream->buffer_size) {
8528 + alsa_stream->pos += consumed;
8529 + alsa_stream->pos %= alsa_stream->buffer_size;
8531 + if (alsa_stream->substream) {
8533 + snd_pcm_period_elapsed(alsa_stream->substream);
8535 + audio_warning(" unexpected NULL substream\n");
8537 + audio_info(" .. OUT\n");
8539 + return IRQ_HANDLED;
8542 +/* open callback */
8543 +static int snd_bcm2835_playback_open(struct snd_pcm_substream *substream)
8545 + bcm2835_chip_t *chip = snd_pcm_substream_chip(substream);
8546 + struct snd_pcm_runtime *runtime = substream->runtime;
8547 + bcm2835_alsa_stream_t *alsa_stream;
8551 + audio_info(" .. IN (%d)\n", substream->number);
8553 + audio_warning("Alsa open (%d)\n", substream->number);
8554 + idx = substream->number;
8556 + if (idx > MAX_SUBSTREAMS) {
8558 + ("substream(%d) device doesn't exist max(%d) substreams allowed\n",
8559 + idx, MAX_SUBSTREAMS);
8564 + /* Check if we are ready */
8565 + if (!(chip->avail_substreams & (1 << idx))) {
8566 + /* We are not ready yet */
8567 + audio_error("substream(%d) device is not ready yet\n", idx);
8572 + alsa_stream = kzalloc(sizeof(bcm2835_alsa_stream_t), GFP_KERNEL);
8573 + if (alsa_stream == NULL) {
8577 + /* Initialise alsa_stream */
8578 + alsa_stream->chip = chip;
8579 + alsa_stream->substream = substream;
8580 + alsa_stream->idx = idx;
8581 + chip->alsa_stream[idx] = alsa_stream;
8583 + sema_init(&alsa_stream->buffers_update_sem, 0);
8584 + sema_init(&alsa_stream->control_sem, 0);
8585 + spin_lock_init(&alsa_stream->lock);
8587 + /* Enabled in start trigger, called on each "fifo irq" after that */
8588 + alsa_stream->enable_fifo_irq = 0;
8589 + alsa_stream->fifo_irq_handler = bcm2835_playback_fifo_irq;
8591 + runtime->private_data = alsa_stream;
8592 + runtime->private_free = snd_bcm2835_playback_free;
8593 + runtime->hw = snd_bcm2835_playback_hw;
8595 + /* minimum 16 bytes alignment (for vchiq bulk transfers) */
8596 + snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
8599 + err = bcm2835_audio_open(alsa_stream);
8601 + kfree(alsa_stream);
8605 + alsa_stream->open = 1;
8606 + alsa_stream->draining = 1;
8609 + audio_info(" .. OUT =%d\n", err);
8614 +/* close callback */
8615 +static int snd_bcm2835_playback_close(struct snd_pcm_substream *substream)
8617 + /* the hardware-specific codes will be here */
8619 + struct snd_pcm_runtime *runtime = substream->runtime;
8620 + bcm2835_alsa_stream_t *alsa_stream = runtime->private_data;
8622 + audio_info(" .. IN\n");
8623 + audio_warning("Alsa close\n");
8626 + * Call stop if it's still running. This happens when app
8627 + * is force killed and we don't get a stop trigger.
8629 + if (alsa_stream->running) {
8631 + err = bcm2835_audio_stop(alsa_stream);
8632 + alsa_stream->running = 0;
8634 + audio_error(" Failed to STOP alsa device\n");
8637 + alsa_stream->period_size = 0;
8638 + alsa_stream->buffer_size = 0;
8640 + if (alsa_stream->open) {
8641 + alsa_stream->open = 0;
8642 + bcm2835_audio_close(alsa_stream);
8644 + if (alsa_stream->chip)
8645 + alsa_stream->chip->alsa_stream[alsa_stream->idx] = NULL;
8647 + * Do not free up alsa_stream here, it will be freed up by
8648 + * runtime->private_free callback we registered in *_open above
8651 + audio_info(" .. OUT\n");
8656 +/* hw_params callback */
8657 +static int snd_bcm2835_pcm_hw_params(struct snd_pcm_substream *substream,
8658 + struct snd_pcm_hw_params *params)
8661 + struct snd_pcm_runtime *runtime = substream->runtime;
8662 + bcm2835_alsa_stream_t *alsa_stream =
8663 + (bcm2835_alsa_stream_t *) runtime->private_data;
8665 + audio_info(" .. IN\n");
8667 + err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
8670 + (" pcm_lib_malloc failed to allocated pages for buffers\n");
8674 + err = bcm2835_audio_set_params(alsa_stream, params_channels(params),
8675 + params_rate(params),
8676 + snd_pcm_format_width(params_format
8679 + audio_error(" error setting hw params\n");
8682 + bcm2835_audio_setup(alsa_stream);
8683 + audio_info(" .. OUT\n");
8688 +/* hw_free callback */
8689 +static int snd_bcm2835_pcm_hw_free(struct snd_pcm_substream *substream)
8691 + audio_info(" .. IN\n");
8692 + return snd_pcm_lib_free_pages(substream);
8695 +/* prepare callback */
8696 +static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream)
8698 + struct snd_pcm_runtime *runtime = substream->runtime;
8699 + bcm2835_alsa_stream_t *alsa_stream = runtime->private_data;
8701 + audio_info(" .. IN\n");
8703 + alsa_stream->buffer_size = snd_pcm_lib_buffer_bytes(substream);
8704 + alsa_stream->period_size = snd_pcm_lib_period_bytes(substream);
8705 + alsa_stream->pos = 0;
8707 + audio_debug("buffer_size=%d, period_size=%d pos=%d frame_bits=%d\n",
8708 + alsa_stream->buffer_size, alsa_stream->period_size,
8709 + alsa_stream->pos, runtime->frame_bits);
8711 + audio_info(" .. OUT\n");
8715 +/* trigger callback */
8716 +static int snd_bcm2835_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
8718 + struct snd_pcm_runtime *runtime = substream->runtime;
8719 + bcm2835_alsa_stream_t *alsa_stream = runtime->private_data;
8722 + audio_info(" .. IN\n");
8725 + case SNDRV_PCM_TRIGGER_START:
8726 + audio_debug("bcm2835_AUDIO_TRIGGER_START running=%d\n",
8727 + alsa_stream->running);
8728 + if (!alsa_stream->running) {
8729 + err = bcm2835_audio_start(alsa_stream);
8731 + alsa_stream->running = 1;
8732 + alsa_stream->draining = 1;
8736 + case SNDRV_PCM_TRIGGER_STOP:
8738 + ("bcm2835_AUDIO_TRIGGER_STOP running=%d draining=%d\n",
8739 + runtime->status->state == SNDRV_PCM_STATE_DRAINING,
8740 + alsa_stream->running);
8741 + if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) {
8742 + audio_info("DRAINING\n");
8743 + alsa_stream->draining = 1;
8745 + audio_info("DROPPING\n");
8746 + alsa_stream->draining = 0;
8748 + if (alsa_stream->running) {
8749 + err = bcm2835_audio_stop(alsa_stream);
8751 + audio_error(" Failed to STOP alsa device\n");
8752 + alsa_stream->running = 0;
8759 + audio_info(" .. OUT\n");
8763 +/* pointer callback */
8764 +static snd_pcm_uframes_t
8765 +snd_bcm2835_pcm_pointer(struct snd_pcm_substream *substream)
8767 + struct snd_pcm_runtime *runtime = substream->runtime;
8768 + bcm2835_alsa_stream_t *alsa_stream = runtime->private_data;
8770 + audio_info(" .. IN\n");
8772 + audio_debug("pcm_pointer... (%d) hwptr=%d appl=%d pos=%d\n", 0,
8773 + frames_to_bytes(runtime, runtime->status->hw_ptr),
8774 + frames_to_bytes(runtime, runtime->control->appl_ptr),
8775 + alsa_stream->pos);
8777 + audio_info(" .. OUT\n");
8778 + return bytes_to_frames(runtime, alsa_stream->pos);
8781 +static int snd_bcm2835_pcm_copy(struct snd_pcm_substream *substream,
8782 + int channel, snd_pcm_uframes_t pos, void *src,
8783 + snd_pcm_uframes_t count)
8786 + struct snd_pcm_runtime *runtime = substream->runtime;
8787 + bcm2835_alsa_stream_t *alsa_stream = runtime->private_data;
8789 + audio_info(" .. IN\n");
8790 + audio_debug("copy.......... (%d) hwptr=%d appl=%d pos=%d\n",
8791 + frames_to_bytes(runtime, count), frames_to_bytes(runtime,
8795 + frames_to_bytes(runtime, runtime->control->appl_ptr),
8796 + alsa_stream->pos);
8798 + bcm2835_audio_write(alsa_stream, frames_to_bytes(runtime, count),
8800 + audio_info(" .. OUT\n");
8804 +static int snd_bcm2835_pcm_silence(struct snd_pcm_substream *substream,
8805 + int channel, snd_pcm_uframes_t post,
8806 + snd_pcm_uframes_t count)
8809 + struct snd_pcm_runtime *runtime = substream->runtime;
8810 + bcm2835_alsa_stream_t *alsa_stream = runtime->private_data;
8812 + audio_info(" .. IN\n");
8813 + audio_debug("silence....... (%d) hwptr=%d appl=%d pos=%d\n",
8814 + frames_to_bytes(runtime, count), frames_to_bytes(runtime,
8818 + frames_to_bytes(runtime, runtime->control->appl_ptr),
8819 + alsa_stream->pos);
8821 + bcm2835_audio_write(alsa_stream, frames_to_bytes(runtime, count),
8823 + audio_info(" .. OUT\n");
8827 +static int snd_bcm2835_pcm_lib_ioctl(struct snd_pcm_substream *substream,
8828 + unsigned int cmd, void *arg)
8830 + int ret = snd_pcm_lib_ioctl(substream, cmd, arg);
8831 + audio_info(" .. substream=%p, cmd=%d, arg=%p (%x) ret=%d\n", substream,
8832 + cmd, arg, arg ? *(unsigned *)arg : 0, ret);
8837 +static struct snd_pcm_ops snd_bcm2835_playback_ops = {
8838 + .open = snd_bcm2835_playback_open,
8839 + .close = snd_bcm2835_playback_close,
8840 + .ioctl = snd_bcm2835_pcm_lib_ioctl,
8841 + .hw_params = snd_bcm2835_pcm_hw_params,
8842 + .hw_free = snd_bcm2835_pcm_hw_free,
8843 + .prepare = snd_bcm2835_pcm_prepare,
8844 + .trigger = snd_bcm2835_pcm_trigger,
8845 + .pointer = snd_bcm2835_pcm_pointer,
8846 + .copy = snd_bcm2835_pcm_copy,
8847 + .silence = snd_bcm2835_pcm_silence,
8850 +/* create a pcm device */
8851 +int __devinit snd_bcm2835_new_pcm(bcm2835_chip_t * chip)
8853 + struct snd_pcm *pcm;
8856 + audio_info(" .. IN\n");
8858 + snd_pcm_new(chip->card, "bcm2835 ALSA", 0, MAX_SUBSTREAMS, 0, &pcm);
8861 + pcm->private_data = chip;
8862 + strcpy(pcm->name, "bcm2835 ALSA");
8864 + chip->dest = AUDIO_DEST_AUTO;
8865 + chip->volume = 100;
8866 + /* set operators */
8867 + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
8868 + &snd_bcm2835_playback_ops);
8870 + /* pre-allocation of buffers */
8871 + /* NOTE: this may fail */
8872 + snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
8873 + snd_dma_continuous_data
8874 + (GFP_KERNEL), 64 * 1024,
8877 + audio_info(" .. OUT\n");
8882 +++ b/sound/arm/bcm2835-vchiq.c
8884 +/*****************************************************************************
8885 +* Copyright 2011 Broadcom Corporation. All rights reserved.
8887 +* Unless you and Broadcom execute a separate written software license
8888 +* agreement governing use of this software, this software is licensed to you
8889 +* under the terms of the GNU General Public License version 2, available at
8890 +* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
8892 +* Notwithstanding the above, under no circumstances may you combine this
8893 +* software in any way with any other Broadcom software provided under a
8894 +* license other than the GPL, without Broadcom's express prior written
8896 +*****************************************************************************/
8898 +#include <linux/device.h>
8899 +#include <sound/core.h>
8900 +#include <sound/initval.h>
8901 +#include <sound/pcm.h>
8902 +#include <linux/io.h>
8903 +#include <linux/interrupt.h>
8904 +#include <linux/fs.h>
8905 +#include <linux/file.h>
8906 +#include <linux/mm.h>
8907 +#include <linux/syscalls.h>
8908 +#include <asm/uaccess.h>
8909 +#include <linux/slab.h>
8910 +#include <linux/delay.h>
8911 +#include <linux/atomic.h>
8913 +#include "bcm2835.h"
8915 +/* ---- Include Files -------------------------------------------------------- */
8917 +#include "interface/vchi/vchi.h"
8918 +#include "interface/vcos/vcos.h"
8919 +#include "interface/vcos/vcos_logging.h"
8920 +#include "vc_vchi_audioserv_defs.h"
8922 +/* ---- Private Constants and Types ------------------------------------------ */
8924 +/* VCOS logging category for this service */
8925 +#define VCOS_LOG_CATEGORY (&audio_log_category)
8927 +/* Default VCOS logging level */
8928 +#define LOG_LEVEL VCOS_LOG_WARN
8930 +/* Logging macros (for remapping to other logging mechanisms, i.e., printf) */
8931 +#define LOG_ERR( fmt, arg... ) vcos_log_error( "%s:%d " fmt, __func__, __LINE__, ##arg)
8932 +#define LOG_WARN( fmt, arg... ) vcos_log_warn( "%s:%d " fmt, __func__, __LINE__, ##arg)
8933 +#define LOG_INFO( fmt, arg... ) vcos_log_info( "%s:%d " fmt, __func__, __LINE__, ##arg)
8934 +#define LOG_DBG( fmt, arg... ) vcos_log_info( "%s:%d " fmt, __func__, __LINE__, ##arg)
8936 +typedef struct opaque_AUDIO_INSTANCE_T {
8937 + uint32_t num_connections;
8938 + VCHI_SERVICE_HANDLE_T vchi_handle[VCHI_MAX_NUM_CONNECTIONS];
8939 + VCOS_EVENT_T msg_avail_event;
8940 + VCOS_MUTEX_T vchi_mutex;
8941 + bcm2835_alsa_stream_t *alsa_stream;
8942 + int32_t result, got_result;
8943 +} AUDIO_INSTANCE_T;
8945 +/* ---- Private Variables ---------------------------------------------------- */
8947 +/* VCOS logging category for this service */
8948 +static VCOS_LOG_CAT_T audio_log_category;
8950 +/* ---- Private Function Prototypes ------------------------------------------ */
8952 +/* ---- Private Functions ---------------------------------------------------- */
8954 +static int bcm2835_audio_stop_worker(bcm2835_alsa_stream_t * alsa_stream);
8955 +static int bcm2835_audio_start_worker(bcm2835_alsa_stream_t * alsa_stream);
8958 + struct work_struct my_work;
8959 + bcm2835_alsa_stream_t *alsa_stream;
8963 +static void my_wq_function(struct work_struct *work)
8965 + my_work_t *w = (my_work_t *) work;
8967 + LOG_DBG(" .. IN %p:%d\n", w->alsa_stream, w->x);
8970 + ret = bcm2835_audio_start_worker(w->alsa_stream);
8973 + ret = bcm2835_audio_stop_worker(w->alsa_stream);
8976 + LOG_ERR(" Unexpected work: %p:%d\n", w->alsa_stream, w->x);
8979 + kfree((void *)work);
8980 + LOG_DBG(" .. OUT %d\n", ret);
8983 +int bcm2835_audio_start(bcm2835_alsa_stream_t * alsa_stream)
8986 + LOG_DBG(" .. IN\n");
8987 + if (alsa_stream->my_wq) {
8988 + my_work_t *work = kmalloc(sizeof(my_work_t), GFP_KERNEL);
8989 + /* Queue some work (item 1) */
8991 + INIT_WORK((struct work_struct *)work, my_wq_function);
8992 + work->alsa_stream = alsa_stream;
8995 + (alsa_stream->my_wq, (struct work_struct *)work))
8998 + LOG_ERR(" .. Error: NULL work kmalloc\n");
9000 + LOG_DBG(" .. OUT %d\n", ret);
9004 +int bcm2835_audio_stop(bcm2835_alsa_stream_t * alsa_stream)
9007 + LOG_DBG(" .. IN\n");
9008 + if (alsa_stream->my_wq) {
9009 + my_work_t *work = kmalloc(sizeof(my_work_t), GFP_KERNEL);
9010 + /* Queue some work (item 1) */
9012 + INIT_WORK((struct work_struct *)work, my_wq_function);
9013 + work->alsa_stream = alsa_stream;
9016 + (alsa_stream->my_wq, (struct work_struct *)work))
9019 + LOG_ERR(" .. Error: NULL work kmalloc\n");
9021 + LOG_DBG(" .. OUT %d\n", ret);
9025 +void my_workqueue_init(bcm2835_alsa_stream_t * alsa_stream)
9027 + alsa_stream->my_wq = create_workqueue("my_queue");
9030 +void my_workqueue_quit(bcm2835_alsa_stream_t * alsa_stream)
9032 + if (alsa_stream->my_wq) {
9033 + flush_workqueue(alsa_stream->my_wq);
9034 + destroy_workqueue(alsa_stream->my_wq);
9035 + alsa_stream->my_wq = NULL;
9039 +static void audio_vchi_callback(void *param,
9040 + const VCHI_CALLBACK_REASON_T reason,
9043 + AUDIO_INSTANCE_T *instance = (AUDIO_INSTANCE_T *) param;
9047 + bcm2835_alsa_stream_t *alsa_stream = 0;
9048 + LOG_DBG(" .. IN instance=%p, param=%p, reason=%d, handle=%p\n",
9049 + instance, param, reason, msg_handle);
9051 + if (!instance || reason != VCHI_CALLBACK_MSG_AVAILABLE) {
9054 + alsa_stream = instance->alsa_stream;
9055 + status = vchi_msg_dequeue(instance->vchi_handle[0],
9056 + &m, sizeof m, &msg_len, VCHI_FLAGS_NONE);
9057 + if (m.type == VC_AUDIO_MSG_TYPE_RESULT) {
9059 + (" .. instance=%p, m.type=VC_AUDIO_MSG_TYPE_RESULT, success=%d\n",
9060 + instance, m.u.result.success);
9061 + BUG_ON(instance->got_result);
9062 + instance->result = m.u.result.success;
9063 + instance->got_result = 1;
9064 + vcos_event_signal(&instance->msg_avail_event);
9065 + } else if (m.type == VC_AUDIO_MSG_TYPE_COMPLETE) {
9066 + irq_handler_t callback = (irq_handler_t) m.u.complete.callback;
9068 + (" .. instance=%p, m.type=VC_AUDIO_MSG_TYPE_COMPLETE, complete=%d\n",
9069 + instance, m.u.complete.count);
9070 + if (alsa_stream && callback) {
9071 + atomic_add(m.u.complete.count, &alsa_stream->retrieved);
9072 + callback(0, alsa_stream);
9074 + LOG_DBG(" .. unexpected alsa_stream=%p, callback=%p\n",
9075 + alsa_stream, callback);
9077 + vcos_event_signal(&instance->msg_avail_event);
9079 + LOG_DBG(" .. unexpected m.type=%d\n", m.type);
9083 +static AUDIO_INSTANCE_T *vc_vchi_audio_init(VCHI_INSTANCE_T vchi_instance,
9084 + VCHI_CONNECTION_T **
9086 + uint32_t num_connections)
9089 + AUDIO_INSTANCE_T *instance;
9090 + VCOS_STATUS_T status;
9092 + LOG_DBG("%s: start", __func__);
9094 + if (num_connections > VCHI_MAX_NUM_CONNECTIONS) {
9095 + LOG_ERR("%s: unsupported number of connections %u (max=%u)",
9096 + __func__, num_connections, VCHI_MAX_NUM_CONNECTIONS);
9100 + /* Allocate memory for this instance */
9101 + instance = vcos_malloc(sizeof(*instance), "audio_instance");
9102 + memset(instance, 0, sizeof(*instance));
9104 + instance->num_connections = num_connections;
9105 + /* Create the message available event */
9107 + vcos_event_create(&instance->msg_avail_event, "audio_msg_avail");
9108 + if (status != VCOS_SUCCESS) {
9109 + LOG_ERR("%s: failed to create event (status=%d)", __func__,
9112 + goto err_free_mem;
9114 + /* Create a lock for exclusive, serialized VCHI connection access */
9115 + status = vcos_mutex_create(&instance->vchi_mutex, "audio_vchi_mutex");
9116 + if (status != VCOS_SUCCESS) {
9117 + LOG_ERR("%s: failed to create event (status=%d)", __func__,
9120 + goto err_delete_event;
9122 + /* Open the VCHI service connections */
9123 + for (i = 0; i < num_connections; i++) {
9124 + SERVICE_CREATION_T params = {
9125 + VC_AUDIO_SERVER_NAME, // 4cc service code
9126 + vchi_connections[i], // passed in fn pointers
9127 + 0, // rx fifo size (unused)
9128 + 0, // tx fifo size (unused)
9129 + audio_vchi_callback, // service callback
9130 + instance, // service callback parameter
9131 + VCOS_TRUE, //TODO: remove VCOS_FALSE, // unaligned bulk recieves
9132 + VCOS_TRUE, //TODO: remove VCOS_FALSE, // unaligned bulk transmits
9133 + VCOS_FALSE // want crc check on bulk transfers
9136 + status = vchi_service_open(vchi_instance, ¶ms,
9137 + &instance->vchi_handle[i]);
9138 + if (status != VCOS_SUCCESS) {
9140 + ("%s: failed to open VCHI service connection (status=%d)",
9141 + __func__, status);
9143 + goto err_close_services;
9145 + /* Finished with the service for now */
9146 + vchi_service_release(instance->vchi_handle[i]);
9151 +err_close_services:
9152 + for (i = 0; i < instance->num_connections; i++) {
9153 + vchi_service_close(instance->vchi_handle[i]);
9156 + vcos_mutex_delete(&instance->vchi_mutex);
9159 + vcos_event_delete(&instance->msg_avail_event);
9162 + vcos_free(instance);
9167 +static int32_t vc_vchi_audio_deinit(AUDIO_INSTANCE_T * instance)
9171 + LOG_DBG(" .. IN\n");
9173 + if (instance == NULL) {
9174 + LOG_ERR("%s: invalid handle %p", __func__, instance);
9179 + LOG_DBG(" .. about to lock (%d)\n", instance->num_connections);
9180 + vcos_mutex_lock(&instance->vchi_mutex);
9182 + /* Close all VCHI service connections */
9183 + for (i = 0; i < instance->num_connections; i++) {
9185 + LOG_DBG(" .. %i:closing %p\n", i, instance->vchi_handle[i]);
9186 + vchi_service_use(instance->vchi_handle[i]);
9188 + success = vchi_service_close(instance->vchi_handle[i]);
9189 + if (success != 0) {
9191 + ("%s: failed to close VCHI service connection (status=%d)",
9192 + __func__, success);
9196 + vcos_mutex_unlock(&instance->vchi_mutex);
9198 + vcos_mutex_delete(&instance->vchi_mutex);
9200 + vcos_event_delete(&instance->msg_avail_event);
9202 + vcos_free(instance);
9204 + /* Unregister the log category so we can add it back next time */
9205 + vcos_log_unregister(&audio_log_category);
9207 + LOG_DBG(" .. OUT\n");
9212 +static int bcm2835_audio_open_connection(bcm2835_alsa_stream_t * alsa_stream)
9214 + static VCHI_INSTANCE_T vchi_instance;
9215 + static VCHI_CONNECTION_T *vchi_connection;
9216 + AUDIO_INSTANCE_T *instance = alsa_stream->instance;
9218 + LOG_DBG(" .. IN\n");
9220 + LOG_INFO("%s: start", __func__);
9221 + //BUG_ON(instance);
9223 + LOG_ERR("%s: VCHI instance already open (%p)",
9224 + __func__, instance);
9225 + instance->alsa_stream = alsa_stream;
9226 + alsa_stream->instance = instance;
9227 + ret = 0; // xxx todo -1;
9228 + goto err_free_mem;
9231 + /* Initialize and create a VCHI connection */
9232 + ret = vchi_initialise(&vchi_instance);
9234 + LOG_ERR("%s: failed to initialise VCHI instance (ret=%d)",
9238 + goto err_free_mem;
9240 + ret = vchi_connect(NULL, 0, vchi_instance);
9242 + LOG_ERR("%s: failed to connect VCHI instance (ret=%d)",
9246 + goto err_free_mem;
9249 + /* Set up the VCOS logging */
9250 + vcos_log_set_level(VCOS_LOG_CATEGORY, LOG_LEVEL);
9251 + vcos_log_register("audio", VCOS_LOG_CATEGORY);
9253 + /* Initialize an instance of the audio service */
9254 + instance = vc_vchi_audio_init(vchi_instance, &vchi_connection, 1);
9256 + if (instance == NULL /*|| audio_handle != instance */ ) {
9257 + LOG_ERR("%s: failed to initialize audio service", __func__);
9260 + goto err_free_mem;
9263 + instance->alsa_stream = alsa_stream;
9264 + alsa_stream->instance = instance;
9266 + LOG_DBG(" success !\n");
9268 + LOG_DBG(" .. OUT\n");
9273 +int bcm2835_audio_open(bcm2835_alsa_stream_t * alsa_stream)
9275 + AUDIO_INSTANCE_T *instance;
9279 + LOG_DBG(" .. IN\n");
9281 + my_workqueue_init(alsa_stream);
9283 + ret = bcm2835_audio_open_connection(alsa_stream);
9288 + instance = alsa_stream->instance;
9290 + vcos_mutex_lock(&instance->vchi_mutex);
9291 + vchi_service_use(instance->vchi_handle[0]);
9293 + m.type = VC_AUDIO_MSG_TYPE_OPEN;
9295 + /* Send the message to the videocore */
9296 + success = vchi_msg_queue(instance->vchi_handle[0],
9298 + VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
9300 + if (success != 0) {
9301 + LOG_ERR("%s: failed on vchi_msg_queue (status=%d)",
9302 + __func__, success);
9311 + vchi_service_release(instance->vchi_handle[0]);
9312 + vcos_mutex_unlock(&instance->vchi_mutex);
9314 + LOG_DBG(" .. OUT\n");
9318 +static int bcm2835_audio_set_ctls_chan(bcm2835_alsa_stream_t * alsa_stream,
9319 + bcm2835_chip_t * chip)
9322 + AUDIO_INSTANCE_T *instance = alsa_stream->instance;
9325 + LOG_DBG(" .. IN\n");
9328 + (" Setting ALSA dest(%d), volume(%d)\n", chip->dest, chip->volume);
9330 + vcos_mutex_lock(&instance->vchi_mutex);
9331 + vchi_service_use(instance->vchi_handle[0]);
9333 + instance->got_result = 0;
9334 + instance->result = -1;
9336 + m.type = VC_AUDIO_MSG_TYPE_CONTROL;
9337 + m.u.control.dest = chip->dest;
9338 + m.u.control.volume = chip->volume;
9340 + /* Send the message to the videocore */
9341 + success = vchi_msg_queue(instance->vchi_handle[0],
9343 + VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
9345 + if (success != 0) {
9346 + LOG_ERR("%s: failed on vchi_msg_queue (status=%d)",
9347 + __func__, success);
9353 + /* We are expecting a reply from the videocore */
9354 + while (!instance->got_result) {
9355 + success = vcos_event_wait(&instance->msg_avail_event);
9356 + if (success != VCOS_SUCCESS) {
9357 + LOG_ERR("%s: failed on waiting for event (status=%d)",
9358 + __func__, success);
9365 + if (instance->result != 0) {
9366 + LOG_ERR("%s: result=%d", __func__, instance->result);
9375 + vchi_service_release(instance->vchi_handle[0]);
9376 + vcos_mutex_unlock(&instance->vchi_mutex);
9378 + LOG_DBG(" .. OUT\n");
9382 +int bcm2835_audio_set_ctls(bcm2835_chip_t * chip)
9386 + LOG_DBG(" .. IN\n");
9387 + /* change ctls for all substreams */
9388 + for (i = 0; i < MAX_SUBSTREAMS; i++) {
9389 + if (chip->avail_substreams & (1 << i)) {
9390 + if (!chip->alsa_stream[i])
9392 + else if (bcm2835_audio_set_ctls_chan
9393 + (chip->alsa_stream[i], chip) != 0)
9397 + LOG_DBG(" .. OUT ret=%d\n", ret);
9401 +int bcm2835_audio_set_params(bcm2835_alsa_stream_t * alsa_stream,
9402 + uint32_t channels, uint32_t samplerate,
9406 + AUDIO_INSTANCE_T *instance = alsa_stream->instance;
9409 + LOG_DBG(" .. IN\n");
9412 + (" Setting ALSA channels(%d), samplerate(%d), bits-per-sample(%d)\n",
9413 + channels, samplerate, bps);
9415 + /* resend ctls - alsa_stream may not have been open when first send */
9416 + ret = bcm2835_audio_set_ctls_chan(alsa_stream, alsa_stream->chip);
9418 + LOG_ERR(" Alsa controls not supported\n");
9422 + vcos_mutex_lock(&instance->vchi_mutex);
9423 + vchi_service_use(instance->vchi_handle[0]);
9425 + instance->got_result = 0;
9426 + instance->result = -1;
9428 + m.type = VC_AUDIO_MSG_TYPE_CONFIG;
9429 + m.u.config.channels = channels;
9430 + m.u.config.samplerate = samplerate;
9431 + m.u.config.bps = bps;
9433 + /* Send the message to the videocore */
9434 + success = vchi_msg_queue(instance->vchi_handle[0],
9436 + VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
9438 + if (success != 0) {
9439 + LOG_ERR("%s: failed on vchi_msg_queue (status=%d)",
9440 + __func__, success);
9446 + /* We are expecting a reply from the videocore */
9447 + while (!instance->got_result) {
9448 + success = vcos_event_wait(&instance->msg_avail_event);
9449 + if (success != VCOS_SUCCESS) {
9450 + LOG_ERR("%s: failed on waiting for event (status=%d)",
9451 + __func__, success);
9458 + if (instance->result != 0) {
9459 + LOG_ERR("%s: result=%d", __func__, instance->result);
9468 + vchi_service_release(instance->vchi_handle[0]);
9469 + vcos_mutex_unlock(&instance->vchi_mutex);
9471 + LOG_DBG(" .. OUT\n");
9475 +int bcm2835_audio_setup(bcm2835_alsa_stream_t * alsa_stream)
9477 + LOG_DBG(" .. IN\n");
9479 + LOG_DBG(" .. OUT\n");
9484 +static int bcm2835_audio_start_worker(bcm2835_alsa_stream_t * alsa_stream)
9487 + AUDIO_INSTANCE_T *instance = alsa_stream->instance;
9490 + LOG_DBG(" .. IN\n");
9492 + vcos_mutex_lock(&instance->vchi_mutex);
9493 + vchi_service_use(instance->vchi_handle[0]);
9495 + m.type = VC_AUDIO_MSG_TYPE_START;
9497 + /* Send the message to the videocore */
9498 + success = vchi_msg_queue(instance->vchi_handle[0],
9500 + VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
9502 + if (success != 0) {
9503 + LOG_ERR("%s: failed on vchi_msg_queue (status=%d)",
9504 + __func__, success);
9513 + vchi_service_release(instance->vchi_handle[0]);
9514 + vcos_mutex_unlock(&instance->vchi_mutex);
9515 + LOG_DBG(" .. OUT\n");
9519 +static int bcm2835_audio_stop_worker(bcm2835_alsa_stream_t * alsa_stream)
9522 + AUDIO_INSTANCE_T *instance = alsa_stream->instance;
9525 + LOG_DBG(" .. IN\n");
9527 + vcos_mutex_lock(&instance->vchi_mutex);
9528 + vchi_service_use(instance->vchi_handle[0]);
9530 + m.type = VC_AUDIO_MSG_TYPE_STOP;
9531 + m.u.stop.draining = alsa_stream->draining;
9533 + /* Send the message to the videocore */
9534 + success = vchi_msg_queue(instance->vchi_handle[0],
9536 + VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
9538 + if (success != 0) {
9539 + LOG_ERR("%s: failed on vchi_msg_queue (status=%d)",
9540 + __func__, success);
9549 + vchi_service_release(instance->vchi_handle[0]);
9550 + vcos_mutex_unlock(&instance->vchi_mutex);
9551 + LOG_DBG(" .. OUT\n");
9555 +int bcm2835_audio_close(bcm2835_alsa_stream_t * alsa_stream)
9558 + AUDIO_INSTANCE_T *instance = alsa_stream->instance;
9561 + LOG_DBG(" .. IN\n");
9563 + my_workqueue_quit(alsa_stream);
9565 + vcos_mutex_lock(&instance->vchi_mutex);
9566 + vchi_service_use(instance->vchi_handle[0]);
9568 + m.type = VC_AUDIO_MSG_TYPE_CLOSE;
9569 + instance->got_result = 0;
9570 + /* Send the message to the videocore */
9571 + success = vchi_msg_queue(instance->vchi_handle[0],
9573 + VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
9575 + if (success != 0) {
9576 + LOG_ERR("%s: failed on vchi_msg_queue (status=%d)",
9577 + __func__, success);
9581 + while (!instance->got_result) {
9582 + success = vcos_event_wait(&instance->msg_avail_event);
9583 + if (success != VCOS_SUCCESS) {
9584 + LOG_ERR("%s: failed on waiting for event (status=%d)",
9585 + __func__, success);
9591 + if (instance->result != 0) {
9592 + LOG_ERR("%s: failed result (status=%d)",
9593 + __func__, instance->result);
9602 + vchi_service_release(instance->vchi_handle[0]);
9603 + vcos_mutex_unlock(&instance->vchi_mutex);
9605 + /* Stop the audio service */
9607 + vc_vchi_audio_deinit(instance);
9608 + alsa_stream->instance = NULL;
9610 + LOG_DBG(" .. OUT\n");
9614 +int bcm2835_audio_write(bcm2835_alsa_stream_t * alsa_stream, uint32_t count,
9618 + AUDIO_INSTANCE_T *instance = alsa_stream->instance;
9622 + LOG_DBG(" .. IN\n");
9624 + LOG_INFO(" Writing %d bytes from %p\n", count, src);
9626 + vcos_mutex_lock(&instance->vchi_mutex);
9627 + vchi_service_use(instance->vchi_handle[0]);
9629 + m.type = VC_AUDIO_MSG_TYPE_WRITE;
9630 + m.u.write.count = count;
9631 + m.u.write.callback = alsa_stream->fifo_irq_handler;
9632 + m.u.write.cookie = alsa_stream;
9633 + m.u.write.silence = src == NULL;
9635 + /* Send the message to the videocore */
9636 + success = vchi_msg_queue(instance->vchi_handle[0],
9638 + VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL);
9640 + if (success != 0) {
9641 + LOG_ERR("%s: failed on vchi_msg_queue (status=%d)",
9642 + __func__, success);
9647 + LOG_DBG(" ... sent header\n");
9648 + if (!m.u.write.silence) {
9649 + /* Send the message to the videocore */
9650 + success = vchi_bulk_queue_transmit(instance->vchi_handle[0],
9653 + VCHI_FLAGS_BLOCK_UNTIL_QUEUED
9656 + VCHI_FLAGS_BLOCK_UNTIL_DATA_READ,
9658 + if (success != 0) {
9660 + ("%s: failed on vchi_bulk_queue_transmit (status=%d)",
9661 + __func__, success);
9670 + vchi_service_release(instance->vchi_handle[0]);
9671 + vcos_mutex_unlock(&instance->vchi_mutex);
9672 + LOG_DBG(" .. OUT\n");
9677 + * Returns all buffers from arm->vc
9679 +void bcm2835_audio_flush_buffers(bcm2835_alsa_stream_t * alsa_stream)
9681 + LOG_DBG(" .. IN\n");
9682 + LOG_DBG(" .. OUT\n");
9687 + * Forces VC to flush(drop) its filled playback buffers and
9688 + * return them the us. (VC->ARM)
9690 +void bcm2835_audio_flush_playback_buffers(bcm2835_alsa_stream_t * alsa_stream)
9692 + LOG_DBG(" .. IN\n");
9693 + LOG_DBG(" .. OUT\n");
9696 +uint32_t bcm2835_audio_retrieve_buffers(bcm2835_alsa_stream_t * alsa_stream)
9698 + uint32_t count = atomic_read(&alsa_stream->retrieved);
9699 + atomic_sub(count, &alsa_stream->retrieved);
9703 +++ b/sound/arm/bcm2835.c
9705 +/*****************************************************************************
9706 +* Copyright 2011 Broadcom Corporation. All rights reserved.
9708 +* Unless you and Broadcom execute a separate written software license
9709 +* agreement governing use of this software, this software is licensed to you
9710 +* under the terms of the GNU General Public License version 2, available at
9711 +* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
9713 +* Notwithstanding the above, under no circumstances may you combine this
9714 +* software in any way with any other Broadcom software provided under a
9715 +* license other than the GPL, without Broadcom's express prior written
9717 +*****************************************************************************/
9719 +#include <linux/platform_device.h>
9721 +#include <linux/init.h>
9722 +#include <linux/slab.h>
9723 +#include <linux/module.h>
9725 +#include "bcm2835.h"
9727 +/* module parameters (see "Module Parameters") */
9728 +/* SNDRV_CARDS: maximum number of cards supported by this module */
9729 +static int index[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = -1 };
9730 +static char *id[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = NULL };
9731 +static int enable[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = 1 };
9733 +/* HACKY global pointers needed for successive probes to work : ssp
9734 + * But compared against the changes we will have to do in VC audio_ipc code
9735 + * to export 8 audio_ipc devices as a single IPC device and then monitor all
9736 + * four devices in a thread, this gets things done quickly and should be easier
9737 + * to debug if we run into issues
9740 +static struct snd_card *g_card = NULL;
9741 +static bcm2835_chip_t *g_chip = NULL;
9743 +static int snd_bcm2835_free(bcm2835_chip_t * chip)
9749 +/* component-destructor
9750 + * (see "Management of Cards and Components")
9752 +static int snd_bcm2835_dev_free(struct snd_device *device)
9754 + return snd_bcm2835_free(device->device_data);
9757 +/* chip-specific constructor
9758 + * (see "Management of Cards and Components")
9760 +static int __devinit snd_bcm2835_create(struct snd_card *card,
9761 + struct platform_device *pdev,
9762 + bcm2835_chip_t ** rchip)
9764 + bcm2835_chip_t *chip;
9766 + static struct snd_device_ops ops = {
9767 + .dev_free = snd_bcm2835_dev_free,
9772 + chip = kzalloc(sizeof(*chip), GFP_KERNEL);
9776 + chip->card = card;
9778 + err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
9780 + snd_bcm2835_free(chip);
9788 +static int __devinit snd_bcm2835_alsa_probe(struct platform_device *pdev)
9791 + bcm2835_chip_t *chip;
9792 + struct snd_card *card;
9794 + printk(KERN_INFO "### snd_bcm2835_alsa_probe %p ###", pdev);
9797 + ("############ PROBING FOR bcm2835 ALSA device (%d):(%d) ###############\n",
9798 + dev, enable[dev]);
9800 + if (dev >= MAX_SUBSTREAMS)
9803 + if (!enable[dev]) {
9809 + goto add_register_map;
9811 + printk("Creating card...\n");
9812 + err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &g_card);
9816 + snd_card_set_dev(g_card, &pdev->dev);
9817 + strcpy(g_card->driver, "BRCM bcm2835 ALSA Driver");
9818 + strcpy(g_card->shortname, "bcm2835 ALSA");
9819 + sprintf(g_card->longname, "%s", g_card->shortname);
9821 + printk("Creating device/chip ..\n");
9822 + err = snd_bcm2835_create(g_card, pdev, &chip);
9824 + printk(KERN_ERR "Failed to create bcm2835 chip\n");
9825 + goto out_bcm2835_create;
9829 + err = snd_bcm2835_new_pcm(chip);
9831 + printk(KERN_ERR "Failed to create new BCM2835 pcm device\n");
9832 + goto out_bcm2835_new_pcm;
9835 + printk("Adding controls ..\n");
9836 + err = snd_bcm2835_new_ctl(chip);
9838 + printk(KERN_ERR "Failed to create new BCM2835 ctl\n");
9839 + goto out_bcm2835_new_ctl;
9846 + BUG_ON(!(card && chip));
9848 + chip->avail_substreams |= (1 << dev);
9849 + chip->pdev[dev] = pdev;
9852 + printk("Registering card ....\n");
9853 + err = snd_card_register(card);
9856 + "Failed to register bcm2835 ALSA card \n");
9857 + goto out_card_register;
9859 + platform_set_drvdata(pdev, card);
9860 + printk("bcm2835 ALSA CARD CREATED!\n");
9862 + printk("bcm2835 ALSA CHIP CREATED!\n");
9863 + platform_set_drvdata(pdev, (void *)dev);
9871 +out_bcm2835_new_ctl:
9872 +out_bcm2835_new_pcm:
9873 +out_bcm2835_create:
9875 + if (snd_card_free(g_card))
9876 + printk(KERN_ERR "Failed to free Registered alsa card\n");
9879 + dev = SNDRV_CARDS; /* stop more avail_substreams from being probed */
9880 + printk(KERN_ERR "BCM2835 ALSA Probe failed !!\n");
9884 +static int snd_bcm2835_alsa_remove(struct platform_device *pdev)
9889 + drv_data = platform_get_drvdata(pdev);
9891 + if (drv_data == (void *)g_card) {
9892 + /* This is the card device */
9893 + snd_card_free((struct snd_card *)drv_data);
9897 + idx = (uint32_t) drv_data;
9898 + if (g_card != NULL) {
9900 + /* We pass chip device numbers in audio ipc devices
9901 + * other than the one we registered our card with
9903 + idx = (uint32_t) drv_data;
9904 + BUG_ON(!idx || idx > MAX_SUBSTREAMS);
9905 + g_chip->avail_substreams &= ~(1 << idx);
9906 + /* There should be atleast one substream registered
9907 + * after we are done here, as it wil be removed when
9908 + * the *remove* is called for the card device
9910 + BUG_ON(!g_chip->avail_substreams);
9914 + platform_set_drvdata(pdev, NULL);
9920 +static int snd_bcm2835_alsa_suspend(struct platform_device *pdev,
9921 + pm_message_t state)
9926 +static int snd_bcm2835_alsa_resume(struct platform_device *pdev)
9933 +static struct platform_driver bcm2835_alsa0_driver = {
9934 + .probe = snd_bcm2835_alsa_probe,
9935 + .remove = snd_bcm2835_alsa_remove,
9937 + .suspend = snd_bcm2835_alsa_suspend,
9938 + .resume = snd_bcm2835_alsa_resume,
9941 + .name = "bcm2835_AUD0",
9942 + .owner = THIS_MODULE,
9946 +static struct platform_driver bcm2835_alsa1_driver = {
9947 + .probe = snd_bcm2835_alsa_probe,
9948 + .remove = snd_bcm2835_alsa_remove,
9950 + .suspend = snd_bcm2835_alsa_suspend,
9951 + .resume = snd_bcm2835_alsa_resume,
9954 + .name = "bcm2835_AUD1",
9955 + .owner = THIS_MODULE,
9959 +static struct platform_driver bcm2835_alsa2_driver = {
9960 + .probe = snd_bcm2835_alsa_probe,
9961 + .remove = snd_bcm2835_alsa_remove,
9963 + .suspend = snd_bcm2835_alsa_suspend,
9964 + .resume = snd_bcm2835_alsa_resume,
9967 + .name = "bcm2835_AUD2",
9968 + .owner = THIS_MODULE,
9972 +static struct platform_driver bcm2835_alsa3_driver = {
9973 + .probe = snd_bcm2835_alsa_probe,
9974 + .remove = snd_bcm2835_alsa_remove,
9976 + .suspend = snd_bcm2835_alsa_suspend,
9977 + .resume = snd_bcm2835_alsa_resume,
9980 + .name = "bcm2835_AUD3",
9981 + .owner = THIS_MODULE,
9985 +static struct platform_driver bcm2835_alsa4_driver = {
9986 + .probe = snd_bcm2835_alsa_probe,
9987 + .remove = snd_bcm2835_alsa_remove,
9989 + .suspend = snd_bcm2835_alsa_suspend,
9990 + .resume = snd_bcm2835_alsa_resume,
9993 + .name = "bcm2835_AUD4",
9994 + .owner = THIS_MODULE,
9998 +static struct platform_driver bcm2835_alsa5_driver = {
9999 + .probe = snd_bcm2835_alsa_probe,
10000 + .remove = snd_bcm2835_alsa_remove,
10002 + .suspend = snd_bcm2835_alsa_suspend,
10003 + .resume = snd_bcm2835_alsa_resume,
10006 + .name = "bcm2835_AUD5",
10007 + .owner = THIS_MODULE,
10011 +static struct platform_driver bcm2835_alsa6_driver = {
10012 + .probe = snd_bcm2835_alsa_probe,
10013 + .remove = snd_bcm2835_alsa_remove,
10015 + .suspend = snd_bcm2835_alsa_suspend,
10016 + .resume = snd_bcm2835_alsa_resume,
10019 + .name = "bcm2835_AUD6",
10020 + .owner = THIS_MODULE,
10024 +static struct platform_driver bcm2835_alsa7_driver = {
10025 + .probe = snd_bcm2835_alsa_probe,
10026 + .remove = snd_bcm2835_alsa_remove,
10028 + .suspend = snd_bcm2835_alsa_suspend,
10029 + .resume = snd_bcm2835_alsa_resume,
10032 + .name = "bcm2835_AUD7",
10033 + .owner = THIS_MODULE,
10037 +static int __devinit bcm2835_alsa_device_init(void)
10040 + err = platform_driver_register(&bcm2835_alsa0_driver);
10042 + printk("Error registering bcm2835_alsa0_driver %d .\n", err);
10046 + err = platform_driver_register(&bcm2835_alsa1_driver);
10048 + printk("Error registering bcm2835_alsa1_driver %d .\n", err);
10049 + goto unregister_0;
10052 + err = platform_driver_register(&bcm2835_alsa2_driver);
10054 + printk("Error registering bcm2835_alsa2_driver %d .\n", err);
10055 + goto unregister_1;
10058 + err = platform_driver_register(&bcm2835_alsa3_driver);
10060 + printk("Error registering bcm2835_alsa3_driver %d .\n", err);
10061 + goto unregister_2;
10064 + err = platform_driver_register(&bcm2835_alsa4_driver);
10066 + printk("Error registering bcm2835_alsa4_driver %d .\n", err);
10067 + goto unregister_3;
10070 + err = platform_driver_register(&bcm2835_alsa5_driver);
10072 + printk("Error registering bcm2835_alsa5_driver %d .\n", err);
10073 + goto unregister_4;
10076 + err = platform_driver_register(&bcm2835_alsa6_driver);
10078 + printk("Error registering bcm2835_alsa6_driver %d .\n", err);
10079 + goto unregister_5;
10082 + err = platform_driver_register(&bcm2835_alsa7_driver);
10084 + printk("Error registering bcm2835_alsa7_driver %d .\n", err);
10085 + goto unregister_6;
10087 + printk(KERN_INFO "### BCM2835 ALSA driver init %s ### \n",
10088 + err ? "FAILED" : "OK");
10093 + platform_driver_unregister(&bcm2835_alsa6_driver);
10095 + platform_driver_unregister(&bcm2835_alsa5_driver);
10097 + platform_driver_unregister(&bcm2835_alsa4_driver);
10099 + platform_driver_unregister(&bcm2835_alsa3_driver);
10101 + platform_driver_unregister(&bcm2835_alsa2_driver);
10103 + platform_driver_unregister(&bcm2835_alsa1_driver);
10105 + platform_driver_unregister(&bcm2835_alsa0_driver);
10110 +static void __devexit bcm2835_alsa_device_exit(void)
10112 + platform_driver_unregister(&bcm2835_alsa0_driver);
10113 + platform_driver_unregister(&bcm2835_alsa1_driver);
10114 + platform_driver_unregister(&bcm2835_alsa2_driver);
10115 + platform_driver_unregister(&bcm2835_alsa3_driver);
10116 + platform_driver_unregister(&bcm2835_alsa4_driver);
10117 + platform_driver_unregister(&bcm2835_alsa5_driver);
10118 + platform_driver_unregister(&bcm2835_alsa6_driver);
10119 + platform_driver_unregister(&bcm2835_alsa7_driver);
10122 +late_initcall(bcm2835_alsa_device_init);
10123 +module_exit(bcm2835_alsa_device_exit);
10125 +MODULE_AUTHOR("Dom Cobley");
10126 +MODULE_DESCRIPTION("Alsa driver for BCM2835 chip");
10127 +MODULE_LICENSE("GPL");
10128 +MODULE_ALIAS("platform:bcm2835_alsa");
10130 +++ b/sound/arm/bcm2835.h
10132 +/*****************************************************************************
10133 +* Copyright 2011 Broadcom Corporation. All rights reserved.
10135 +* Unless you and Broadcom execute a separate written software license
10136 +* agreement governing use of this software, this software is licensed to you
10137 +* under the terms of the GNU General Public License version 2, available at
10138 +* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
10140 +* Notwithstanding the above, under no circumstances may you combine this
10141 +* software in any way with any other Broadcom software provided under a
10142 +* license other than the GPL, without Broadcom's express prior written
10144 +*****************************************************************************/
10146 +#ifndef __SOUND_ARM_BCM2835_H
10147 +#define __SOUND_ARM_BCM2835_H
10149 +#define SUBSTREAM_NUM 1
10151 +#include <linux/device.h>
10152 +#include <linux/list.h>
10153 +#include <linux/interrupt.h>
10154 +#include <linux/wait.h>
10155 +#include <sound/core.h>
10156 +#include <sound/initval.h>
10157 +#include <sound/pcm.h>
10158 +#include <sound/pcm_params.h>
10159 +#include <linux/workqueue.h>
10161 +/* #define DUMP_RAW_DATA */
10162 +//#define AUDIO_DEBUG_ENABLE
10163 +//#define AUDIO_VERBOSE_DEBUG_ENABLE
10165 +/* Debug macros */
10166 +#ifdef AUDIO_DEBUG_ENABLE
10168 +#ifdef AUDIO_VERBOSE_DEBUG_ENABLE
10170 +#define audio_debug(fmt, arg...) \
10171 + printk(KERN_INFO"%s:%d " fmt, __func__, __LINE__, ##arg)
10173 +#define audio_info(fmt, arg...) \
10174 + printk(KERN_INFO"%s:%d " fmt, __func__, __LINE__, ##arg)
10178 +#define audio_debug(fmt, arg...) do {} while (0)
10180 +#define audio_info(fmt, arg...) do {} while (0)
10182 +#endif /* AUDIO_VERBOSE_DEBUG_ENABLE */
10186 +#define audio_debug(fmt, arg...) do {} while (0)
10188 +#define audio_info(fmt, arg...) do {} while (0)
10190 +#endif /* AUDIO_DEBUG_ENABLE */
10192 +#define audio_error(fmt, arg...) \
10193 + printk(KERN_ERR"%s:%d " fmt, __func__, __LINE__, ##arg)
10195 +#define audio_warning(fmt, arg...) \
10196 + printk(KERN_WARNING"%s:%d " fmt, __func__, __LINE__, ##arg)
10198 +#define audio_alert(fmt, arg...) \
10199 + printk(KERN_ALERT"%s:%d " fmt, __func__, __LINE__, ##arg)
10201 +#define MAX_SUBSTREAMS (8)
10202 +#define AVAIL_SUBSTREAMS_MASK (0xff)
10204 +#define AUDIO_IPC_BLOCK_NUM_BUFFERS (8)
10205 +#define AUDIO_IPC_BLOCK_BUFFER_SIZE (1024*8)
10207 +#define AUDIO_CONTROL_OFFSET (0x00)
10208 +#define CTRL_EN_SHIFT (0)
10209 +#define CTRL_EN_MASK (0x00000001)
10210 +#define CTRL_PLAY_SHIFT (1)
10211 +#define CTRL_PLAY_MASK (0x00000002)
10212 +#define CTRL_MUTE_SHIFT (2)
10213 +#define CTRL_MUTE_MASK (0x00000004)
10214 +#define CTRL_SETUP_SHIFT (3)
10215 +#define CTRL_SETUP_MASK (0x00000008)
10216 +#define CTRL_FLUSH_SHIFT (4)
10217 +#define CTRL_FLUSH_MASK (0x00000010)
10218 +#define CTRL_STOPMODE_SHIFT (5)
10219 +#define CTRL_STOPMODE_MASK (0x00000020)
10221 +#define AUDIO_STATUS_OFFSET (0x04)
10222 +#define STAT_EN_SHIFT (0)
10223 +#define STAT_EN_MASK (0x00000001)
10224 +#define STAT_PLAY_SHIFT (1)
10225 +#define STAT_PLAY_MASK (0x00000002)
10226 +#define STAT_MUTE_SHIFT (2)
10227 +#define STAT_MUTE_MASK (0x00000004)
10228 +#define STAT_SETUP_SHIFT (3)
10229 +#define STAT_SETUP_MASK (0x00000008)
10230 +#define STAT_FLUSH_SHIFT (4)
10231 +#define STAT_FLUSH_MASK (0x00000010)
10232 +#define STAT_STOPMODE_SHIFT (5)
10233 +#define STAT_STOPMODE_MASK (0x00000020)
10235 +/* Interrupt status */
10236 +#define AUDIO_INTSTAT_OFFSET (0x08)
10237 +#define INTSTAT_CONTROL_SHIFT (0)
10238 +#define INTSTAT_CONTROL_MASK (0x0000000f)
10239 +#define INTSTAT_FIFO_SHIFT (4)
10240 +#define INTSTAT_FIFO_MASK (0x000000f0)
10242 +/* Configuration */
10243 +#define AUDIO_DESTINATION_OFFSET (0x0C)
10244 +#define AUDIO_SAMPLE_RATE_OFFSET (0x10)
10245 +#define AUDIO_BIT_RATE_OFFSET (0x14)
10246 +#define AUDIO_VOLUME_OFFSET (0x18)
10247 +#define AUDIO_CHANNELS_OFFSET (0x1C)
10249 +/* Implemention of peterson's algorithm for shared memory semaphores */
10250 +#define AUDIO_FLAG0_OFFSET (0x20)
10251 +#define AUDIO_FLAG1_OFFSET (0x24)
10252 +#define AUDIO_TURN_OFFSET (0x28)
10254 +/* Fifo registers */
10255 +#define AUDIO_IN_WRITE_PTR_OFFSET (0x30)
10256 +#define AUDIO_IN_READ_PTR_OFFSET (0x34)
10257 +#define AUDIO_IN_FIFO_SIZE_OFFSET (0x38)
10258 +#define AUDIO_IN_FIFO_ENTRY_OFFSET (0x3C)
10259 +#define AUDIO_IN_FIFO_START_OFFSET (0x40)
10261 +/* 8 entries here of 4 words each = 0x80 gap from 0x50 */
10262 +#define AUDIO_IN_FIFO_OFFSET (0x50)
10264 +#define AUDIO_OUT_WRITE_PTR_OFFSET (0xD0)
10265 +#define AUDIO_OUT_READ_PTR_OFFSET (0xD4)
10266 +#define AUDIO_OUT_FIFO_SIZE_OFFSET (0xD8)
10267 +#define AUDIO_OUT_FIFO_ENTRY_OFFSET (0xDC)
10268 +#define AUDIO_OUT_FIFO_START_OFFSET (0xE0)
10270 +/* 8 entries here of 4 words each = 0x80 gap from 0xF0 */
10271 +#define AUDIO_OUT_FIFO_OFFSET (0xF0)
10273 +/* Some constants for values .. */
10275 + AUDIO_DEST_AUTO = 0,
10276 + AUDIO_DEST_HEADPHONES = 1,
10277 + AUDIO_DEST_HDMI = 2,
10279 +} SND_BCM2835_ROUTE_T;
10282 + PCM_PLAYBACK_VOLUME,
10283 + PCM_PLAYBACK_MUTE,
10284 + PCM_PLAYBACK_DEVICE,
10285 +} SND_BCM2835_CTRL_T;
10287 +/* this struct is tightly packed - its size is 16bytes */
10289 + uint32_t buffer_id;
10290 + uint32_t buffer_size;
10291 + uint32_t buffer_ptr;
10294 +} AUDIO_FIFO_ENTRY_T;
10296 +/* definition of the chip-specific record */
10297 +typedef struct bcm2835_chip {
10298 + struct snd_card *card;
10299 + struct snd_pcm *pcm;
10300 + /* Bitmat for valid reg_base and irq numbers */
10301 + uint32_t avail_substreams;
10302 + struct platform_device *pdev[MAX_SUBSTREAMS];
10303 + struct bcm2835_alsa_stream *alsa_stream[MAX_SUBSTREAMS];
10310 +typedef struct bcm2835_audio_buffer {
10311 + uint32_t buffer_id;
10312 + phys_addr_t bus_addr;
10313 + uint8_t __iomem *start;
10315 + uint32_t data_left;
10316 + struct list_head link;
10318 +} bcm2835_audio_buffer_t;
10320 +typedef struct bcm2835_alsa_stream {
10321 + bcm2835_chip_t *chip;
10322 + struct snd_pcm_substream *substream;
10324 + struct semaphore buffers_update_sem;
10325 + struct semaphore control_sem;
10327 + volatile uint32_t control;
10328 + volatile uint32_t status;
10334 +#ifdef DUMP_RAW_DATA
10338 + unsigned int pos;
10339 + unsigned int buffer_size;
10340 + unsigned int period_size;
10342 + uint32_t enable_fifo_irq;
10343 + irq_handler_t fifo_irq_handler;
10345 + atomic_t retrieved;
10346 + struct opaque_AUDIO_INSTANCE_T *instance;
10347 + struct workqueue_struct *my_wq;
10349 +} bcm2835_alsa_stream_t;
10351 +int snd_bcm2835_new_ctl(bcm2835_chip_t * chip);
10352 +int snd_bcm2835_new_pcm(bcm2835_chip_t * chip);
10354 +void bcm2835_audio_fifo_get_lock(bcm2835_alsa_stream_t * alsa_stream);
10355 +void bcm2835_audio_fifo_put_lock(bcm2835_alsa_stream_t * alsa_stream);
10357 +int bcm2835_audio_open(bcm2835_alsa_stream_t * alsa_stream);
10358 +int bcm2835_audio_close(bcm2835_alsa_stream_t * alsa_stream);
10359 +int bcm2835_audio_set_params(bcm2835_alsa_stream_t * alsa_stream,
10360 + uint32_t channels, uint32_t samplerate,
10362 +int bcm2835_audio_setup(bcm2835_alsa_stream_t * alsa_stream);
10363 +int bcm2835_audio_start(bcm2835_alsa_stream_t * alsa_stream);
10364 +int bcm2835_audio_stop(bcm2835_alsa_stream_t * alsa_stream);
10365 +int bcm2835_audio_set_ctls(bcm2835_chip_t * chip);
10366 +int bcm2835_audio_write(bcm2835_alsa_stream_t * alsa_stream, uint32_t count,
10368 +//uint32_t bcm2835_audio_buffers_consumed_bytes(bcm2835_alsa_stream_t *alsa_stream);
10369 +uint32_t bcm2835_audio_retrieve_buffers(bcm2835_alsa_stream_t * alsa_stream);
10370 +void bcm2835_audio_flush_buffers(bcm2835_alsa_stream_t * alsa_stream);
10371 +void bcm2835_audio_flush_playback_buffers(bcm2835_alsa_stream_t * alsa_stream);
10373 +#endif /* __SOUND_ARM_BCM2835_H */
10375 +++ b/sound/arm/vc_vchi_audioserv_defs.h
10377 +/*****************************************************************************
10378 +* Copyright 2011 Broadcom Corporation. All rights reserved.
10380 +* Unless you and Broadcom execute a separate written software license
10381 +* agreement governing use of this software, this software is licensed to you
10382 +* under the terms of the GNU General Public License version 2, available at
10383 +* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
10385 +* Notwithstanding the above, under no circumstances may you combine this
10386 +* software in any way with any other Broadcom software provided under a
10387 +* license other than the GPL, without Broadcom's express prior written
10389 +*****************************************************************************/
10391 +#ifndef _VC_AUDIO_DEFS_H_
10392 +#define _VC_AUDIO_DEFS_H_
10394 +// FourCC code used for VCHI connection
10395 +#define VC_AUDIO_SERVER_NAME MAKE_FOURCC("AUDS")
10397 +// Maximum message length
10398 +#define VC_AUDIO_MAX_MSG_LEN (sizeof( VC_AUDIO_MSG_T ))
10400 +// List of screens that are currently supported
10401 +// All message types supported for HOST->VC direction
10403 + VC_AUDIO_MSG_TYPE_RESULT, // Generic result
10404 + VC_AUDIO_MSG_TYPE_COMPLETE, // Generic result
10405 + VC_AUDIO_MSG_TYPE_CONFIG, // Configure audio
10406 + VC_AUDIO_MSG_TYPE_CONTROL, // Configure audio
10407 + VC_AUDIO_MSG_TYPE_OPEN, // Configure audio
10408 + VC_AUDIO_MSG_TYPE_CLOSE, // Configure audio
10409 + VC_AUDIO_MSG_TYPE_START, // Configure audio
10410 + VC_AUDIO_MSG_TYPE_STOP, // Configure audio
10411 + VC_AUDIO_MSG_TYPE_WRITE, // Configure audio
10412 + VC_AUDIO_MSG_TYPE_MAX
10413 +} VC_AUDIO_MSG_TYPE;
10415 +// configure the audio
10417 + uint32_t channels;
10418 + uint32_t samplerate;
10421 +} VC_AUDIO_CONFIG_T;
10427 +} VC_AUDIO_CONTROL_T;
10433 +} VC_AUDIO_OPEN_T;
10439 +} VC_AUDIO_CLOSE_T;
10444 +} VC_AUDIO_START_T;
10447 + uint32_t draining;
10449 +} VC_AUDIO_STOP_T;
10451 +// configure the write audio samples
10453 + uint32_t count; // in bytes
10456 + uint32_t silence;
10457 +} VC_AUDIO_WRITE_T;
10459 +// Generic result for a request (VC->HOST)
10461 + int32_t success; // Success value
10463 +} VC_AUDIO_RESULT_T;
10465 +// Generic result for a request (VC->HOST)
10467 + int32_t count; // Success value
10470 +} VC_AUDIO_COMPLETE_T;
10472 +// Message header for all messages in HOST->VC direction
10474 + int32_t type; // Message type (VC_AUDIO_MSG_TYPE)
10476 + VC_AUDIO_CONFIG_T config;
10477 + VC_AUDIO_CONTROL_T control;
10478 + VC_AUDIO_OPEN_T open;
10479 + VC_AUDIO_CLOSE_T close;
10480 + VC_AUDIO_START_T start;
10481 + VC_AUDIO_STOP_T stop;
10482 + VC_AUDIO_WRITE_T write;
10483 + VC_AUDIO_RESULT_T result;
10484 + VC_AUDIO_COMPLETE_T complete;
10488 +#endif // _VC_AUDIO_DEFS_H_