mtd: pull in old CWM functions