Skip to content

Commit

Permalink
add s90 from err99 in 3 posts starting at http://chdk.setepontos.com/…
Browse files Browse the repository at this point in the history
  • Loading branch information
reyalp committed Apr 26, 2010
1 parent 8410e70 commit 3f555ec
Show file tree
Hide file tree
Showing 59 changed files with 10,492 additions and 13 deletions.
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ batch-zip: version
$(MAKE) -s --no-print-directory PLATFORM=g11 PLATFORMSUB=100l NO_INC_BUILD=1 firzipsub
$(MAKE) -s --no-print-directory PLATFORM=ixus100_sd780 PLATFORMSUB=100c NO_INC_BUILD=1 firzipsub
$(MAKE) -s --no-print-directory PLATFORM=a480 PLATFORMSUB=100b NO_INC_BUILD=1 firzipsub
$(MAKE) -s --no-print-directory PLATFORM=s90 PLATFORMSUB=100c NO_INC_BUILD=1 firzipsub
$(MAKE) -s --no-print-directory PLATFORM=s90 PLATFORMSUB=101a NO_INC_BUILD=1 firzipsub
$(MAKE) -s --no-print-directory PLATFORM=s90 PLATFORMSUB=101c NO_INC_BUILD=1 firzipsub
@echo "**** All firmwares created successfully"
@echo "**** Copying duplicate Firmwares"
cp $(topdir)bin/$(VER)-a610-100e-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-a610-100d-$(BUILD_NUMBER).zip
Expand All @@ -247,6 +250,7 @@ batch-zip: version
cp $(topdir)bin/$(VER)-ixus960_sd950-100d-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-ixus960_sd950-100c-$(BUILD_NUMBER).zip
cp $(topdir)bin/$(VER)-ixus90_sd790-100d-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-ixus90_sd790-100e-$(BUILD_NUMBER).zip
cp $(topdir)bin/$(VER)-g11-100j-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-g11-100k-$(BUILD_NUMBER).zip
cp $(topdir)bin/$(VER)-s90-101c-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-s90-101b-$(BUILD_NUMBER).zip
mv $(topdir)bin/$(VER)-sx1-200h-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-sx1-200h-$(BUILD_NUMBER)_BETA.zip
mv $(topdir)bin/$(VER)-sx1-201a-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-sx1-201a-$(BUILD_NUMBER)_BETA.zip
mv $(topdir)bin/$(VER)-ixus980_sd990-100e-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-ixus980_sd990-100e-$(BUILD_NUMBER)_BETA.zip
Expand All @@ -259,6 +263,10 @@ batch-zip: version
mv $(topdir)bin/$(VER)-g11-100j-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-g11-100j-$(BUILD_NUMBER)_BETA.zip
mv $(topdir)bin/$(VER)-g11-100k-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-g11-100k-$(BUILD_NUMBER)_BETA.zip
mv $(topdir)bin/$(VER)-g11-100l-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-g11-100l-$(BUILD_NUMBER)_BETA.zip
mv $(topdir)bin/$(VER)-s90-100c-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-s90-100c-$(BUILD_NUMBER)_BETA.zip
mv $(topdir)bin/$(VER)-s90-101a-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-s90-101a-$(BUILD_NUMBER)_BETA.zip
mv $(topdir)bin/$(VER)-s90-101b-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-s90-101b-$(BUILD_NUMBER)_BETA.zip
mv $(topdir)bin/$(VER)-s90-101c-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-s90-101c-$(BUILD_NUMBER)_BETA.zip
mv $(topdir)bin/$(VER)-ixus100_sd780-100c-$(BUILD_NUMBER).zip $(topdir)bin/$(VER)-ixus100_sd780-100c-$(BUILD_NUMBER)_BETA.zip
@echo "**** Done Copying duplicate Firmwares"
@echo "**** Summary of memisosizes"
Expand Down Expand Up @@ -361,6 +369,9 @@ batch-zip-complete: version
$(MAKE) -s --no-print-directory PLATFORM=g11 PLATFORMSUB=100l NO_INC_BUILD=1 firzipsubcomplete
$(MAKE) -s --no-print-directory PLATFORM=ixus100_sd780 PLATFORMSUB=100c NO_INC_BUILD=1 firzipsubcomplete
$(MAKE) -s --no-print-directory PLATFORM=a480 PLATFORMSUB=100b NO_INC_BUILD=1 firzipsubcomplete
$(MAKE) -s --no-print-directory PLATFORM=s90 PLATFORMSUB=100c NO_INC_BUILD=1 firzipsubcomplete
$(MAKE) -s --no-print-directory PLATFORM=s90 PLATFORMSUB=101a NO_INC_BUILD=1 firzipsubcomplete
$(MAKE) -s --no-print-directory PLATFORM=s90 PLATFORMSUB=101c NO_INC_BUILD=1 firzipsubcomplete
@echo "**** All zipfiles including firmwares and extra stuff created successfully"
@echo "**** Copying duplicate Firmwares"
cp $(topdir)bin/a610-100e-$(BUILD_NUMBER)-full.zip $(topdir)bin/a610-100d-$(BUILD_NUMBER)-full.zip
Expand Down Expand Up @@ -393,6 +404,8 @@ batch-zip-complete: version
cp $(topdir)bin/ixus90_sd790-100d-$(BUILD_NUMBER).zip $(topdir)bin/ixus90_sd790-100e-$(BUILD_NUMBER).zip
cp $(topdir)bin/g11-100j-$(BUILD_NUMBER)-full.zip $(topdir)bin/g11-100k-$(BUILD_NUMBER)-full.zip
cp $(topdir)bin/g11-100j-$(BUILD_NUMBER).zip $(topdir)bin/g11-100k-$(BUILD_NUMBER).zip
cp $(topdir)bin/s90-101c-$(BUILD_NUMBER).zip $(topdir)bin/s90-101b-$(BUILD_NUMBER).zip
cp $(topdir)bin/s90-101c-$(BUILD_NUMBER)-full.zip $(topdir)bin/s90-101b-$(BUILD_NUMBER)-full.zip
mv $(topdir)bin/sx1-200h-$(BUILD_NUMBER)-full.zip $(topdir)bin/sx1-200h-$(BUILD_NUMBER)-full_BETA.zip
mv $(topdir)bin/sx1-200h-$(BUILD_NUMBER).zip $(topdir)bin/sx1-200h-$(BUILD_NUMBER)_BETA.zip
mv $(topdir)bin/sx1-201a-$(BUILD_NUMBER)-full.zip $(topdir)bin/sx1-201a-$(BUILD_NUMBER)-full_BETA.zip
Expand All @@ -419,6 +432,14 @@ batch-zip-complete: version
mv $(topdir)bin/g11-100l-$(BUILD_NUMBER).zip $(topdir)bin/g11-100l-$(BUILD_NUMBER)_BETA.zip
mv $(topdir)bin/ixus100_sd780-100c-$(BUILD_NUMBER)-full.zip $(topdir)bin/ixus100_sd780-100c-$(BUILD_NUMBER)-full_BETA.zip
mv $(topdir)bin/ixus100_sd780-100c-$(BUILD_NUMBER).zip $(topdir)bin/ixus100_sd780-100c-$(BUILD_NUMBER)_BETA.zip
mv $(topdir)bin/s90-100c-$(BUILD_NUMBER)-full.zip $(topdir)bin/s90-100c-$(BUILD_NUMBER)-full_BETA.zip
mv $(topdir)bin/s90-100c-$(BUILD_NUMBER).zip $(topdir)bin/s90-100c-$(BUILD_NUMBER)_BETA.zip
mv $(topdir)bin/s90-101a-$(BUILD_NUMBER)-full.zip $(topdir)bin/s90-101a-$(BUILD_NUMBER)-full_BETA.zip
mv $(topdir)bin/s90-101a-$(BUILD_NUMBER).zip $(topdir)bin/s90-101a-$(BUILD_NUMBER)_BETA.zip
mv $(topdir)bin/s90-101b-$(BUILD_NUMBER)-full.zip $(topdir)bin/s90-101b-$(BUILD_NUMBER)-full_BETA.zip
mv $(topdir)bin/s90-101b-$(BUILD_NUMBER).zip $(topdir)bin/s90-101b-$(BUILD_NUMBER)_BETA.zip
mv $(topdir)bin/s90-101c-$(BUILD_NUMBER)-full.zip $(topdir)bin/s90-101c-$(BUILD_NUMBER)-full_BETA.zip
mv $(topdir)bin/s90-101c-$(BUILD_NUMBER).zip $(topdir)bin/s90-101c-$(BUILD_NUMBER)_BETA.zip
@echo "**** Done Copying duplicate Firmwares"
@echo "**** Summary of memisosizes"
cat $(topdir)bin/caminfo.txt
Expand Down Expand Up @@ -518,4 +539,7 @@ batch-clean:
$(MAKE) -s --no-print-directory PLATFORM=g11 PLATFORMSUB=100l NO_INC_BUILD=1 clean
$(MAKE) -s --no-print-directory PLATFORM=ixus100_sd780 PLATFORMSUB=100c NO_INC_BUILD=1 clean
$(MAKE) -s --no-print-directory PLATFORM=a480 PLATFORMSUB=100b NO_INC_BUILD=1 clean
$(MAKE) -s --no-print-directory PLATFORM=s90 PLATFORMSUB=100c NO_INC_BUILD=1 clean
$(MAKE) -s --no-print-directory PLATFORM=s90 PLATFORMSUB=101a NO_INC_BUILD=1 clean
$(MAKE) -s --no-print-directory PLATFORM=s90 PLATFORMSUB=101c NO_INC_BUILD=1 clean
.PHONY: fir upload
7 changes: 6 additions & 1 deletion core/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -2553,7 +2553,12 @@ void other_kbd_process(){
get_property_case(PROPCASE_DIGITAL_ZOOM_STATE, &x, sizeof(x));
if (x) {
get_property_case(PROPCASE_DIGITAL_ZOOM_POSITION, &x, sizeof(x));
if (x==0) zoom_status=ZOOM_OPTICAL_MEDIUM;
#if defined (CAMERA_s90)
if (x==0) zoom_status=ZOOM_OPTICAL_MAX; //ERR99: No zoom back from digital to optical zoom possible if set to medium
#else
if (x==0) zoom_status=ZOOM_OPTICAL_MEDIUM;
#endif

}
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions core/gui_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void gui_menu_init(CMenu *menu_ptr) {
}

num_lines = screen_height/rbf_font_height()-1;
#if defined (CAMERA_g11)
#if defined (CAMERA_g11) || defined (CAMERA_s90)
w = screen_width-10-10;
#else
w = screen_width-30-30;
Expand Down Expand Up @@ -672,7 +672,7 @@ void gui_menu_draw() {
case MENUITEM_SEPARATOR:
if (lang_str(curr_menu->menu[imenu].text)[0]) {
j = rbf_str_width(lang_str(curr_menu->menu[imenu].text));
#if defined (CAMERA_g11)
#if defined (CAMERA_g11) || defined (CAMERA_s90)
xx+=((int)w-j-len_space*2)>>1;
#else
xx+=(w-j-len_space*2)>>1;
Expand Down
10 changes: 5 additions & 5 deletions core/gui_osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static int step;
// Only top and bottom are restored, not left&right.
#define ZEBRA_CANONOSD_BORDER_RESTORE 1

#if defined (CAMERA_sx200is) || defined(CAMERA_g11) || defined (CAMERA_ixus100_sd780)
#if defined (CAMERA_sx200is) || defined(CAMERA_g11) || defined (CAMERA_ixus100_sd780) || defined (CAMERA_s90)
//there are no memory for that (the screen buffer is big): 960x270
//TODO use a buffer of screen dimensions
#define ZFIX_TOP 1
Expand All @@ -75,7 +75,7 @@ static unsigned char *cur_buf;
static int cur_buf_size;
static int timer = 0;
static unsigned char *buf = NULL;
#if defined (CAMERA_sx200is) || defined(CAMERA_g11) || defined (CAMERA_ixus100_sd780)
#if defined (CAMERA_sx200is) || defined(CAMERA_g11) || defined (CAMERA_ixus100_sd780) || defined (CAMERA_s90)
static int buffer_size;
#endif

Expand Down Expand Up @@ -240,7 +240,7 @@ static int gui_osd_zebra_init(int show) {
if(show) {
if (!buf) {
timer = 0;
#if defined (CAMERA_sx200is) || defined (CAMERA_g11) || defined (CAMERA_ixus100_sd780) //nandoide sept-2009
#if defined (CAMERA_sx200is) || defined (CAMERA_g11) || defined (CAMERA_ixus100_sd780) || defined (CAMERA_s90) //nandoide sept-2009
buffer_size=screen_buffer_size-ZEBRA_HMARGIN0*screen_buffer_width;
buf = malloc(buffer_size);
//~ if (!buf) draw_txt_string(0, 14, "Warn: No space to allocate zebra buffer: restart camera", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG));
Expand All @@ -254,7 +254,7 @@ static int gui_osd_zebra_init(int show) {
#if ZEBRA_CANONOSD_BORDER_RESTORE
cur_buf_top = malloc(screen_buffer_width * ZFIX_TOP);
cur_buf_bot = malloc(screen_buffer_width * ZFIX_BOTTOM);
#if defined (CAMERA_g11)
#if defined (CAMERA_g11) || defined (CAMERA_s90)
if (cur_buf_top) memset(cur_buf_top,0,screen_buffer_width * ZFIX_TOP);
if (cur_buf_bot) memset(cur_buf_bot,0,screen_buffer_width * ZFIX_BOTTOM);
#endif
Expand Down Expand Up @@ -371,7 +371,7 @@ static void gui_osd_draw_zebra_osd() {

// reyalp - TODO this SHOULD NOT BE CAMERA SPECIFIC. Should be generalized to work with all cameras
// having a copy/paste/modified version for individual cameras will be a maintenance nightmare.
#if defined (CAMERA_sx200is) || defined (CAMERA_g11) || defined (CAMERA_ixus100_sd780)
#if defined (CAMERA_sx200is) || defined (CAMERA_g11) || defined (CAMERA_ixus100_sd780) || defined (CAMERA_s90)
//nandoide sept-2009
// viewport is 360x240 and screen buffer 960x270, we need to expand the x coordinate
int gui_osd_draw_zebra(int show) {
Expand Down
4 changes: 4 additions & 0 deletions core/kbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ static int nTxtbl[]={0,16,32,62,78,102,125};
#define ZSTEP_TABLE_SIZE 14
static int nTxtbl[]={0,1,2,3,4,5,6,7,8,9,10,11,12,13};
#endif
#if defined(CAMERA_s90)
#define ZSTEP_TABLE_SIZE 10
static int nTxtbl[]={0,1,2,3,4,5,6,7,8,9};
#endif

void kbd_sched_delay(long msec)
{
Expand Down
6 changes: 5 additions & 1 deletion core/raw_merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
#include "gui_lang.h"
#include "lang.h"
#include "conf.h"
#define TEMP_FILE "raw16.tmp"
#ifdef CAM_DRYOS_2_3_R39
#define TEMP_FILE "A/raw16.tmp"
#else
#define TEMP_FILE "raw16.tmp"
#endif
#define TEMP_FILE_NAME "A/raw16.tmp"
#define TEMP_FILE_NAME_1 "A/raw16_1.tmp"

Expand Down
109 changes: 107 additions & 2 deletions include/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -2335,7 +2335,7 @@
#define CAM_DRYOS_2_3_R39 1
#define CAM_PROPSET 3
#define CAM_DRYOS 1

#undef CAM_USE_ZOOM_FOR_MF
#define CAM_RAW_ROWPIX 3744 // See g11 lib.c
#define CAM_RAW_ROWS 2784 // See g11 lib.c
#undef CAM_EMUL_KEYPRESS_DURATION
Expand Down Expand Up @@ -2371,7 +2371,7 @@
//games mappings
#undef GAMES_SCREEN_WIDTH
#undef GAMES_SCREEN_HEIGHT
#define GAMES_SCREEN_WIDTH 720 // ERR99CHECK
#define GAMES_SCREEN_WIDTH 360
#define GAMES_SCREEN_HEIGHT 240

#undef CAM_BITMAP_PALETTE
Expand All @@ -2396,6 +2396,111 @@
#define ASPECT_VIEWPORT_YCORRECTION(y) ( (y) )
#undef EDGE_HMARGIN
#define EDGE_HMARGIN 20

/**** From SX200IS, ok for G11 ?*/
#define DNG_SUPPORT 1
// pattern
#define cam_CFAPattern 0x02010100 // Red Green Green Blue
// color
//need fixing *****************************************************
#define CAM_COLORMATRIX1 \
14134, 1000000, -5576, 1000000, -1527, 1000000, \
-1991, 1000000, 10719, 1000000, 1273, 1000000, \
-1158, 1000000, 1929, 1000000, 3581, 1000000
#define cam_CalibrationIlluminant1 17 // Standard Light A

// cropping
#define CAM_JPEG_WIDTH 3600
#define CAM_JPEG_HEIGHT 2700
#define CAM_ACTIVE_AREA_X1 52
#define CAM_ACTIVE_AREA_Y1 14
#define CAM_ACTIVE_AREA_X2 3648
#define CAM_ACTIVE_AREA_Y2 2736
/**** From SX200IS, ok for G11 END?*/
#elif defined (CAMERA_s90)
#define CAM_DRYOS_2_3_R39 1
#define CAM_PROPSET 3
#define CAM_DRYOS 1
#undef CAM_USE_ZOOM_FOR_MF
#define CAM_RAW_ROWPIX 3744 // See g11 lib.c
#define CAM_RAW_ROWS 2784 // See g11 lib.c
#undef CAM_EMUL_KEYPRESS_DURATION
#define CAM_EMUL_KEYPRESS_DURATION 10

#define CAM_QUALITY_OVERRIDE 1
#define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
#define CAM_HAS_JOGDIAL 1
#undef CAM_CONSOLE_LOG_ENABLED // Development: internal camera stdout -> A/stdout.txt
#define CAM_BRACKETING 1
#define CAM_MULTIPART 1
#define CAM_EXT_TV_RANGE 1
#undef OPT_CURVES
#undef CAM_UNCACHED_BIT
#define CAM_UNCACHED_BIT 0x40000000 // S90 @FF8875FC(via ExMem.FreeCacheable)

#define CAM_SHOW_OSD_IN_SHOOT_MENU 1

// camera name
#define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
#undef CAM_SENSOR_BITS_PER_PIXEL
#undef CAM_WHITE_LEVEL
#undef CAM_BLACK_LEVEL
#define CAM_SENSOR_BITS_PER_PIXEL 12
#define CAM_WHITE_LEVEL ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
#define CAM_BLACK_LEVEL 127

#undef CAM_USES_ASPECT_CORRECTION
#undef CAM_USES_ASPECT_YCORRECTION
#define CAM_USES_ASPECT_CORRECTION 1 //camera uses the modified graphics primitives to map screens an viewports to buffers more sized
#define CAM_USES_ASPECT_YCORRECTION 0 //only uses mappings on x coordinate
//games mappings
#undef GAMES_SCREEN_WIDTH
#undef GAMES_SCREEN_HEIGHT
#define GAMES_SCREEN_WIDTH 360
#define GAMES_SCREEN_HEIGHT 240

#undef CAM_BITMAP_PALETTE
#define CAM_BITMAP_PALETTE 4

#undef ASPECT_XCORRECTION
#define ASPECT_XCORRECTION(x) ( ( ((x)<<3) + (x) ) >>2 )
#undef ASPECT_GAMES_XCORRECTION
#define ASPECT_GAMES_XCORRECTION(x) ( ((x)<<1) )
#undef ASPECT_GAMES_YCORRECTION
#define ASPECT_GAMES_YCORRECTION(y) ( (y) ) //none

#undef ASPECT_GRID_XCORRECTION
#define ASPECT_GRID_XCORRECTION(x) ( ((x)<<3)/9 ) //grids are designed on a 360x240 basis and screen is 320x240, we need x*320/360=x*8/9
#undef ASPECT_GRID_YCORRECTION
#define ASPECT_GRID_YCORRECTION(y) ( (y) ) //y correction for grids made on a 360x240 As the buffer is 720x240 we have no correction here.

#undef ASPECT_VIEWPORT_XCORRECTION
#define ASPECT_VIEWPORT_XCORRECTION(x) ASPECT_GRID_XCORRECTION(x) //viewport is 360x240 and screen 320x240, we need x*320/360=x*8/9, equal than grids, used by edgeoverlay
#undef ASPECT_VIEWPORT_YCORRECTION
#define ASPECT_VIEWPORT_YCORRECTION(y) ( (y) )
#undef EDGE_HMARGIN
#define EDGE_HMARGIN 20

/**** From SX200IS, ok for S90 ?*/
#define DNG_SUPPORT 1
// pattern
#define cam_CFAPattern 0x02010100 // Red Green Green Blue
// color
//need fixing *****************************************************
#define CAM_COLORMATRIX1 \
14134, 1000000, -5576, 1000000, -1527, 1000000, \
-1991, 1000000, 10719, 1000000, 1273, 1000000, \
-1158, 1000000, 1929, 1000000, 3581, 1000000
#define cam_CalibrationIlluminant1 17 // Standard Light A

// cropping
#define CAM_JPEG_WIDTH 3600
#define CAM_JPEG_HEIGHT 2700
#define CAM_ACTIVE_AREA_X1 52
#define CAM_ACTIVE_AREA_Y1 14
#define CAM_ACTIVE_AREA_X2 3648
#define CAM_ACTIVE_AREA_Y2 2736
/**** From SX200IS, ok for S90 END?*/
#else
#error camera type not defined
#endif
Expand Down
1 change: 1 addition & 0 deletions include/modelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,6 @@ MODE_SCN_DIGITAL_MACRO ,
MODE_SCN_STITCH ,
MODE_SCN_LONG_SHUTTER , // only known on sx1
MODE_LOWLIGHT , // g11
MODE_SCN_NOSTALGIC , // s90
};
#endif
2 changes: 1 addition & 1 deletion include/propset3.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ constants for propset 3
#define PROPCASE_BRACKET_MODE 29
#define PROPCASE_FLASH_SYNC_CURTAIN 64
#define PROPCASE_METERING_MODE 155
#define PROPCASE_WB_ADJ 270
#define PROPCASE_WB_ADJ 271
#define PROPCASE_ASPECT_RATIO 294
#define PROPCASE_TIMER_MODE 225
#define PROPCASE_OPTICAL_ZOOM_POSITION 197
Expand Down
42 changes: 42 additions & 0 deletions loader/s90/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
curdir=./
topdir=../../

include $(topdir)makefile.inc
SUBDIRS=resetcode

LDLIBS=
LDOPTS=-nostdlib -Wl,--allow-shlib-undefined -Wl,--no-define-common,-EL,-T,$(topdir)tools/link-boot.ld
LDOPTS+=-Wl,-N,-Ttext,$(MEMBASEADDR)

CPPFLAGS+=-I.

CORE_FILE=$(topdir)core/main.bin
RESET_FILE=$(curdir)resetcode/main.bin

CPPFLAGS+=-DCORE_FILE=\"$(CORE_FILE)\"
CPPFLAGS+=-DRESET_FILE=\"$(RESET_FILE)\"

all: all-recursive main.bin

OBJS=entry.o main.o blobs.o

main.bin: main.elf
@echo $< \-\> $@
$(OBJDUMP) -z -d main.elf > main.dump
$(OBJCOPY) -O binary main.elf main.bin

main.elf: $(OBJS)
@echo \-\> $@
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS) $(LDFLAGS) $(LDOPTS)
( $(NM) $@ | grep ' U ' > $@.syms ) && exit 1 || exit 0

clean: clean-recursive
rm -f $(OBJS) main.bin main.elf main.dump main.elf.syms

distclean: distclean-recursive
rm -f $(OBJS) main.bin main.elf main.dump main.elf.syms
rm -f reboot_core.h copy_and_reset.h

blobs.o: $(RESET_FILE) $(CORE_FILE)

include $(topdir)bottom.inc
28 changes: 28 additions & 0 deletions loader/s90/blobs.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.globl blob_copy_and_reset, blob_copy_and_reset_size
.globl blob_chdk_core, blob_chdk_core_size


.section .blob_copy_and_reset
blob_copy_and_reset_start:
.incbin RESET_FILE
blob_copy_and_reset_end:



.section .blob_chdk_core
blob_chdk_core_start:
.incbin CORE_FILE
blob_chdk_core_end:


.text
blob_chdk_core_size:
.long blob_chdk_core_end - blob_chdk_core_start
blob_chdk_core:
.long blob_chdk_core_start


blob_copy_and_reset_size:
.long blob_copy_and_reset_end - blob_copy_and_reset_start
blob_copy_and_reset:
.long blob_copy_and_reset_start
Loading

0 comments on commit 3f555ec

Please sign in to comment.