Related
I'm trying to compile ICS Android Open Kang Project for an ARMv6 device,
But when all is almost ended I get a copybit.cpp error.
Firstly, this is my copybit.cpp: http://pastebin.com/jhpBdSbC
And these are the errors I'm getting:
target thumb C++: copybit.galaxy5 <= device/samsung/galaxy5/libcopybit/copybit.cpp
device/samsung/galaxy5/libcopybit/copybit.cpp:87: warning: missing initializer for member 'hw_module_t::dso'
device/samsung/galaxy5/libcopybit/copybit.cpp:87: warning: missing initializer for member 'hw_module_t::reserved'
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'int msm_copybit(copybit_context_t*, const void*)':
device/samsung/galaxy5/libcopybit/copybit.cpp:208: warning: comparison between signed and unsigned integer expressions
device/samsung/galaxy5/libcopybit/copybit.cpp:209: warning: format '%08lx' expects type 'long unsigned int', but argument 19 has type 'unsigned int'
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'int stretch_copybit(copybit_device_t*, const copybit_image_t*, const copybit_image_t*, const copybit_rect_t*, const copybit_rect_t*, const copybit_region_t*)':
device/samsung/galaxy5/libcopybit/copybit.cpp:360: warning: comparison between signed and unsigned integer expressions
device/samsung/galaxy5/libcopybit/copybit.cpp:361: warning: comparison between signed and unsigned integer expressions
device/samsung/galaxy5/libcopybit/copybit.cpp:382: error: 'PRIV_FLAGS_DO_NOT_FLUSH' is not a member of 'private_handle_t'
device/samsung/galaxy5/libcopybit/copybit.cpp:383: error: 'MDP_BLIT_NON_CACHED' was not declared in this scope
device/samsung/galaxy5/libcopybit/copybit.cpp: At global scope:
device/samsung/galaxy5/libcopybit/copybit.cpp:539: error: redefinition of 'struct copybit_context_t'
device/samsung/galaxy5/libcopybit/copybit.cpp:56: error: previous definition of 'struct copybit_context_t'
device/samsung/galaxy5/libcopybit/copybit.cpp:553: error: redefinition of 'hw_module_methods_t copybit_module_methods'
device/samsung/galaxy5/libcopybit/copybit.cpp:70: error: 'hw_module_methods_t copybit_module_methods' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp:560: error: redefinition of 'copybit_module_t HMI'
device/samsung/galaxy5/libcopybit/copybit.cpp:77: error: 'copybit_module_t HMI' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'int min(int, int)':
device/samsung/galaxy5/libcopybit/copybit.cpp:575: error: redefinition of 'int min(int, int)'
device/samsung/galaxy5/libcopybit/copybit.cpp:92: error: 'int min(int, int)' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'int max(int, int)':
device/samsung/galaxy5/libcopybit/copybit.cpp:580: error: redefinition of 'int max(int, int)'
device/samsung/galaxy5/libcopybit/copybit.cpp:97: error: 'int max(int, int)' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'void MULDIV(uint32_t*, uint32_t*, int, int)':
device/samsung/galaxy5/libcopybit/copybit.cpp:585: error: redefinition of 'void MULDIV(uint32_t*, uint32_t*, int, int)'
device/samsung/galaxy5/libcopybit/copybit.cpp:102: error: 'void MULDIV(uint32_t*, uint32_t*, int, int)' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'void intersect(copybit_rect_t*, const copybit_rect_t*, const copybit_rect_t*)':
device/samsung/galaxy5/libcopybit/copybit.cpp:593: error: redefinition of 'void intersect(copybit_rect_t*, const copybit_rect_t*, const copybit_rect_t*)'
device/samsung/galaxy5/libcopybit/copybit.cpp:110: error: 'void intersect(copybit_rect_t*, const copybit_rect_t*, const copybit_rect_t*)' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'int get_format(int)':
device/samsung/galaxy5/libcopybit/copybit.cpp:603: error: redefinition of 'int get_format(int)'
device/samsung/galaxy5/libcopybit/copybit.cpp:120: error: 'int get_format(int)' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'void set_image(mdp_img*, const copybit_image_t*)':
device/samsung/galaxy5/libcopybit/copybit.cpp:617: error: redefinition of 'void set_image(mdp_img*, const copybit_image_t*)'
device/samsung/galaxy5/libcopybit/copybit.cpp:134: error: 'void set_image(mdp_img*, const copybit_image_t*)' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'void set_rects(copybit_context_t*, mdp_blit_req*, const copybit_rect_t*, const copybit_rect_t*, const copybit_rect_t*)':
device/samsung/galaxy5/libcopybit/copybit.cpp:631: error: redefinition of 'void set_rects(copybit_context_t*, mdp_blit_req*, const copybit_rect_t*, const copybit_rect_t*, const copybit_rect_t*)'
device/samsung/galaxy5/libcopybit/copybit.cpp:148: error: 'void set_rects(copybit_context_t*, mdp_blit_req*, const copybit_rect_t*, const copybit_rect_t*, const copybit_rect_t*)' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'void set_infos(copybit_context_t*, mdp_blit_req*, int)':
device/samsung/galaxy5/libcopybit/copybit.cpp:671: error: redefinition of 'void set_infos(copybit_context_t*, mdp_blit_req*, int)'
device/samsung/galaxy5/libcopybit/copybit.cpp:188: error: 'void set_infos(copybit_context_t*, mdp_blit_req*, int)' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'int msm_copybit(copybit_context_t*, const void*)':
device/samsung/galaxy5/libcopybit/copybit.cpp:681: error: redefinition of 'int msm_copybit(copybit_context_t*, const void*)'
device/samsung/galaxy5/libcopybit/copybit.cpp:198: error: 'int msm_copybit(copybit_context_t*, const void*)' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp:691: warning: comparison between signed and unsigned integer expressions
device/samsung/galaxy5/libcopybit/copybit.cpp:692: warning: format '%08lx' expects type 'long unsigned int', but argument 19 has type 'unsigned int'
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'int set_parameter_copybit(copybit_device_t*, int, int)':
device/samsung/galaxy5/libcopybit/copybit.cpp:722: error: redefinition of 'int set_parameter_copybit(copybit_device_t*, int, int)'
device/samsung/galaxy5/libcopybit/copybit.cpp:239: error: 'int set_parameter_copybit(copybit_device_t*, int, int)' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'int get(copybit_device_t*, int)':
device/samsung/galaxy5/libcopybit/copybit.cpp:788: error: redefinition of 'int get(copybit_device_t*, int)'
device/samsung/galaxy5/libcopybit/copybit.cpp:305: error: 'int get(copybit_device_t*, int)' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'int stretch_copybit(copybit_device_t*, const copybit_image_t*, const copybit_image_t*, const copybit_rect_t*, const copybit_rect_t*, const copybit_region_t*)':
device/samsung/galaxy5/libcopybit/copybit.cpp:816: error: redefinition of 'int stretch_copybit(copybit_device_t*, const copybit_image_t*, const copybit_image_t*, const copybit_rect_t*, const copybit_rect_t*, const copybit_region_t*)'
device/samsung/galaxy5/libcopybit/copybit.cpp:333: error: 'int stretch_copybit(copybit_device_t*, const copybit_image_t*, const copybit_image_t*, const copybit_rect_t*, const copybit_rect_t*, const copybit_region_t*)' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp:843: warning: comparison between signed and unsigned integer expressions
device/samsung/galaxy5/libcopybit/copybit.cpp:844: warning: comparison between signed and unsigned integer expressions
device/samsung/galaxy5/libcopybit/copybit.cpp:865: error: 'PRIV_FLAGS_DO_NOT_FLUSH' is not a member of 'private_handle_t'
device/samsung/galaxy5/libcopybit/copybit.cpp:866: error: 'MDP_BLIT_NON_CACHED' was not declared in this scope
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'int blit_copybit(copybit_device_t*, const copybit_image_t*, const copybit_image_t*, const copybit_region_t*)':
device/samsung/galaxy5/libcopybit/copybit.cpp:894: error: redefinition of 'int blit_copybit(copybit_device_t*, const copybit_image_t*, const copybit_image_t*, const copybit_region_t*)'
device/samsung/galaxy5/libcopybit/copybit.cpp:411: error: 'int blit_copybit(copybit_device_t*, const copybit_image_t*, const copybit_image_t*, const copybit_region_t*)' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'int close_copybit(hw_device_t*)':
device/samsung/galaxy5/libcopybit/copybit.cpp:908: error: redefinition of 'int close_copybit(hw_device_t*)'
device/samsung/galaxy5/libcopybit/copybit.cpp:425: error: 'int close_copybit(hw_device_t*)' previously defined here
device/samsung/galaxy5/libcopybit/copybit.cpp: In function 'int open_copybit(const hw_module_t*, const char*, hw_device_t**)':
device/samsung/galaxy5/libcopybit/copybit.cpp:919: error: redefinition of 'int open_copybit(const hw_module_t*, const char*, hw_device_t**)'
device/samsung/galaxy5/libcopybit/copybit.cpp:436: error: 'int open_copybit(const hw_module_t*, const char*, hw_device_t**)' previously defined here
make: *** [out/target/product/galaxy5/obj/SHARED_LIBRARIES/copybit.galaxy5_intermediates/copybit.o] Error 1
Hello, guys! As I can see there a lot of Polish people (like me) I decided to make Polish language for your favourite AROMA Installer.
DOWNLOAD HERE!
Instructions:
Download file from the link above
Don't change its name
Paste it into META-INF/com/google/android/aroma/langs
Open aroma-config file in text editor (Notepad++ recommended)
Find language selection section
Copy the last position and edit it, so it will look like that (REMOVE COMA IN NEW ONE, ADD IN PREVIOUS! CHANGE NUMBERS!):
Code:
"German", "Willkommen bei Installer", 0, #-- selected.0 = 10
"Polish", "Witamy w instalatorze!", 0 #-- selected.0 = 11
Now find last if prop:
Code:
if prop("lang.prop","selected.0")=="xyz" then
loadlang("langs/xyz.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" );
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" );
endif;
...copy it, and mod it so it will look like that:
Code:
if prop("lang.prop","selected.0")=="10" then
loadlang("langs/de.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" );
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" );
endif;
Code:
if prop("lang.prop","selected.0")=="11" then
loadlang("langs/pl.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" );
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" );
endif;
Save the aroma-config file.
Finally your aroma-config should look like this (edited language section is shown here):
Code:
#---------------------------------[ Selectbox Without Group ]----------------------------------#
# TITLE | SUBTITLE | Initial Value #
#------------------+-----------------------------------------------------------+---------------#
"English", "Welcome to installer", 1, #-- selected.0 = 1
"Indonesian", "Selamat datang di installer", 0, #-- selected.0 = 2
"Espanol", "Bienvenido al instalador", 0, #-- selected.0 = 3
"Simplified Chinese","?????????", 0, #-- selected.0 = 4
"Arabic", "?????????", 0, #-- selected.0 = 5
"French", "Bienvenue dans l'installateur", 0, #-- selected.0 = 6
"Russian", "?????????", 0, #-- selected.0 = 7
"Italian", "Benvenuti installer", 0, #-- selected.0 = 8
"Hebrew", "?????????", 0, #-- selected.0 = 9
"German", "Willkommen bei Installer", 0, #-- selected.0 = 10
"Polish", "Witamy w instalatorze!", 0 #-- selected.0 = 11
#--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
);
##
# SET LANGUAGE & FONT FAMILY
#
if prop("lang.prop","selected.0")=="1" then
loadlang("langs/en.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" ); #-- "0" = Small Font ( Look at Fonts & UNICODE Demo Below )
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" ); #-- "1" = Big Font
endif;
if prop("lang.prop","selected.0")=="2" then
loadlang("langs/id.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" );
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" );
endif;
if prop("lang.prop","selected.0")=="3" then
loadlang("langs/es.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" );
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" );
endif;
if prop("lang.prop","selected.0")=="4" then
loadlang("langs/cn.lang");
fontresload( "0", "ttf/DroidSansFallback.ttf;ttf/Roboto-Regular.ttf", "12" ); #-- Use sets of font (Font Family)
fontresload( "1", "ttf/DroidSansFallback.ttf;ttf/Roboto-Regular.ttf", "18" );
endif;
if prop("lang.prop","selected.0")=="5" then
loadlang("langs/ar.lang");
fontresload( "0", "ttf/DroidSansArabic.ttf;ttf/Roboto-Regular.ttf", "12" ); #-- Use sets of font (Font Family)
fontresload( "1", "ttf/DroidSansArabic.ttf;ttf/Roboto-Regular.ttf", "18" );
endif;
if prop("lang.prop","selected.0")=="6" then
loadlang("langs/fr.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" );
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" );
endif;
if prop("lang.prop","selected.0")=="7" then
loadlang("langs/ru.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" );
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" );
endif;
if prop("lang.prop","selected.0")=="8" then
loadlang("langs/it.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" );
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" );
endif;
if prop("lang.prop","selected.0")=="9" then
loadlang("langs/he.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" );
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" );
endif;
if prop("lang.prop","selected.0")=="10" then
loadlang("langs/de.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" );
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" );
endif;
if prop("lang.prop","selected.0")=="11" then
loadlang("langs/pl.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" );
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" );
endif;
Done. Now you can enjoy Polish language in your AROMA Installer.
AROMA Installer Original Thread HERE
Big thanks to amarullz! His awesome AROMA is one of the most amazing miracles in Android world!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
https://github.com/jcsullins/qdloader/blob/master/qdload.pl#L613
Line 613 is where this occurs.
Whenever I try and flash things over Linux using qdload.pl this error is the result. Linux right now is my only option for debricking my device, since none of the windows applications are capable of removing it from the state that it is in.
The msm8974 downloader tools and their variants, along with tools like qpst are all capable of rebuilding partition tables and any damage that may have been done to the emmc as far as I'm aware, since I got my friend to wipe everything through twrp commands on his OPO and the ColorOs Download tool fully restored him from that state.
What I'm hoping is that someone can create a script I can use in linux that is capable of formatting /dev/ on my device and 'unblocking' whatever it is that is holding all these tools back so to speak. Any help at all is greatly
appreciated.
Please don't repost the various hardbrick tutorials, I've seen enough of them, and no, those tools aren't capable of fixing my device.
Code:
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use Fcntl;
$| = 1;
my @crcTable = (
0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
);
sub writeMagic {
my $fd = shift;
return undef
if (
!sendPacket(
$fd,
deserialize(
"01 51 43 4f 4d 20 66 61 73 74 20 64 6f 77 6e 6c 6f 61 64 20 70 72 6f 74 6f 63 6f 6c 20 68 6f 73 74 03 03 09"
)
)
);
return 1;
}
sub writeChunk {
my $fd = shift;
my $address = shift;
my $chunk = shift;
my $length = length($chunk);
my $response;
#print "Writing chunk...\n";
if (
!sendPacket(
$fd,
deserialize(
"0f "
. serial32($address) . " "
. serial16($length) . " "
. serialize($chunk)
)
)
)
{
print "Failed to send chunk.\n";
return undef;
}
if ( !( $response = readPacket( $fd, 2.0 ) ) ) {
print "Failed to get response.\n";
return undef;
}
my @responseBytes = unpack( 'C*', $response );
if ( scalar @responseBytes != 1 || $responseBytes[0] != 2 ) {
print "Invalid Response: ", serialize($response), "\n";
return undef;
}
return 1;
}
sub writeChunk2 {
my $fd = shift;
my $address = shift;
my $chunk = shift;
my $sentPacketsRef = shift;
my $length = length($chunk);
my $response;
#print "Writing chunk...\n";
if (
!sendPacket(
$fd,
deserialize(
"07 " . serial32le($address) . " " . serialize($chunk)
)
)
)
{
print "Failed to send chunk.\n";
return undef;
}
$sentPacketsRef->{ sprintf( "%0.8x", $address ) } = 1;
my $outstanding = scalar keys %{$sentPacketsRef};
my $acktimeout;
if ( $outstanding > 8 ) {
$acktimeout = 2.0;
}
elsif ( $outstanding > 4 ) {
$acktimeout = 0.25;
}
else {
$acktimeout = 0.01;
}
$acktimeout = 10.0;
while ( $response = readPacket( $fd, $acktimeout ) ) {
my @responseBytes = unpack( 'C*', $response );
if ( scalar @responseBytes != 5 || $responseBytes[0] != 8 ) {
print "Invalid Response: ", serialize($response), "\n";
exit 1;
}
my $ackpacket;
$ackpacket = sprintf(
'%.2x%.2x%.2x%.2x',
$responseBytes[4], $responseBytes[3],
$responseBytes[2], $responseBytes[1]
);
delete $sentPacketsRef->{$ackpacket};
$outstanding = scalar keys %{$sentPacketsRef};
print "Response: ACK 0x", $ackpacket, " (outstanding: ",
$outstanding, ")\n";
if ( $outstanding == 0 ) {
$acktimeout = 0.0001;
}
}
return 1;
}
sub uploadFile {
my $fd = shift;
my $address = shift;
my $filename = shift;
local $/ = undef;
return undef if ( !open( FILE, $filename ) );
my $data = <FILE>;
close FILE;
while ( length $data ) {
my $chunk = substr( $data, 0, 1024 );
my $restOfData =
substr( $data, length($chunk), length($data) - length($chunk) );
print "Writing ", length($chunk), " bytes to 0x",
sprintf( '%.8x', $address ), "; ", length($restOfData),
" bytes left.\n";
if ( !writeChunk( $fd, $address, $chunk ) ) {
print "uploadFile failed.\n";
exit 1;
}
$address += length($chunk);
$data = $restOfData;
}
return 1;
}
sub uploadFile2 {
my $fd = shift;
my $address = shift;
my $filename = shift;
my $response;
my %sentPackets = ();
local $/ = undef;
return undef if ( !open( FILE, $filename ) );
my $data = <FILE>;
close FILE;
while ( length $data ) {
my $chunk = substr( $data, 0, 1024 );
my $restOfData =
substr( $data, length($chunk), length($data) - length($chunk) );
print "Writing ", length($chunk), " bytes to 0x",
sprintf( '%.8x', $address ), "; ", length($restOfData),
" bytes left.\n";
return undef
if ( !writeChunk2( $fd, $address, $chunk, \%sentPackets ) );
$address += length($chunk);
$data = $restOfData;
#select(undef, undef, undef, 0.1);
}
my $numout = scalar keys %sentPackets;
while ( $numout > 0 ) {
if ( !( $response = readPacket( $fd, 5.0 ) ) ) {
print "Failed to receive ACK for ", $numout, " packets\n";
foreach my $packet ( keys %sentPackets ) {
print "Outstanding: 0x", $packet, "\n";
}
exit 1;
}
my @responseBytes = unpack( 'C*', $response );
if ( scalar @responseBytes != 5 || $responseBytes[0] != 8 ) {
print "Invalid Response: ", serialize($response), "\n";
exit 1;
}
my $ackpacket;
$ackpacket = sprintf(
'%.2x%.2x%.2x%.2x',
$responseBytes[4], $responseBytes[3],
$responseBytes[2], $responseBytes[1]
);
delete $sentPackets{$ackpacket};
$numout = scalar keys %sentPackets;
print "Response: ACK 0x", $ackpacket, " (outstanding: ", $numout, ")\n";
}
return 1;
}
sub getSoftwareVersion {
my $fd = shift;
my $response;
return undef if ( !sendPacket( $fd, deserialize("0c") ) );
return undef if ( !( $response = readPacket($fd) ) );
my @responseBytes = unpack( 'C*', $response );
if ( $responseBytes[0] != 0x0d ) {
print "Invalid Response: ", serialize($response), "\n";
return undef;
}
return pack( 'C*',
map { hex } split( /\s/, serialize( substr( $response, 2 ) ) ) );
}
sub setupTTY {
my $tty;
my $fd;
my @usbDevices;
my @devices =
grep { !/\:/ && !/usb/ }
map { ( split( /\//, $_ ) )[-1] } glob '/sys/bus/usb/devices/*';
foreach my $device (@devices) {
my $product = getFile("/sys/bus/usb/devices/$device/idProduct");
my $vendor = getFile("/sys/bus/usb/devices/$device/idVendor");
next if ( !defined $product || !defined $vendor );
if ( $vendor eq '05c6' && $product eq '9008' ) {
# it's us.
my @drivers = grep /^$device:\d+\.\d+$/,
map { ( split( /\//, $_ ) )[-1] }
glob "/sys/bus/usb/devices/$device/$device:*";
foreach my $driver (@drivers) {
my @ttys =
map { ( split( /\//, $_ ) )[-1] }
glob "/sys/bus/usb/devices/$device/$driver/tty*";
if ( scalar @ttys == 1 ) {
$tty = "/dev/$ttys[0]";
}
}
}
}
if ( defined $tty ) {
system "/bin/stty raw -iexten -echo < $tty";
return undef if ( !sysopen( $fd, $tty, O_RDWR | O_SYNC ) );
return ( $fd, $tty );
}
return undef;
}
sub getFile {
my $file = shift;
local $/ = undef;
return undef if ( !open( FILE, $file ) );
my $content = <FILE>;
$/ = "\n";
close FILE;
chomp $content;
return $content;
}
sub execute {
my $fd = shift;
my $address = shift;
my $response;
if ( !sendPacket( $fd, deserialize( "05 " . serial32($address) ) ) ) {
print "Failed to send packed\n";
print "execute failed\n";
exit 1;
}
if ( !( $response = readPacket( $fd, 5.0 ) ) ) {
print "Failed to get response.\n";
print "execute failed\n";
exit 1;
}
my @responseBytes = unpack( 'C*', $response );
if ( scalar @responseBytes != 1 || $responseBytes[0] != 2 ) {
print "Invalid Response: ", serialize($response), "\n";
print "execute failed\n";
exit 1;
}
return 1;
}
sub serialize {
my $buffer = shift;
return join( ' ', map { sprintf( '%.2x', $_ ) } unpack( 'C*', $buffer ) );
}
sub deserialize {
my $buffer = shift;
return pack( 'C*', map { hex } split( /\s+/, $buffer ) );
}
sub crcByte {
my $crc = shift;
my $c = shift;
return ( ( $crc >> 8 ) & 0xffff ) ^ $crcTable[ ( $crc ^ $c ) & 0xff ];
}
sub crc {
my $crc = shift;
my $buffer = shift;
my @bytes = unpack( 'C*', $buffer );
foreach (@bytes) {
$crc = crcByte( $crc, $_ );
}
return ~$crc & 0xffff;
}
sub swap16 {
my $short = shift;
return ( ( $short << 8 ) | ( $short >> 8 ) ) & 0xffff;
}
sub swap32 {
my $long = shift;
return ( ( $long << 24 ) | ( ( $long & 0xff00 ) << 8 ) |
( ( $long & 0xff0000 ) >> 8 ) | ( $long >> 24 ) );
}
sub setupPacket {
my $packet = shift;
my $crc = swap16( crc( 0xffff, $packet ) );
return deserialize( "7e "
. serialize( escape( $packet . deserialize( serial16($crc) ) ) )
. " 7e" );
}
sub escape {
my $buffer = shift;
my @bytes = unpack( 'C*', $buffer );
my @newBytes;
foreach my $byte (@bytes) {
if ( $byte == 0x7e ) {
push @newBytes, 0x7d;
push @newBytes, 0x5e;
}
elsif ( $byte == 0x7d ) {
push @newBytes, 0x7d;
push @newBytes, 0x5d;
}
else {
push @newBytes, $byte;
}
}
return pack( 'C*', @newBytes );
}
sub unescape {
my $buffer = shift;
my @bytes = unpack( 'C*', $buffer );
my @newBytes;
my $escape = 0;
foreach my $byte (@bytes) {
if ($escape) {
if ( $byte == 0x5e ) {
push @newBytes, 0x7e;
}
elsif ( $byte == 0x5d ) {
push @newBytes, 0x7d;
}
else {
print "Fatal error unescaping buffer!\n";
return undef;
}
$escape = 0;
}
else {
if ( $byte == 0x7d ) {
$escape = 1;
}
else {
push @newBytes, $byte;
}
}
}
return pack( 'C*', @newBytes );
}
sub serial16le {
my $short = shift;
my $lbyte = $short & 0xff;
my $hbyte = $short >> 8;
return sprintf( '%.2x %.2x', $lbyte, $hbyte );
}
sub serial32le {
my $long = shift;
my $lshort = $long & 0xffff;
my $hshort = $long >> 16;
return serial16le($lshort) . ' ' . serial16le($hshort);
}
sub serial16 {
my $short = shift;
my $lbyte = $short & 0xff;
my $hbyte = $short >> 8;
return sprintf( '%.2x %.2x', $hbyte, $lbyte );
}
sub serial32 {
my $long = shift;
my $lshort = $long & 0xffff;
my $hshort = $long >> 16;
return serial16($hshort) . ' ' . serial16($lshort);
}
sub readPacket {
my $fd = shift;
my $timeout = shift;
my $rfhbits = "";
my $byte;
if ( defined($timeout) ) {
vec( $rfhbits, fileno($fd), 1 ) = 1;
return undef unless select( $rfhbits, undef, undef, $timeout ) >= 0;
return undef unless vec( $rfhbits, fileno($fd), 1 );
}
my $retval = sysread( $fd, $byte, 1 );
if ( 0 && !$retval ) {
print "readPacket_retval: $retval\n";
print "$!\n";
}
return undef if ( !$retval );
return undef if ( unpack( 'C', $byte ) != 0x7e );
my @bytes;
while (1) {
$retval = sysread( $fd, $byte, 1 );
if ( !$retval ) {
if (0) {
print "retval (while): $retval\n";
print "$!\n";
}
return undef;
}
last if ( unpack( 'C', $byte ) == 0x7e );
push @bytes, unpack( 'C', $byte );
}
my $buffer = unescape( pack( 'C*', @bytes ) );
#print "RECEIVED: " . serialize($buffer) . "\n";
@bytes = unpack( 'C*', $buffer );
pop @bytes;
pop @bytes;
return deserialize( join( ' ', map { sprintf( '%.2x', $_ ) } @bytes ) );
}
sub sendPacket {
my $fd = shift;
my $buffer = shift;
#print "SENDING: ", serialize(setupPacket($buffer)), "\n";
my $retval =
syswrite( $fd, setupPacket($buffer), length( setupPacket($buffer) ) );
if ( !$retval ) {
print "$!\n";
}
return undef if ( !$retval );
return 1;
}
sub doMagic {
my $fd = shift;
my $response;
print "Sending MAGIC...\n";
writeMagic($fd);
my $haveGoodResponse = 0;
my $haveErrorResponse = 0;
my $haveUnknownResponse = 0;
while ( $response = readPacket( $fd, 2 ) ) {
my @responseBytes = unpack( 'C*', $response );
if ( scalar @responseBytes > 35 && $responseBytes[0] == 0x02 ) {
my $magicCodeCheck = "QCOM fast download protocol targ";
my $magicCodeRecvd = substr( $response, 1, 32 );
if ( $magicCodeRecvd eq $magicCodeCheck ) {
$haveGoodResponse = 1;
}
}
elsif ( $responseBytes[0] == 0x0e ) {
# msg
my $msg = pack( 'C*',
map { hex }
split( /\s/, serialize( substr( $response, 1 ) ) ) );
$msg =~ tr/\n/ /;
$msg =~ tr/\r/ /;
print "MSG: ", $msg, "\n";
}
elsif ( $responseBytes[0] == 0x0d ) {
# error
$haveErrorResponse = 1;
my $msg = pack( 'C*',
map { hex }
split( /\s/, serialize( substr( $response, 5 ) ) ) );
$msg =~ tr/\n//d;
$msg =~ tr/\r//d;
print "ERROR: ", $msg, "\n";
}
else {
$haveUnknownResponse = 1;
print "Response: ", serialize($response), "\n";
}
}
if ( $haveGoodResponse != 1
|| $haveErrorResponse == 1
|| $haveUnknownResponse == 1 )
{
print "Invalid MAGIC response.\n";
exit 1;
}
}
sub doSoftwareVersion {
my $fd = shift;
my $response;
print "Requesting SoftwareVersion...\n";
my $swver = getSoftwareVersion($fd);
if ( !defined $swver ) {
print "Failed to get software version\n";
exit 1;
}
print "Version: $swver\n";
}
sub doRequestDload {
my $fd = shift;
my $response;
print "Requesting Dload...\n";
if ( !sendPacket( $fd, deserialize("3a") ) ) {
print "Failed requestDload\n";
exit 1;
}
print "requestDload send ok\n";
if ( !( $response = readPacket($fd) ) ) {
print "Failed to read response.\n";
exit 1;
}
print "Param: ", serialize($response), "\n";
}
sub doReboot {
my $fd = shift;
my $response;
print "Requesting Reboot...\n";
if ( !sendPacket( $fd, deserialize("0a") ) ) {
print "Failed requestReboot\n";
exit 1;
}
print "requestReboot send ok\n";
if ( !( $response = readPacket($fd) ) ) {
print "Failed to read response.\n";
exit 1;
}
print "Param: ", serialize($response), "\n";
}
sub doRequestParam {
my $fd = shift;
my $response;
print "Requesting Params...\n";
if ( !sendPacket( $fd, deserialize("07") ) ) {
print "Failed requestParam\n";
exit 1;
}
if ( !( $response = readPacket($fd) ) ) {
print "Failed to read response.\n";
exit 1;
}
my @responseBytes = unpack( 'C*', $response );
if ( $responseBytes[0] != 8 ) {
print "Invalid Response: ", serialize($response), "\n";
exit 1;
}
print "Params: ", serialize( substr( $response, 1 ) ), "\n";
}
#####
##### second stage cmds
#####
sub doCloseFlush {
my $fd = shift;
my $response;
print "Sending CloseFlush...\n";
if ( !sendPacket( $fd, deserialize("15") ) ) {
print "Failed CloseFlush\n";
exit 1;
}
if ( !( $response = readPacket( $fd, 2.0 ) ) ) {
print "Failed to read response.\n";
exit 1;
}
my @responseBytes = unpack( 'C*', $response );
if ( scalar @responseBytes != 1 || $responseBytes[0] != 0x16 ) {
print "Invalid Response: ", serialize($response), "\n";
exit 1;
}
}
sub doSecureMode {
my $fd = shift;
my $response;
print "Sending secureMode...\n";
if ( !sendPacket( $fd, deserialize("17 01") ) ) {
print "Failed secureMode\n";
exit 1;
}
if ( !( $response = readPacket( $fd, 2.0 ) ) ) {
print "Failed to read response.\n";
exit 1;
}
my @responseBytes = unpack( 'C*', $response );
if ( scalar @responseBytes != 1 || $responseBytes[0] != 0x18 ) {
print "Invalid Response: ", serialize($response), "\n";
exit 1;
}
}
sub doOpenMulti {
my $fd = shift;
my $response;
print "Sending openMulti ...\n";
if ( !sendPacket( $fd, deserialize("1b 21") ) ) {
print "Failed openMulti\n";
exit 1;
}
my $haveGoodResponse = 0;
my $haveErrorResponse = 0;
my $haveUnknownResponse = 0;
while ( $response = readPacket( $fd, 2 ) ) {
my @responseBytes = unpack( 'C*', $response );
if ( scalar @responseBytes == 2
&& $responseBytes[0] == 0x1c
&& $responseBytes[1] == 0 )
{
$haveGoodResponse = 1;
}
elsif ( $responseBytes[0] == 0x0e ) {
# msg
my $msg = pack( 'C*',
map { hex }
split( /\s/, serialize( substr( $response, 1 ) ) ) );
$msg =~ tr/\n/ /;
$msg =~ tr/\r/ /;
print "MSG: ", $msg, "\n";
}
elsif ( $responseBytes[0] == 0x0d ) {
# error
$haveErrorResponse = 1;
my $msg = pack( 'C*',
map { hex }
split( /\s/, serialize( substr( $response, 5 ) ) ) );
$msg =~ tr/\n//d;
$msg =~ tr/\r//d;
print "ERROR: ", $msg, "\n";
}
else {
$haveUnknownResponse = 1;
print "Response: ", serialize($response), "\n";
}
}
if ( $haveGoodResponse != 1
|| $haveErrorResponse == 1
|| $haveUnknownResponse == 1 )
{
print "Invalid openMulti response.\n";
exit 1;
}
}
sub doReset2 {
my $fd = shift;
my $response;
print "Requesting Reset...\n";
if ( !sendPacket( $fd, deserialize("0b") ) ) {
print "Failed doReset\n";
exit 1;
}
if ( !( $response = readPacket( $fd, 2.0 ) ) ) {
print "Failed to read response.\n";
exit 1;
}
my @responseBytes = unpack( 'C*', $response );
if ( scalar @responseBytes != 1 || $responseBytes[0] != 0x0c ) {
print "Invalid Response: ", serialize($response), "\n";
exit 1;
}
}
###
### main stages
###
sub doStage1 {
my $fname = shift;
my $retval;
my $response;
my ( $fd, $tty ) = setupTTY();
if ( !defined $fd ) {
print "Failed to find/open TTY.\n";
exit 1;
}
while ( $response = readPacket( $fd, 0.1 ) ) {
print "Ignoring response: ", serialize($response), "\n";
}
doSoftwareVersion($fd);
doRequestParam($fd);
print "Uploading file '", $fname, "' to QDLOAD...\n";
exit 1 if !defined( uploadFile( $fd, 0x2a000000, $fname ) );
print "Executing file...\n";
execute( $fd, 0x2a000000 );
close($fd);
}
sub doStage2 {
my $laddr = shift;
my $lfname = shift;
my $retval;
my $response;
my ( $fd, $tty ) = setupTTY();
if ( !defined $fd ) {
print "Failed to find/open TTY.\n";
exit 1;
}
doMagic($fd);
#closeFlush($fd);
doSecureMode($fd);
doOpenMulti($fd);
print "Uploading file '", $lfname, "'...\n";
uploadFile2( $fd, $laddr, $lfname );
doCloseFlush($fd);
###doReset2($fd);
close($fd);
}
sub doResetStage {
my $retval;
my $response;
my ( $fd, $tty ) = setupTTY();
if ( !defined $fd ) {
print "Failed to find/open TTY.\n";
exit 1;
}
doReset2($fd);
close($fd);
}
sub doTestCmd {
my $cmd = shift;
my $retval;
my $response;
my ( $fd, $tty ) = setupTTY();
if ( !defined $fd ) {
print "Failed to find/open TTY.\n";
exit 1;
}
doMagic($fd);
print "Sending cmd '", $cmd, "'\n";
if ( !sendPacket( $fd, deserialize($cmd) ) ) {
print "Failed send\n";
exit 1;
}
while ( $response = readPacket( $fd, 2 ) ) {
my @responseBytes = unpack( 'C*', $response );
if ( $responseBytes[0] == 0x0e ) {
# msg
my $msg = pack( 'C*',
map { hex }
split( /\s/, serialize( substr( $response, 1 ) ) ) );
$msg =~ tr/\n/ /;
$msg =~ tr/\r/ /;
print "MSG: ", $msg, "\n";
}
elsif ( $responseBytes[0] == 0x0d ) {
# error
my $msg = pack( 'C*',
map { hex }
split( /\s/, serialize( substr( $response, 5 ) ) ) );
$msg =~ tr/\n//d;
$msg =~ tr/\r//d;
print "ERROR: ", $msg, "\n";
}
else {
print "Response: ", serialize($response), "\n";
}
}
close($fd);
}
sub doUsage {
print "Usage: qdload --pfile <stage1_bin>\n";
print " | --lfile <stage2_file>\n";
print " | --lfile <stage2_file> --laddr <stage2_load_addr>\n";
print " | --lreset\n";
}
###
### main
###
my $opts_result;
my $opts_pfile;
my $opts_lfile;
my $opts_laddr;
my $opts_lreset;
my $opts_testcmd;
$opts_result = GetOptions(
"pfile=s" => \$opts_pfile,
"lfile=s" => \$opts_lfile,
"laddr=o" => \$opts_laddr,
"testcmd=s" => \$opts_testcmd,
"lreset" => \$opts_lreset
);
my $num_remaining_args = $#ARGV + 1;
if ( $num_remaining_args > 0 ) {
doUsage();
exit(1);
}
if ( !defined($opts_pfile)
&& !defined($opts_lfile)
&& !defined($opts_lreset)
&& !defined($opts_testcmd) )
{
doUsage();
exit(1);
}
if ( defined($opts_testcmd) ) {
doTestCmd($opts_testcmd);
exit(0);
}
if ( defined($opts_pfile) ) {
doStage1($opts_pfile);
sleep(2);
}
if ( defined($opts_lfile) ) {
my $addr = 0;
if ( defined($opts_laddr) ) {
$addr = $opts_laddr;
}
doStage2( $addr, $opts_lfile );
}
if ( defined($opts_lreset) ) {
doResetStage();
}
exit 0;
Bump. I really need some dev help with this :C
Bump again. I've found that whilst sitting idle, but undoubtedly "powered on" as far as I can tell the processor actually does get some warmth to it. Just a note since I had the back off.
Nobody, :/
- I have implemented a first cut of kexec hardboot patch for the Apollo and Thor Devices
- @Tasssadar created the excellent MultiROM
- I am working to provide support for our devices (Apollo and Thor) and as such this is first step
- The commit in my SlimLP kernel is here.
- This is the patch:
Code:
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 9468df5..a8b637a 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2249,6 +2249,32 @@ config ATAGS_PROC
Should the atags used to boot the kernel be exported in an "atags"
file in procfs. Useful with kexec.
+config KEXEC_HARDBOOT
+ bool "Support hard booting to a kexec kernel"
+ depends on KEXEC
+ help
+ Allows hard booting (i.e., with a full hardware reboot) to a kernel
+ previously loaded in memory by kexec. This works around the problem of
+ soft-booted kernel hangs due to improper device shutdown and/or
+ reinitialization. Support is comprised of two components:
+
+ First, a "hardboot" flag is added to the kexec syscall to force a hard
+ reboot in relocate_new_kernel() (which requires machine-specific assembly
+ code). This also requires the kexec userspace tool to load the kexec'd
+ kernel in memory region left untouched by the bootloader (i.e., not
+ explicitly cleared and not overwritten by the boot kernel). Just prior
+ to reboot, the kexec kernel arguments are stashed in a machine-specific
+ memory page that must also be preserved. Note that this hardboot page
+ need not be reserved during regular kernel execution.
+
+ Second, the zImage decompresor of the boot (bootloader-loaded) kernel is
+ modified to check the hardboot page for fresh kexec arguments, and if
+ present, attempts to jump to the kexec'd kernel preserved in memory.
+
+ Note that hardboot support is only required in the boot kernel and any
+ kernel capable of performing a hardboot kexec. It is _not_ required by a
+ kexec'd kernel.
+
config CRASH_DUMP
bool "Build kdump crash kernel (EXPERIMENTAL)"
depends on EXPERIMENTAL
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 64a6d6f..6c9d423 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -10,6 +10,13 @@
*/
#include <linux/linkage.h>
+ .arch armv7-a
+
+#ifdef CONFIG_KEXEC_HARDBOOT
+ #include <asm/kexec.h>
+ #include <asm/memory.h>
+#endif
+
/*
* Debugging stuff
*
@@ -135,6 +142,64 @@ start:
1: mov r7, r1 @ save architecture ID
mov r8, r2 @ save atags pointer
+#ifdef CONFIG_KEXEC_HARDBOOT
+ /* Check hardboot page for a kexec kernel. */
+ ldr r3, =KEXEC_HB_PAGE_ADDR
+ ldr r0, [r3]
+ ldr r1, =KEXEC_HB_PAGE_MAGIC
+ teq r0, r1
+ bne not_booting_other
+
+ /* Clear hardboot page magic to avoid boot loop. */
+ mov r0, #0
+ str r0, [r3]
+
+ /*
+ * Copy dtb from location up high in memory to default location.
+ * Kernel freezes if this is not done.
+ */
+ ldr r1, [r3, #12] @ kexec_boot_atags
+ ldr r2, [r3, #16] @ kexec_boot_atags_len
+ mov r5, #0 @ iterator
+catags_cpy:
+ ldr r0, [r1, r5] @ from kexec_boot_atags
+ str r0, [r8, r5] @ to atags_pointer
+ add r5, r5, #4
+ cmp r5, r2
+ blo catags_cpy
+
+#ifdef KEXEC_HB_KERNEL_LOC
+ /*
+ * Copy kernel from location up high in memory to location in first 128MB.
+ * Bootloader on hammerhead erases first 128MB of ram on reboot, so it can't
+ * be in there before reboot, but decompressing in location above 128MB takes
+ * a long time. This memcpy is much quicker, for some reason.
+ */
+ ldr r2, [r3, #4] @ kexec_start_address
+ ldr r4, [r3, #20] @ kexec_kernel_len
+ ldr r6, =KEXEC_HB_KERNEL_LOC @ target
+ mov r5, #0 @ iterator
+kernel_cpy:
+ ldr r0, [r2, r5] @ from kexec_start_address
+ str r0, [r6, r5] @ to KEXEC_HB_KERNEL_LOC
+ add r5, r5, #4
+ cmp r5, r4
+ blo kernel_cpy
+#else
+ ldr r6, [r3, #4] @ kexec_start_address
+#endif
+
+ /* set registers and boot kexecd' kernel */
+ mov r0, #0
+ ldr r1, [r3, #8] @ kexec_mach_type
+ mov r2, r8 @ atags pointer
+ mov pc, r6
+
+ .ltorg
+
+not_booting_other:
+#endif
+
#ifndef __ARM_ARCH_2__
/*
* Booting from Angel - need to enter SVC mode and disable
@@ -176,7 +241,19 @@ not_angel:
ldr r4, =zreladdr
#endif
- bl cache_on
+ /*
+ * Set up a page table only if it won't overwrite ourself.
+ * That means r4 < pc && r4 - 16k page directory > &_end.
+ * Given that r4 > &_end is most unfrequent, we add a rough
+ * additional 1MB of room for a possible appended DTB.
+ */
+ mov r0, pc
+ cmp r0, r4
+ ldrcc r0, LC0+32
+ addcc r0, r0, pc
+ cmpcc r4, r0
+ orrcc r4, r4, #1 @ remember we skipped cache_on
+ blcs cache_on
restart: adr r0, LC0
ldmia r0, {r1, r2, r3, r6, r10, r11, r12}
@@ -222,7 +299,7 @@ restart: adr r0, LC0
* r0 = delta
* r2 = BSS start
* r3 = BSS end
- * r4 = final kernel address
+ * r4 = final kernel address (possibly with LSB set)
* r5 = appended dtb size (still unknown)
* r6 = _edata
* r7 = architecture ID
@@ -270,6 +347,7 @@ restart: adr r0, LC0
*/
cmp r0, #1
sub r0, r4, #TEXT_OFFSET
+ bic r0, r0, #1
add r0, r0, #0x100
mov r1, r6
sub r2, sp, r6
@@ -316,12 +394,13 @@ dtb_check_done:
/*
* Check to see if we will overwrite ourselves.
- * r4 = final kernel address
+ * r4 = final kernel address (possibly with LSB set)
* r9 = size of decompressed image
* r10 = end of this image, including bss/stack/malloc space if non XIP
* We basically want:
* r4 - 16k page directory >= r10 -> OK
* r4 + image length <= address of wont_overwrite -> OK
+ * Note: the possible LSB in r4 is harmless here.
*/
add r10, r10, #16384
cmp r4, r10
@@ -369,7 +448,8 @@ dtb_check_done:
add sp, sp, r6
#endif
- bl cache_clean_flush
+ tst r4, #1
+ bleq cache_clean_flush
adr r0, BSYM(restart)
add r0, r0, r6
@@ -381,7 +461,7 @@ wont_overwrite:
* r0 = delta
* r2 = BSS start
* r3 = BSS end
- * r4 = kernel execution address
+ * r4 = kernel execution address (possibly with LSB set)
* r5 = appended dtb size (0 if not present)
* r7 = architecture ID
* r8 = atags pointer
@@ -444,6 +524,15 @@ not_relocated: mov r0, #0
cmp r2, r3
blo 1b
+ /*
+ * Did we skip the cache setup earlier?
+ * That is indicated by the LSB in r4.
+ * Do it now if so.
+ */
+ tst r4, #1
+ bic r4, r4, #1
+ blne cache_on
+
/*
* The C runtime environment should now be setup sufficiently.
* Set up some pointers, and start decompressing.
@@ -474,6 +563,7 @@ LC0: .word LC0 @ r1
.word _got_start @ r11
.word _got_end @ ip
.word .L_user_stack_end @ sp
+ .word _end - restart + 16384 + 1024*1024
.size LC0, . - LC0
#ifdef CONFIG_ARCH_RPC
@@ -510,6 +600,7 @@ cache_on: mov r3, #8 @ cache_on function
* to cover all 32bit address and cacheable and bufferable.
*/
__armv4_mpu_cache_on:
+ .arch armv4
mov r0, #0x3f @ 4G, the whole
mcr p15, 0, r0, c6, c7, 0 @ PR7 Area Setting
mcr p15, 0, r0, c6, c7, 1
@@ -614,13 +705,24 @@ __setup_mmu: sub r3, r4, #16384 @ Page directory size
mov pc, lr
ENDPROC(__setup_mmu)
[email protected] Enable unaligned access on v6, to allow better code generation
[email protected] for the decompressor C code:
+__armv6_mmu_cache_on:
+ mrc p15, 0, r0, c1, c0, 0 @ read SCTLR
+ bic r0, r0, #2 @ A (no unaligned access fault)
+ orr r0, r0, #1 << 22 @ U (v6 unaligned access model)
+ mcr p15, 0, r0, c1, c0, 0 @ write SCTLR
+ b __armv4_mmu_cache_on
+
__arm926ejs_mmu_cache_on:
#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
+ .arch armv5
mov r0, #4 @ put dcache in WT mode
mcr p15, 7, r0, c15, c0, 0
#endif
__armv4_mmu_cache_on:
+ .arch armv4
mov r12, lr
#ifdef CONFIG_MMU
mov r6, #CB_BITS | 0x12 @ U
@@ -641,6 +743,7 @@ __armv4_mmu_cache_on:
mov pc, r12
__armv7_mmu_cache_on:
+ .arch armv7-a
mov r12, lr
#ifdef CONFIG_MMU
mrc p15, 0, r11, c0, c1, 4 @ read ID_MMFR0
@@ -653,8 +756,12 @@ __armv7_mmu_cache_on:
mcrne p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
#endif
mrc p15, 0, r0, c1, c0, 0 @ read control reg
+ bic r0, r0, #1 << 28 @ clear SCTLR.TRE
orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement
orr r0, r0, #0x003c @ write buffer
+ bic r0, r0, #2 @ A (no unaligned access fault)
+ orr r0, r0, #1 << 22 @ U (v6 unaligned access model)
+ @ (needed for ARM1176)
#ifdef CONFIG_MMU
#ifdef CONFIG_CPU_ENDIAN_BE8
orr r0, r0, #1 << 25 @ big-endian page tables
@@ -687,6 +794,7 @@ __fa526_cache_on:
mov pc, r12
__arm6_mmu_cache_on:
+ .arch armv6
mov r12, lr
mov r6, #CB_BITS | 0x12 @ U
bl __setup_mmu
@@ -895,7 +1003,7 @@ proc_types:
.word 0x0007b000 @ ARMv6
.word 0x000ff000
- W(b) __armv4_mmu_cache_on
+ W(b) __armv6_mmu_cache_on
W(b) __armv4_mmu_cache_off
W(b) __armv6_mmu_cache_flush
@@ -1015,7 +1123,10 @@ cache_clean_flush:
mov r3, #16
b call_cache_fn
+ .arch armv4
__armv4_mpu_cache_flush:
+ tst r4, #1
+ movne pc, lr
mov r2, #1
mov r3, #0
mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
@@ -1033,6 +1144,8 @@ __armv4_mpu_cache_flush:
mov pc, lr
__fa526_cache_flush:
+ tst r4, #1
+ movne pc, lr
mov r1, #0
mcr p15, 0, r1, c7, c14, 0 @ clean and invalidate D cache
mcr p15, 0, r1, c7, c5, 0 @ flush I cache
@@ -1040,14 +1153,19 @@ __fa526_cache_flush:
mov pc, lr
__armv6_mmu_cache_flush:
+ .arch armv6
mov r1, #0
- mcr p15, 0, r1, c7, c14, 0 @ clean+invalidate D
+ tst r4, #1
+ mcreq p15, 0, r1, c7, c14, 0 @ clean+invalidate D
mcr p15, 0, r1, c7, c5, 0 @ invalidate I+BTB
- mcr p15, 0, r1, c7, c15, 0 @ clean+invalidate unified
+ mcreq p15, 0, r1, c7, c15, 0 @ clean+invalidate unified
mcr p15, 0, r1, c7, c10, 4 @ drain WB
mov pc, lr
+ .arch armv7-a
__armv7_mmu_cache_flush:
+ tst r4, #1
+ bne iflush
mrc p15, 0, r10, c0, c1, 5 @ read ID_MMFR1
tst r10, #0xf << 16 @ hierarchical cache (ARMv7)
mov r10, #0
@@ -1107,14 +1225,20 @@ iflush:
mcr p15, 0, r10, c7, c5, 4 @ ISB
mov pc, lr
+ .arch armv5
__armv5tej_mmu_cache_flush:
+ tst r4, #1
+ movne pc, lr
1: mrc p15, 0, r15, c7, c14, 3 @ test,clean,invalidate D cache
bne 1b
mcr p15, 0, r0, c7, c5, 0 @ flush I cache
mcr p15, 0, r0, c7, c10, 4 @ drain WB
mov pc, lr
+ .arch armv4
__armv4_mmu_cache_flush:
+ tst r4, #1
+ movne pc, lr
mov r2, #64*1024 @ default: 32K dcache size (*2)
mov r11, #32 @ default: 32 byte line size
mrc p15, 0, r3, c0, c0, 1 @ read cache type
@@ -1148,10 +1272,14 @@ no_cache_id:
__armv3_mmu_cache_flush:
__armv3_mpu_cache_flush:
+ tst r4, #1
+ movne pc, lr
mov r1, #0
mcr p15, 0, r1, c7, c0, 0 @ invalidate whole cache v3
mov pc, lr
+ .arch armv4
+
/*
* Various debugging routines for printing hex characters and
* memory, which again must be relocatable.
diff --git a/arch/arm/configs/apollo-android_defconfig b/arch/arm/configs/apollo-android_defconfig
index 4f143ea..1d498b6 100644
--- a/arch/arm/configs/apollo-android_defconfig
+++ b/arch/arm/configs/apollo-android_defconfig
@@ -674,7 +674,8 @@ CONFIG_ZBOOT_ROM_BSS=0
# CONFIG_ARM_APPENDED_DTB is not set
CONFIG_CMDLINE=""
# CONFIG_XIP_KERNEL is not set
-# CONFIG_KEXEC is not set
+CONFIG_KEXEC=y
+CONFIG_KEXEC_HARDBOOT=y
# CONFIG_CRASH_DUMP is not set
# CONFIG_AUTO_ZRELADDR is not set
diff --git a/arch/arm/include/asm/kexec.h b/arch/arm/include/asm/kexec.h
index c2b9b4b..564c55b 100644
--- a/arch/arm/include/asm/kexec.h
+++ b/arch/arm/include/asm/kexec.h
@@ -17,6 +17,10 @@
#define KEXEC_ARM_ATAGS_OFFSET 0x1000
#define KEXEC_ARM_ZIMAGE_OFFSET 0x8000
+#ifdef CONFIG_KEXEC_HARDBOOT
+ #define KEXEC_HB_PAGE_MAGIC 0x4a5db007
+#endif
+
#ifndef __ASSEMBLY__
/**
@@ -53,6 +57,10 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
/* Function pointer to optional machine-specific reinitialization */
extern void (*kexec_reinit)(void);
+#ifdef CONFIG_KEXEC_HARDBOOT
+extern void (*kexec_hardboot_hook)(void);
+#endif
+
#endif /* __ASSEMBLY__ */
#endif /* CONFIG_KEXEC */
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index c355aeb..29cdd2f 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -14,6 +14,9 @@
#include <asm/cacheflush.h>
#include <asm/mach-types.h>
#include <asm/system_misc.h>
+#include <linux/memblock.h>
+#include <linux/of_fdt.h>
+#include <asm/mmu_writeable.h>
extern const unsigned char relocate_new_kernel[];
extern const unsigned int relocate_new_kernel_size;
@@ -22,6 +25,12 @@ extern unsigned long kexec_start_address;
extern unsigned long kexec_indirection_page;
extern unsigned long kexec_mach_type;
extern unsigned long kexec_boot_atags;
+#ifdef CONFIG_KEXEC_HARDBOOT
+extern unsigned long kexec_hardboot;
+extern unsigned long kexec_boot_atags_len;
+extern unsigned long kexec_kernel_len;
+void (*kexec_hardboot_hook)(void);
+#endif
static atomic_t waiting_for_crash_ipi;
@@ -32,6 +41,37 @@ static atomic_t waiting_for_crash_ipi;
int machine_kexec_prepare(struct kimage *image)
{
+ struct kexec_segment *current_segment;
+ __be32 header;
+ int i, err;
+
+ /* No segment at default ATAGs address. try to locate
+ * a dtb using magic */
+ for (i = 0; i < image->nr_segments; i++) {
+ current_segment = &image->segment[i];
+
+ err = memblock_is_region_memory(current_segment->mem,
+ current_segment->memsz);
+ if (!err)
+ return - EINVAL;
+
+#ifdef CONFIG_KEXEC_HARDBOOT
+ if(current_segment->mem == image->start)
+ mem_text_write_kernel_word(&kexec_kernel_len, current_segment->memsz);
+#endif
+
+ err = get_user(header, (__be32*)current_segment->buf);
+ if (err)
+ return err;
+
+ if (be32_to_cpu(header) == OF_DT_HEADER)
+ {
+ mem_text_write_kernel_word(&kexec_boot_atags, current_segment->mem);
+#ifdef CONFIG_KEXEC_HARDBOOT
+ mem_text_write_kernel_word(&kexec_boot_atags_len, current_segment->memsz);
+#endif
+ }
+ }
return 0;
}
@@ -110,7 +150,10 @@ void machine_kexec(struct kimage *image)
unsigned long reboot_code_buffer_phys;
void *reboot_code_buffer;
- arch_kexec();
+ if (num_online_cpus() > 1) {
+ pr_err("kexec: error: multiple CPUs still online\n");
+ return;
+ }
page_list = image->head & PAGE_MASK;
@@ -120,10 +163,14 @@ void machine_kexec(struct kimage *image)
reboot_code_buffer = page_address(image->control_code_page);
/* Prepare parameters for reboot_code_buffer*/
- kexec_start_address = image->start;
- kexec_indirection_page = page_list;
- kexec_mach_type = machine_arch_type;
- kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET;
+ mem_text_write_kernel_word(&kexec_start_address, image->start);
+ mem_text_write_kernel_word(&kexec_indirection_page, page_list);
+ mem_text_write_kernel_word(&kexec_mach_type, machine_arch_type);
+ if (!kexec_boot_atags)
+ mem_text_write_kernel_word(&kexec_boot_atags, image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET);
+#ifdef CONFIG_KEXEC_HARDBOOT
+ mem_text_write_kernel_word(&kexec_hardboot, image->hardboot);
+#endif
/* copy our kernel relocation code to the control code page */
memcpy(reboot_code_buffer,
@@ -137,5 +184,18 @@ void machine_kexec(struct kimage *image)
if (kexec_reinit)
kexec_reinit();
+#ifdef CONFIG_KEXEC_HARDBOOT
+ /* Run any final machine-specific shutdown code. */
+ if (image->hardboot && kexec_hardboot_hook)
+ kexec_hardboot_hook();
+#endif
+
soft_restart(reboot_code_buffer_phys);
}
+
+void arch_crash_save_vmcoreinfo(void)
+{
+#ifdef CONFIG_ARM_LPAE
+ VMCOREINFO_CONFIG(ARM_LPAE);
+#endif
+}
diff --git a/arch/arm/kernel/relocate_kernel.S b/arch/arm/kernel/relocate_kernel.S
index d0cdedf..0e45ffc 100644
--- a/arch/arm/kernel/relocate_kernel.S
+++ b/arch/arm/kernel/relocate_kernel.S
@@ -4,6 +4,15 @@
#include <asm/kexec.h>
+#ifdef CONFIG_KEXEC_HARDBOOT
+#include <asm/memory.h>
+#if defined(CONFIG_ARCH_TEGRA_2x_SOC) || defined(CONFIG_ARCH_TEGRA_3x_SOC)
+ #include <mach/iomap.h>
+#elif defined(CONFIG_ARCH_APQ8064) || defined(CONFIG_ARCH_MSM8974)
+ #include <mach/msm_iomap.h>
+#endif
+#endif
+
.globl relocate_new_kernel
relocate_new_kernel:
@@ -52,6 +61,12 @@ relocate_new_kernel:
b 0b
2:
+#ifdef CONFIG_KEXEC_HARDBOOT
+ ldr r0, kexec_hardboot
+ teq r0, #0
+ bne hardboot
+#endif
+
/* Jump to relocated kernel */
mov lr,r1
mov r0,#0
@@ -60,6 +75,52 @@ relocate_new_kernel:
ARM( mov pc, lr )
THUMB( bx lr )
+#ifdef CONFIG_KEXEC_HARDBOOT
+hardboot:
+ /* Stash boot arguments in hardboot page:
+ * 0: KEXEC_HB_PAGE_MAGIC
+ * 4: kexec_start_address
+ * 8: kexec_mach_type
+ * 12: kexec_boot_atags
+ * 16: kexec_boot_atags_len
+ * 20: kexec_kernel_len */
+ ldr r0, =KEXEC_HB_PAGE_ADDR
+ str r1, [r0, #4]
+ ldr r1, kexec_mach_type
+ str r1, [r0, #8]
+ ldr r1, kexec_boot_atags
+ str r1, [r0, #12]
+ ldr r1, kexec_boot_atags_len
+ str r1, [r0, #16]
+ ldr r1, kexec_kernel_len
+ str r1, [r0, #20]
+ ldr r1, =KEXEC_HB_PAGE_MAGIC
+ str r1, [r0]
+
+#if defined(CONFIG_ARCH_TEGRA_2x_SOC) || defined(CONFIG_ARCH_TEGRA_3x_SOC)
+ ldr r0, =TEGRA_PMC_BASE
+ ldr r1, [r0]
+ orr r1, r1, #0x10
+ str r1, [r0]
+loop: b loop
+#elif defined(CONFIG_ARCH_APQ8064)
+ /* Restart using the PMIC chip, see mach-msm/restart.c */
+ ldr r0, =APQ8064_TLMM_PHYS
+ mov r1, #0
+ str r1, [r0, #0x820] @ PSHOLD_CTL_SU
+loop: b loop
+#elif defined(CONFIG_ARCH_MSM8974)
+ /* Restart using the PMIC chip, see mach-msm/restart.c */
+ ldr r0, =MSM8974_MPM2_PSHOLD_PHYS
+ mov r1, #0
+ str r1, [r0, #0]
+loop: b loop
+#else
+#error "No reboot method defined for hardboot."
+#endif
+
+ .ltorg
+#endif
.align
.globl kexec_start_address
@@ -79,6 +140,20 @@ kexec_mach_type:
kexec_boot_atags:
.long 0x0
+#ifdef CONFIG_KEXEC_HARDBOOT
+ .globl kexec_boot_atags_len
+kexec_boot_atags_len:
+ .long 0x0
+
+ .globl kexec_kernel_len
+kexec_kernel_len:
+ .long 0x0
+
+ .globl kexec_hardboot
+kexec_hardboot:
+ .long 0x0
+#endif
+
relocate_new_kernel_end:
.globl relocate_new_kernel_size
diff --git a/arch/arm/mach-msm/board-8974.c b/arch/arm/mach-msm/board-8974.c
index 6d52ccc..21b40dd 100644
--- a/arch/arm/mach-msm/board-8974.c
+++ b/arch/arm/mach-msm/board-8974.c
@@ -52,6 +52,13 @@
#include "amzn_ram_console.h"
#endif
+#ifdef CONFIG_KEXEC_HARDBOOT
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <linux/memblock.h>
+#define HDX_PERSISTENT_RAM_SIZE (SZ_1M)
+#endif
+
#if defined(CONFIG_ARCH_MSM8974_THOR) || defined(CONFIG_ARCH_MSM8974_APOLLO)
enum WLANBT_STATUS {
WLANOFF_BTOFF = 1,
@@ -84,12 +91,35 @@ static struct reserve_info msm8974_reserve_info __initdata = {
void __init msm_8974_reserve(void)
{
+#ifdef CONFIG_KEXEC_HARDBOOT
+ // Reserve space for hardboot page - just after ram_console,
+ // at the start of second memory bank
+ int ret;
+ phys_addr_t start;
+ struct membank* bank;
+#endif
+
reserve_info = &msm8974_reserve_info;
of_scan_flat_dt(dt_scan_for_memory_reserve, msm8974_reserve_table);
msm_reserve();
#if defined(CONFIG_AMZN_RAM_CONSOLE) && (defined(CONFIG_ARCH_MSM8974_THOR) || defined(CONFIG_ARCH_MSM8974_APOLLO))
amzn_ram_console_init(AMZN_RAM_CONSOLE_START_DEFAULT, AMZN_RAM_CONSOLE_SIZE_DEFAULT);
#endif
+
+#ifdef CONFIG_KEXEC_HARDBOOT
+ if (meminfo.nr_banks < 2) {
+ pr_err("%s: not enough membank\n", __func__);
+ return;
+ }
+
+ bank = &meminfo.bank[1];
+ start = bank->start + SZ_1M + HDX_PERSISTENT_RAM_SIZE;
+ ret = memblock_remove(start, SZ_1M);
+ if(!ret)
+ pr_info("Hardboot page reserved at 0x%X\n", start);
+ else
+ pr_err("Failed to reserve space for hardboot page at 0x%X!\n", start);
+#endif
}
static void __init msm8974_early_memory(void)
diff --git a/arch/arm/mach-msm/include/mach/memory.h b/arch/arm/mach-msm/include/mach/memory.h
index 6119a3c..abe4882 100644
--- a/arch/arm/mach-msm/include/mach/memory.h
+++ b/arch/arm/mach-msm/include/mach/memory.h
@@ -20,6 +20,15 @@
/* physical offset of RAM */
#define PLAT_PHYS_OFFSET UL(CONFIG_PHYS_OFFSET)
+#if defined(CONFIG_KEXEC_HARDBOOT)
+#if defined(CONFIG_ARCH_MSM8974_THOR) || defined(CONFIG_ARCH_MSM8974_APOLLO)
+#define KEXEC_HB_PAGE_ADDR UL(0x2F600000)
+#define KEXEC_HB_KERNEL_LOC UL(0x3208000)
+#else
+#error "Adress for kexec hardboot page not defined"
+#endif
+#endif
+
#define MAX_PHYSMEM_BITS 32
#define SECTION_SIZE_BITS 28
diff --git a/arch/arm/mach-msm/restart.c b/arch/arm/mach-msm/restart.c
index a96b02f..da157a4 100644
--- a/arch/arm/mach-msm/restart.c
+++ b/arch/arm/mach-msm/restart.c
@@ -38,6 +38,10 @@
#include "timer.h"
#include "wdog_debug.h"
+#ifdef CONFIG_KEXEC_HARDBOOT
+#include <asm/kexec.h>
+#endif
+
#define WDT0_RST 0x38
#define WDT0_EN 0x40
#define WDT0_BARK_TIME 0x4C
@@ -351,6 +355,26 @@ static int __init msm_pmic_restart_init(void)
late_initcall(msm_pmic_restart_init);
+#ifdef CONFIG_KEXEC_HARDBOOT
+static void msm_kexec_hardboot_hook(void)
+{
+ set_dload_mode(0);
+
+ // Set PMIC to restart-on-poweroff
+ pm8xxx_reset_pwr_off(1);
+
+ // These are executed on normal reboot, but with kexec-hardboot,
+ // they reboot/panic the system immediately.
+#if 0
+ qpnp_pon_system_pwr_off(PON_POWER_OFF_WARM_RESET);
+
+ /* Needed to bypass debug image on some chips */
+ msm_disable_wdog_debug();
+ halt_spmi_pmic_arbiter();
+#endif
+}
+#endif
+
static int __init msm_restart_init(void)
{
#ifdef CONFIG_MSM_DLOAD_MODE
@@ -367,6 +391,10 @@ static int __init msm_restart_init(void)
if (scm_is_call_available(SCM_SVC_PWR, SCM_IO_DISABLE_PMIC_ARBITER) > 0)
scm_pmic_arbiter_disable_supported = true;
+#ifdef CONFIG_KEXEC_HARDBOOT
+ kexec_hardboot_hook = msm_kexec_hardboot_hook;
+#endif
+
return 0;
}
early_initcall(msm_restart_init);
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index af84a25..a4509ad 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -111,6 +111,10 @@ struct kimage {
#define KEXEC_TYPE_CRASH 1
unsigned int preserve_context : 1;
+#ifdef CONFIG_KEXEC_HARDBOOT
+ unsigned int hardboot : 1;
+#endif
+
#ifdef ARCH_HAS_KIMAGE_ARCH
struct kimage_arch arch;
#endif
@@ -178,6 +182,11 @@ extern struct kimage *kexec_crash_image;
#define KEXEC_ON_CRASH 0x00000001
#define KEXEC_PRESERVE_CONTEXT 0x00000002
+
+#ifdef CONFIG_KEXEC_HARDBOOT
+#define KEXEC_HARDBOOT 0x00000004
+#endif
+
#define KEXEC_ARCH_MASK 0xffff0000
/* These values match the ELF architecture values.
@@ -196,10 +205,14 @@ extern struct kimage *kexec_crash_image;
#define KEXEC_ARCH_MIPS ( 8 << 16)
/* List of defined/legal kexec flags */
-#ifndef CONFIG_KEXEC_JUMP
-#define KEXEC_FLAGS KEXEC_ON_CRASH
-#else
+#if defined(CONFIG_KEXEC_JUMP) && defined(CONFIG_KEXEC_HARDBOOT)
+#define KEXEC_FLAGS (KEXEC_ON_CRASH | KEXEC_PRESERVE_CONTEXT | KEXEC_HARDBOOT)
+#elif defined(CONFIG_KEXEC_JUMP)
#define KEXEC_FLAGS (KEXEC_ON_CRASH | KEXEC_PRESERVE_CONTEXT)
+#elif defined(CONFIG_KEXEC_HARDBOOT)
+#define KEXEC_FLAGS (KEXEC_ON_CRASH | KEXEC_HARDBOOT)
+#else
+#define KEXEC_FLAGS (KEXEC_ON_CRASH)
#endif
#define VMCOREINFO_BYTES (4096)
diff --git a/kernel/kexec.c b/kernel/kexec.c
index 4e2e472..aef7893 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1004,6 +1004,10 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
if (flags & KEXEC_PRESERVE_CONTEXT)
image->preserve_context = 1;
+#ifdef CONFIG_KEXEC_HARDBOOT
+ if (flags & KEXEC_HARDBOOT)
+ image->hardboot = 1;
+#endif
result = machine_kexec_prepare(image);
if (result)
goto out;
MultiROM Recovery Image Running
- See attached screenshot
- The recovery.img output was exceeding the recovery partition size
- I resolved this by compressing the kernel with xz reducing the output size by ~300KB...
- and have switched the recovery ramdisk to be compressed with lzma further reducing the output size by ~2MB
- That's one more step further
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
=== MaviCin MultiTools QTR V1.9 (Developer = Quandrostr) === Turkish === English ===
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
=== Türkçe Tanım ===
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Bu kelimeler artık sizin için anlam bulacak hadi daha fazla düşünme proğramı indir ve hemen dene sende Android dünyasının içine dal Birşeyler yapmak hiç bukadar kolay ve sorunsuz olmamıştı hadi başlayalım
Apk , Rom , De O Dex , Odex , Deodex , Bat , Batch , Dex
Arsc , Raw , MultiTools , MaviCin , QTR , Classes , Resources
Smali , Baksmali , Signapk , Singin , zipalign , Jar , Adb , Root
Unroot , oat2dex , Log , Android , Apktool , Smali
App , Framework , Priv-app
DİLLER
Arabia
Belarusian
Chinese
English
French
German
Russian
Spanish
Turkish
Ukrainian
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
=== English Description ===
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
These words are now thinking more programs let you download and immediately try to find means to make you dive into the Android world, something did not always come easy and has never been smooth start
Apk, Rum, said He Dexin, Odex, Deodex, Bat, Batch, Dex
ARSC, Raw, Multitools, MaviCin, QT, Classes, Resources
S should, Look up, Signapur, Sing, zipalign, Jr., Adb, Root
Unroot, oat2dex, Logan, Android, Apktool must S
App Framework Prive in-app
LANGUAGES
Arabia
Belarusian
Chinese
English
French
German
Russian
Spanish
Turkish
Ukrainian
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
=== Not ===
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
NOT 1 : Olurda IniFile hatası alırsanız bu sizin 32 bit değil 64 bit bir sistem kullandığınızdan dolayıdır ve aşağıdaki adreslerden
IniFile nin adresine bakıp oradan 64 bit olan dosyayı indirip "bininifile.exe" dizinindeki dosyayı silip onu kopyalamanız sorunu çözecektir
NOT 2 : Lütfen açıklamaları dikkatlice okuyunuz ve karşılaştığınız sıkıntılar için mail atmaya çekinmeyiniz.Program "MaviCinMultiToolsV13Ultimate-Update6"
Programının üzerinden gidilerek az ve öz olması daha fazla insana hitap etmesi amacı güdülerek yazılmıştır "[email protected]" adresinden
yada internet sitelerinden "Quandrostr" adından bana ulaşabilirsiniz.
NOT 3 : Programı kullanabilmek için temiz bir Windows ve Java yazılımlarına ihtiyacınız vardır yava yazılımlarını
"http://www.java.com/tr/download/manual.jsp#win"
"http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html"
"https://jdk9.java.net/download/"
Adreslerinden indirebilirsiniz unutmayınki Javanın "JRE ve JDK" yazılımlarının ikisinide kurmak sizin menfaatiniz içindir.
NOT 4 : Unutmayınki "MaviCin MultiTools QTR (Quandrostr)" yazılımı bir kople pakettir ve her fırsattada güncellenecektir. Güncellemelerin
Çıkıp çıkmadığını takip ederek en son "MaviCin MultiTools QTR (Quandrostr)" yazılımını kullanınız mutlaka
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
=== Note ===
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
NOTE 1: It's a mistake if you get Inifile this is not because you are using a system of 32-bit and 64-bit your address below
Ini look to the address to download the file from there with 64-bit "bin inifile.ex to" delete the files in the directory to copy it will solve the problem
NOTE 2: Please read the descriptions carefully and çekinmeyiniz.progra to take mail to the difficulties you encounter "mavicinmultitoolsv13ultimat to-Update6"
and be less self-propelled purpose by going through the program was written to appeal to more people, "[email protected] is" from
or from the website "Quandrost is" the name you can contact me.
NOTE 3: To use the program, you need to clean the slower Windows and Java software
"Http://www.java.com/tr/download/manual.jsp#w's"
"Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html"
"Https://jdk9.java.net/download/"
Note that it can download from the address of Java "JRE and JDK" software install them both is for your benefit.
NOTE 4: Note that "MaviCin Multitools QT (the Quandrost)" software is a combi pack and will be updated every fırsatta. updates
Following out whether the latest "MaviCin Multitools QT (Quandrost is)" You must use the software
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
=== MaviCin MultiTools QTR V1.9 (Developer = Quandrostr) === Turkish === English ===
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
MaviCin MultiTools QTR V2
- Ufak düzenlemeler yapıldı.
MaviCin MultiTools QTR V2
- Small adjustments were made.
--------------------------------------------------------------------------------------------------------
=== Türkçe Tanım
MaviCin MultiTools QTR V1.9
- "MaviCinMultiToolsV13Ultimate-Update6" İçerisinden çok kullanılan özellikler "MaviCin MultiTools QTR V1.9" da toplandı
- Program ilk olarak "V1.9" versiyonu ile yayınlandı
- Programda kullanılan tüm yazılımlar son sürümleri ile güncellendi
- Arabia , Belarusian , Chinese , English , French , German , Russian , Spanish , Turkish , Ukrainian dilleri eklendi
- Uyğulama logosu eklendi
- Gereksiz görülen menüler çıkarılıp stabilizasyon yapıldı
- Pek çok hata düzeltmesi yapıldı
- Veritabanı eklenip seçmeli apktool , smali ve diger ayarlar eklendi
- Hakkında bölümü programa uyğun bir şekilde yeniden güncellendi
- Bug sıkıntıları giderildi
- Windows 10 desteği ilerletildi
- Tüm ayıklama modları birleştirildi
-|||- -|||- -|||- -|||- -|||-
=== English Description
MaviCin MultiTools QTR v1.9
- "MaviCinMultiToolsV13Ultimate-Update6" Within commonly used features "MaviCin MultiTools QTR v1.9" gathered
- The Program first "v1.9" version was released with the latest versions of all software used in the program-updated with
- Arabia , Belarusian, Chinese, English, French, German, Russian, Spanish, Turkish, Ukrainian languages added
- Added logo Overprints
- Unnecessary was whether stabilization menus seen
- Lots of error correction is made
- Added Database should I choose apktool, smali and sets the added
- Section has been updated again to the program
- Fixed Bug problems
- Support for Windows 10 escalated
- Merged All extraction modes
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
=== English (All of my application) - Turkish (Bütün Uygulamalarım) ===
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
=== Turkish (İndirin-WinRAR 5.xx Kullanın) === English Download-(Use WinRAR 5.xx) ===
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mod edit: links removed.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
This tool is kanged from another tool.
Thread closed.