From eea5e74da6f8c1ca2b0670f75c16c690808ce023 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 22 Apr 2009 13:28:11 +0000 Subject: Make firmware before install From: Nicola Soranzo Presently with the usual: make && sudo make install firmware is not built during make, but in the second step with root privileges, which should be avoided. This patch adds firmware dependency to the default make target. Moreover, one more file (ihex2fw) should be deleted by firmware clean. Priority: normal Signed-off-by: Nicola Soranzo Signed-off-by: Mauro Carvalho Chehab --- v4l/Makefile | 2 +- v4l/firmware/Makefile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'v4l') diff --git a/v4l/Makefile b/v4l/Makefile index ed9cdcbe6..aea333c9c 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -39,7 +39,7 @@ 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 diff --git a/v4l/firmware/Makefile b/v4l/firmware/Makefile index d108dd0f7..6c6e88ed2 100644 --- a/v4l/firmware/Makefile +++ b/v4l/firmware/Makefile @@ -7,6 +7,7 @@ FW_DIR = /lib/firmware default: $(TARGETS) clean: + -rm -f ihex2fw -rm -f $(TARGETS) distclean: clean -- cgit v1.2.3 From 2da45c822154d03cd7db86ac11b52385f1fac384 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 23 Apr 2009 15:23:30 -0300 Subject: building system: improve firmware creation From: Mauro Carvalho Chehab This is a major rewrite at v4l/firmware/Makefile: It will now create firmwares only if they don't exist yet, or if the firmware "source" file were touched. Also, use implicit rules instead of explicit, in order to simplify the file. Now, just one line should be modified if a new firmware is added. Priority: normal Signed-off-by: Mauro Carvalho Chehab --- v4l/Makefile | 1 + v4l/firmware/Makefile | 43 ++++++++++++++++++++++++++----------------- 2 files changed, 27 insertions(+), 17 deletions(-) (limited to 'v4l') diff --git a/v4l/Makefile b/v4l/Makefile index aea333c9c..dc0cfcaa6 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -46,6 +46,7 @@ default:: config-compat.h Makefile.media links oss firmware # $(MAKE) checkpatch firmware:: + $(MAKE) -C firmware prep $(MAKE) -C firmware v4l2-spec:: diff --git a/v4l/firmware/Makefile b/v4l/firmware/Makefile index 6c6e88ed2..c8b0e0578 100644 --- a/v4l/firmware/Makefile +++ b/v4l/firmware/Makefile @@ -1,11 +1,16 @@ -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) @@ -13,6 +18,7 @@ clean: 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 @@ -25,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 $< $@ -- cgit v1.2.3 From 537cb71bfbec21524737669b70ade038ae396346 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Thu, 30 Apr 2009 17:03:34 -0700 Subject: compat: Add DMA_BIT_MASK() macro From: Trent Piepho This macro was added in 2.6.24 as a replacement for things like DMA_32BIT_MASK, DMA_24BIT_MASK, etc. Priority: normal Signed-off-by: Trent Piepho --- v4l/compat.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'v4l') 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 */ -- cgit v1.2.3 From 07aa0071b7731c08909ed2ea7ab99a62fa934ff0 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 9 May 2009 06:24:32 -0300 Subject: Kbuild: add a new target to check for section mismatches From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l/Makefile | 5 +++++ v4l/scripts/do_merge.pl | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'v4l') diff --git a/v4l/Makefile b/v4l/Makefile index dc0cfcaa6..23ae32cad 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -45,6 +45,11 @@ default:: config-compat.h Makefile.media links oss firmware ./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 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"; -- cgit v1.2.3 From f3af4e568a54988e9528814b67c25afef45b81fb Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 23 May 2009 10:20:58 -0300 Subject: gentree.pl: Remove some unused vars From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/gentree.pl | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) mode change 100755 => 100644 v4l/scripts/gentree.pl (limited to 'v4l') diff --git a/v4l/scripts/gentree.pl b/v4l/scripts/gentree.pl old mode 100755 new mode 100644 index 1968bb334..b9053f464 --- 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, -- cgit v1.2.3