summaryrefslogtreecommitdiff
path: root/v4l
diff options
context:
space:
mode:
Diffstat (limited to 'v4l')
-rw-r--r--v4l/Makefile8
-rw-r--r--v4l/compat.h5
-rw-r--r--v4l/firmware/Makefile44
-rwxr-xr-xv4l/scripts/do_merge.pl5
-rw-r--r--[-rwxr-xr-x]v4l/scripts/gentree.pl16
5 files changed, 45 insertions, 33 deletions
diff --git a/v4l/Makefile b/v4l/Makefile
index ed9cdcbe6..23ae32cad 100644
--- a/v4l/Makefile
+++ b/v4l/Makefile
@@ -39,13 +39,19 @@ endif # TOPDIR
#################################################
# default compilation rule
-default:: config-compat.h Makefile.media links oss
+default:: config-compat.h Makefile.media links oss firmware
@echo Kernel build directory is $(OUTDIR)
$(MAKE) -C $(OUTDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules
./scripts/rmmod.pl check
# $(MAKE) checkpatch
+mismatch:: config-compat.h Makefile.media links oss firmware
+ @echo Kernel build directory is $(OUTDIR)
+ $(MAKE) -Wfatal-errors -C $(OUTDIR) SUBDIRS=$(PWD) $(MYCFLAGS) CONFIG_DEBUG_SECTION_MISMATCH=y modules
+ ./scripts/rmmod.pl check
+
firmware::
+ $(MAKE) -C firmware prep
$(MAKE) -C firmware
v4l2-spec::
diff --git a/v4l/compat.h b/v4l/compat.h
index d8bd6debe..6a40e2a33 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -449,4 +449,9 @@ static inline int snd_card_create(int idx, const char *id,
}
#endif
+/* This macro was added in commit v2.6.23-5792-g34c6538 */
+#ifndef DMA_BIT_MASK
+#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
+#endif
+
#endif /* _COMPAT_H */
diff --git a/v4l/firmware/Makefile b/v4l/firmware/Makefile
index d108dd0f7..c8b0e0578 100644
--- a/v4l/firmware/Makefile
+++ b/v4l/firmware/Makefile
@@ -1,17 +1,24 @@
-DIRS = vicam dabusb ttusb-budget cpia2 av7110
TARGETS = vicam/firmware.fw dabusb/firmware.fw dabusb/bitstream.bin ttusb-budget/dspbootcode.bin cpia2/stv0672_vp4.bin av7110/bootcode.bin
FW_DIR = /lib/firmware
####
+DIRS = $(sort $(dir $(TARGETS)))
+
+.PHONY = default clean distclean install rminstall prep
+
default: $(TARGETS)
+$(TARGETS):: ihex2fw
+
clean:
+ -rm -f ihex2fw
-rm -f $(TARGETS)
distclean: clean
-for i in $(DIRS); do if [ -d $$i ]; then rm -rf $$i; fi; done
+
install: default
@echo -n "Installing firmwares at $(FW_DIR): "
-@for i in $(DIRS); do if [ ! -d $(FW_DIR)/$$i ]; then mkdir -p $(FW_DIR)/$$i; fi; done
@@ -24,33 +31,36 @@ rminstall:
######
-mkdir::
- -@for i in $(DIRS); do if [ ! -d $$i ]; then mkdir -p $$i; fi; done
-
ihex2fw: ../../linux/firmware/ihex2fw.c
@echo " CC $@"
@gcc -Wall -o $@ $<
-vicam/firmware.fw: ../../linux/firmware/vicam/firmware.H16 mkdir ihex2fw
+prep:
+ @for i in $(DIRS); do \
+ if [ ! -d $$i ]; then mkdir -p $$i; fi; \
+ for j in ../../linux/firmware/$$i/*; do \
+ n=`echo $$j | sed s,../../linux/firmware/,,`; \
+ if [ ! -e $$n ]; then \
+ ln -f $$j $$n; \
+ fi; \
+ done; done
+
+%.fw: %.H16
@echo Generating $@
@./ihex2fw -w $< $@
-dabusb/firmware.fw: ../../linux/firmware/dabusb/firmware.HEX mkdir ihex2fw
+%.fw: %.HEX
@echo Generating $@
@./ihex2fw $< $@
-ttusb-budget/dspbootcode.bin: ../../linux/firmware/ttusb-budget/dspbootcode.bin.ihex mkdir
+%.bin: %.bin.ihex
@echo Generating $@
@objcopy -Iihex -Obinary $< $@
-dabusb/bitstream.bin: ../../linux/firmware/dabusb/bitstream.bin.ihex mkdir
- @echo Generating $@
- @objcopy -Iihex -Obinary $< $@
-
-cpia2/stv0672_vp4.bin: ../../linux/firmware/cpia2/stv0672_vp4.bin.ihex mkdir
- @echo Generating $@
- @objcopy -Iihex -Obinary $< $@
+# TODO: Use the Firmware Kconfig dependencies
+#fw-$(CONFIG_USB_VICAM) += vicam/firmware.fw
+#fw-$(CONFIG_USB_DABUSB) += dabusb/firmware.fw dabusb/bitstream.bin
+#fw-$(CONFIG_DVB_TTUSB_BUDGET) += ttusb-budget/dspbootcode.bin
+#fw-$(CONFIG_VIDEO_CPIA2) += cpia2/stv0672_vp4.bin
+#fw-$(CONFIG_DVB_AV7110) += av7110/bootcode.bin
-av7110/bootcode.bin: ../../linux/firmware/av7110/bootcode.bin.ihex mkdir
- @echo Generating $@
- @objcopy -Iihex -Obinary $< $@
diff --git a/v4l/scripts/do_merge.pl b/v4l/scripts/do_merge.pl
index 0a4433a21..1a6bbb1ee 100755
--- a/v4l/scripts/do_merge.pl
+++ b/v4l/scripts/do_merge.pl
@@ -153,7 +153,10 @@ if ($n_heads == 2) {
# Test resulting tree
print "Testing if the build didn't break compilation. Only errors and warnings will be displayed. Please wait.\n";
-$ret = system ('make all|egrep -v "^\s*CC"|egrep -v "^\s*LD"');
+$ret = system ('make allmodconfig');
+if (!ret) {
+ $ret = system ('make mismatch|egrep -v "^\s*CC"|egrep -v "^\s*LD"');
+}
if ($ret) {
print "Build failed. Can't procceed.\n";
diff --git a/v4l/scripts/gentree.pl b/v4l/scripts/gentree.pl
index 1968bb334..b9053f464 100755..100644
--- a/v4l/scripts/gentree.pl
+++ b/v4l/scripts/gentree.pl
@@ -22,8 +22,8 @@
# If gentree knows the result of an expression, that directive will be
# "processed", otherwise it will be an "other". gentree knows the value
# of LINUX_VERSION_CODE, BTTV_VERSION_CODE, the KERNEL_VERSION(x,y,z)
-# macro, numeric constants like 0 and 1, and a few defines like MM_KERNEL
-# and STV0297_CS2.
+# macro, numeric constants like 0 and 1, and a few defines like
+# I2C_CLASS_TV_DIGITAL
#
# An exception is if the comment "/*KEEP*/" appears after the expression,
# in which case that directive will be considered an "other" and not
@@ -55,22 +55,10 @@ my %defs = (
'LINUX_VERSION_CODE' => $LINUXCODE,
'BTTV_VERSION_CODE' => $BTTVCODE,
'_COMPAT_H' => 0,
- 'MM_KERNEL' => ($extra =~ /-mm/)?1:0,
- 'BROKEN_XAWTV' => 0,
- 'STV0297_CS2' => 0,
- 'HAVE_VIDEO_BUF_DVB' => 1,
- 'I2C_PEC' => 1,
- 'I2C_DF_DUMMY' => 0,
- 'CONFIG_XC3028' => 0,
- 'HAVE_XC2028'=> 0,
- 'HAVE_XC3028' => 0,
'I2C_CLASS_TV_ANALOG' => 1,
'I2C_CLASS_TV_DIGITAL' => 1,
'OLD_XMIT_LOCK' => 0,
'COMPAT_SND_CTL_BOOLEAN_MONO' => 0,
- 'CONFIG_VIVI_SCATTER' => 0,
- 'CONFIG_BIGPHYS_AREA' => 0,
- 'BUZ_USE_HIMEM' => 1,
'NEED_SOUND_DRIVER_H' => 0,
'TTUSB_KERNEL' => 1,
'NO_PCM_LOCK' => 0,