Skip to content

Instantly share code, notes, and snippets.

@pamaury
pamaury / icoll-imx233.c
Created January 30, 2014 22:03
nested interrupt handling
void irq_handler(void)
{
/* read vector and notify as a read side-effect */
uint32_t vec = HW_ICOLL_VECTOR;
/* Save registers on IRQ stack, switch to SVC and renable interrupts */
asm volatile(
"mrs lr, spsr \n" /* Save SPSR_irq */
"stmfd sp!, { lr } \n" /* Push it on the IRQ stack */
"msr cpsr_c, #0x13 \n" /* Switch to SVC mode, enable IRQ */
"stmfd sp!, { lr } \n" /* Save lr_SVC */
void irq_handler(void)
{
/* save stuff */
asm volatile(
"sub lr, lr, #4 \n" /* Create return address */
"stmfd sp!, { r0-r6, r12, lr } \n" /* Save what gets clobbered */
"ldr r0, =0x80000000 \n" /* Read HW_ICOLL_VECTOR */
"ldr r0, [r0] \n" /* and notify as side-effect */
"ldr r1, =0x8001c290 \n" /* Save pointer to instruction */
"str lr, [r1] \n" /* in HW_DIGCTL_SCRATCH0 */
@pamaury
pamaury / systemd.log
Created October 13, 2014 19:58
Systemd portmap / nfs dependency problem
-- Logs begin at lun. 2014-10-13 21:52:31 CEST, end at lun. 2014-10-13 21:55:55 CEST. --
oct. 13 21:52:31 destiny systemd-journal[183]: Runtime journal is using 8.0M (max allowed 119.4M, trying to leave 179.1M free of 1.1G available → current limit 119.4M).
oct. 13 21:52:31 destiny systemd-journal[183]: Runtime journal is using 8.0M (max allowed 119.4M, trying to leave 179.1M free of 1.1G available → current limit 119.4M).
oct. 13 21:52:31 destiny kernel: Initializing cgroup subsys cpuset
oct. 13 21:52:31 destiny kernel: Initializing cgroup subsys cpu
oct. 13 21:52:31 destiny kernel: Initializing cgroup subsys cpuacct
oct. 13 21:52:31 destiny kernel: Linux version 3.16-2-amd64 (debian-kernel@lists.debian.org) (gcc version 4.8.3 (Debian 4.8.3-11) ) #1 SMP Debian 3.16.3-2 (2014-09-20)
oct. 13 21:52:31 destiny kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-3.16-2-amd64 root=UUID=e1270b8f-60b8-4f97-863a-af2d6d6c8fe3 ro quiet systemd.log_level=debug
oct. 13 21:52:31 destiny kernel: e820: BIOS-provided physical RAM
diff --git a/utils/hwstub/hwstub_protocol.h b/utils/hwstub/hwstub_protocol.h
index 33081d3..a19f448 100644
--- a/utils/hwstub/hwstub_protocol.h
+++ b/utils/hwstub/hwstub_protocol.h
@@ -140,6 +140,7 @@ struct hwstub_device_desc_t
#define HWSTUB_READ2 0x42
#define HWSTUB_WRITE 0x43
#define HWSTUB_EXEC 0x44
+#define HWSTUB_READ_ROM 0x45
diff --git a/lib/Target/Mips/Disassembler/MipsDisassembler.cpp b/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
index 5d594f1..dd1a29b 100644
--- a/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
+++ b/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
@@ -247,6 +247,11 @@ static DecodeStatus DecodeCacheOp(MCInst &Inst,
uint64_t Address,
const void *Decoder);
+static DecodeStatus DecodeSyncI(MCInst &Inst,
+ unsigned Insn,
@pamaury
pamaury / virtual-soc.xml
Last active August 29, 2015 14:11
New description format
<?xml version="1.0"?>
<soc>
<name>vsoc</name>
<title>Virtual SOC</title>
<desc>Virtual SoC is a nice and powerful chip.</desc>
<author>Amaury Pouly</author>
<isa>ARM</isa>
<version>0.5</version>
<node>
<title>Interrupt Collector</title>
#/bin/bash
TMPDIR="./tmp-check-defines"
SEARCH_DIRS="apps/ firmware/ uisimulator/"
function usage()
{
echo "Usage: $0 <build file> <define 1> [<define 2>...]"
echo "If the define name is suffixed with @ or ~, the tool will also print its value"
echo "Furthermore, if a regex follows the @, the tool will try to list all defines"
#invocation ./check_defines.sh ../www/buildserver/builds HAVE_USBSTACK USB_STATUS_BY_EVENT USB_DETECT_BY_REQUEST CONFIG_CPU~ CONFIG_USBOTG~ USB_NONE HAVE_BOOTLOADER_USB_MODE HAVE_USB_POWER HAVE_USB_CHARGING_ENABLE
iriverh100: CONFIG_CPU=MCF5249 CONFIG_USBOTG=0
iriverh120: CONFIG_CPU=MCF5249 CONFIG_USBOTG=0
iriverh300: CONFIG_CPU=MCF5249 CONFIG_USBOTG=USBOTG_ISP1362 HAVE_USB_POWER HAVE_USB_CHARGING_ENABLE
iaudiox5: CONFIG_CPU=MCF5250 CONFIG_USBOTG=USBOTG_M5636
iaudiom5: CONFIG_CPU=MCF5250 CONFIG_USBOTG=0
iaudiom3: CONFIG_CPU=MCF5249 CONFIG_USBOTG=0
mpiohd200: CONFIG_CPU=MCF5249 CONFIG_USBOTG=0
mpiohd300: CONFIG_CPU=MCF5249 CONFIG_USBOTG=0
ipodnano1g: HAVE_USBSTACK USB_STATUS_BY_EVENT USB_DETECT_BY_REQUEST CONFIG_CPU=PP5022 CONFIG_USBOTG=USBOTG_ARC HAVE_USB_POWER HAVE_USB_CHARGING_ENABLE
@pamaury
pamaury / english_lang.diff
Last active August 29, 2015 14:15
Fix ZEN lang string
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 1135705..80b9046 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -336,6 +336,7 @@
mrobe500: "PLAY, POWER, or top-right = Yes"
archosplayer: "(PLAY/STOP)"
vibe500: "OK = Yes"
+ creativezen*: "Select = Yes"
</source>
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index 44e5ab2..2659c79 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -364,8 +364,9 @@ void dc_writeback_callback(IF_MV(int volume,) unsigned long sector, void *buf)
int rc = storage_write_sectors(IF_MD(fat_bpb->drive,) sector, 1, buf);
if (rc < 0)
{
+ extern const char *sd_msg;
panicf("%s() - Could not write sector %ld"