The information about mmap() provided here works for Arch Linux kernel 4.1.13. I've not updated my kernel because I have the Cirrus/Element14 sound board and the driver comes as part of a pre-patched kernel. I currently have it running with the console UART port at 31250 baud. The "hack" uses the mmap() function to give access to the UART device registers directly which bypasses whatever they did in the kernel. Instead of changing the UART clock, the code instead leaves the UART clock at 3000000 and instead uses a clock divider of 6. This sets the bit clock at 3000000/6 or 500000 which just happens to be 16 times 31250.
I used the code posted by StuartF to first get ttymidi working at 31250. There were a couple of things missing from the code that StuartF kindly provided (all documented in this thread). And yes, once I got the code to compile, ttymidi stopped producing crap data. I used ZynAddSubFX to test it.
Currently, I've developed my own MIDI synthesizer (a 32 voice Karplus-Strong Synth) that uses the same technique to change the UART baud rate to 31250.
Unfortunately, it's not just a simple function call and your done, you have to understand what ttymidi is doing to set the UART up and modify it with the mmap() method. I would prefer not to post my ttymidi code because I don't feel I'm qualified to add to the project (which is where the code ought to be posted).